A developer is setting up an AWS CodeBuild project to compile a Java application and upload the build artifacts to an Amazon S3 bucket. During the first build execution, CodeBuild fails to upload the artifacts, returning an Access Denied error. Additionally, the developer wants the project to use a custom build specification file named build-config.yml located in the config directory of the repository, rather than using the default root-level buildspec.yml file.
Which configuration steps must the developer perform to resolve the upload failure and use the custom build specification? (Select TWO.)
- Update the buildspec path in the CodeBuild project settings to config/build-config.yml.Cevap
- Modify the CodeBuild service role permissions policy to allow the s3:PutObject action on the artifacts bucket.Cevap
- CDefine the custom build specification contents within a Systems Manager Parameter Store parameter and pass the parameter name in the buildspec.
- DCreate a default buildspec.yml file in the repository root and define a redirect block under the install phase pointing to config/build-config.yml.
- EModify the IAM trust policy of the Amazon ECS task execution role to allow the codebuild.amazonaws.com service principal to assume it.
Cevap
The correct steps are to update the buildspec path in the CodeBuild project settings to point to the custom path, and to modify the CodeBuild service role permissions policy to allow writing objects to the S3 bucket.
To use a custom build specification file that is not in the root directory or has a different name, the developer must configure the file path in the project settings. Additionally, since the build environment failed to upload the artifacts to Amazon S3 with an Access Denied error, the CodeBuild service role must be updated with a policy that allows the write action on the target S3 bucket.
Adım Adım Çözüm
Anahtar Kavram
AWS CodeBuild custom buildspecs and permissions