require-aws-amplify-artifacts-base-directory
Require artifacts.baseDirectory in AWS Amplify build specifications.
Targeted pattern scopeâ
amplify.ymloramplify.yamlfiles with anartifacts:block that does not declarebaseDirectory:.
What this rule reportsâ
This rule reports Amplify configs that define deployment artifacts without an explicit output directory.
Why this rule existsâ
Making the output directory explicit avoids deployment drift between dashboard settings and repository state. It also makes monorepo output paths easier to review.
â Incorrectâ
version: 1
frontend:
phases:
build:
commands:
- npm run build
artifacts:
files:
- "**/*"
â Correctâ
version: 1
frontend:
phases:
build:
commands:
- npm run build
artifacts:
baseDirectory: dist
files:
- "**/*"
When not to use itâ
Disable this rule if Amplify output directories are managed outside the build spec and that trade-off is intentional.
Rule catalog ID: R063