amplify.yml
AWS Amplify Console build settings file
| Type | object |
|---|---|
| File match |
amplify.yml
amplify.yaml
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/amplify-yml/latest.json |
| Source | https://www.schemastore.org/amplify.json |
Validate with Lintel
npx @lintel/lintel check
Build settings for AWS Amplify Console. See https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html
Properties
Schema version. Use 1 for current specification.
Path within the repository where the application resides (used in monorepo setups)
Environment configuration
1 nested properties
Key-value pairs of environment variables
Backend build configuration
1 nested properties
Build phases with preBuild, build, and postBuild steps
3 nested properties
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
Frontend build configuration
5 nested properties
Path to run install/build from (lowercase variant)
Path to run install/build from (camelCase variant)
Build phases with preBuild, build, and postBuild steps
3 nested properties
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
Build output artifacts configuration
3 nested properties
Files to include in the build artifact (e.g., '**/*' for all files)
Whether to flatten the directory structure of artifacts
Directory containing the build output
Cache configuration for speeding up builds
1 nested properties
Paths to cache between builds (must be relative to project root)
Test build configuration
2 nested properties
Test phases with preTest, test, and postTest steps
3 nested properties
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
Test output artifacts configuration
3 nested properties
Test output files to capture (e.g., screenshots, videos)
Path to the test report configuration file
Directory containing the test output
List of applications for monorepo support
Custom HTTP response headers (legacy; consider using customHttp.yml instead)
Definitions
Schema version. Use 1 for current specification.
10.1
Path within the repository where the application resides (used in monorepo setups)
Environment configuration
Key-value pairs of environment variables
A build phase containing commands to execute
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
Build phases with preBuild, build, and postBuild steps
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
Test phases with preTest, test, and postTest steps
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
Build output artifacts configuration
Files to include in the build artifact (e.g., '**/*' for all files)
Whether to flatten the directory structure of artifacts
Directory containing the build output
Test output artifacts configuration
Test output files to capture (e.g., screenshots, videos)
Path to the test report configuration file
Directory containing the test output
Cache configuration for speeding up builds
Paths to cache between builds (must be relative to project root)
Backend build configuration
Build phases with preBuild, build, and postBuild steps
3 nested properties
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
Frontend build configuration
Path to run install/build from (lowercase variant)
Path to run install/build from (camelCase variant)
Build phases with preBuild, build, and postBuild steps
3 nested properties
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
Build output artifacts configuration
3 nested properties
Files to include in the build artifact (e.g., '**/*' for all files)
Whether to flatten the directory structure of artifacts
Directory containing the build output
Cache configuration for speeding up builds
1 nested properties
Paths to cache between builds (must be relative to project root)
Test build configuration
Test phases with preTest, test, and postTest steps
3 nested properties
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
A build phase containing commands to execute
2 nested properties
Shell commands to execute in this phase
Runtime versions to use (e.g., nodejs: 18)
Test output artifacts configuration
3 nested properties
Test output files to capture (e.g., screenshots, videos)
Path to the test report configuration file
Directory containing the test output
A custom HTTP response header rule
URL path pattern to match
Headers to apply for matching requests
Custom HTTP response headers (legacy; consider using customHttp.yml instead)
A single application configuration within a monorepo
Path within the repository where the application resides (used in monorepo setups)
Environment configuration
1 nested properties
Key-value pairs of environment variables
Backend build configuration
Frontend build configuration
5 nested properties
Path to run install/build from (lowercase variant)
Path to run install/build from (camelCase variant)
Build phases with preBuild, build, and postBuild steps
Build output artifacts configuration
3 nested properties
Files to include in the build artifact (e.g., '**/*' for all files)
Whether to flatten the directory structure of artifacts
Directory containing the build output
Cache configuration for speeding up builds
1 nested properties
Paths to cache between builds (must be relative to project root)
Test build configuration
2 nested properties
Test phases with preTest, test, and postTest steps
Test output artifacts configuration
3 nested properties
Test output files to capture (e.g., screenshots, videos)
Path to the test report configuration file
Directory containing the test output
Custom HTTP response headers (legacy; consider using customHttp.yml instead)
Examples
{
"version": 1,
"env": {
"variables": {
"key": "value"
}
},
"backend": {
"phases": {
"preBuild": {
"commands": [
"enter command"
]
},
"build": {
"commands": [
"enter command"
]
},
"postBuild": {
"commands": [
"enter command"
]
}
}
},
"frontend": {
"phases": {
"preBuild": {
"commands": [
"cd react-app",
"npm ci"
]
},
"build": {
"commands": [
"npm run build"
]
}
},
"artifacts": {
"files": [
"**/*"
],
"discard-paths": true,
"baseDirectory": "build"
},
"cache": {
"paths": [
"node_modules/**/*"
]
}
},
"test": {
"phases": {
"preTest": {
"commands": [
"enter command"
]
},
"test": {
"commands": [
"enter command"
]
},
"postTest": {
"commands": [
"enter command"
]
}
},
"artifacts": {
"files": [
"location"
],
"configFilePath": "location",
"baseDirectory": "location"
}
}
}
{
"version": 1,
"applications": [
{
"appRoot": "frontend",
"frontend": {
"phases": {
"preBuild": {
"commands": [
"yarn install"
]
},
"build": {
"commands": [
"yarn build"
]
}
},
"artifacts": {
"baseDirectory": "build",
"files": [
"**/*"
]
},
"cache": {
"paths": [
"node_modules/**/*"
]
}
}
}
]
}