A developer is configuring an AWS CodeBuild project for a repository that contains multiple build configurations. The developer needs the project to use a custom build specification file named `buildspec-dev.yml` located inside a nested folder named `config`. How should the developer configure CodeBuild to locate this file?
- AMove the file to a subdirectory named `build/` because CodeBuild automatically searches for any file ending in `.yml` within subdirectories.
- Specify the relative path to the file, `config/buildspec-dev.yml`, in the buildspec override setting of the CodeBuild project configuration.Answer
- CDefine the custom path inside the trust policy of the IAM service role assigned to the CodeBuild project.
- DStore the entire content of `buildspec-dev.yml` as a secure string parameter in AWS Systems Manager Parameter Store and configure CodeBuild to retrieve it.
Answer
Specify the relative path to the file, `config/buildspec-dev.yml`, in the buildspec override setting of the CodeBuild project configuration.
To use a buildspec file that has a custom name or is not located in the root of the source directory, the developer must specify the relative path to the file in the buildspec override setting of the CodeBuild project configuration. This instructs CodeBuild where to look for the file within the source code repository.
Step-by-Step Solution
Key Concept
AWS CodeBuild supports overriding the default buildspec file name and location by configuring the buildspec path relative to the repository root.
Estimated Time:1m 0s