A developer is configuring an AWS CodeBuild project to compile and package a Java application. The buildspec.yml file is placed in the root of the source repository and contains a valid artifacts section listing the target JAR file. The build execution completes with a status of SUCCEEDED, but no artifacts are uploaded to the destination Amazon S3 bucket. Which of the following is the most likely cause of this issue?
- The artifact type in the CodeBuild project configuration is set to 'No artifacts'.Answer
- BThe buildspec.yml file is placed at the root of the source directory, but it must be moved to the target/ subdirectory where the JAR file is located.
- CThe trust policy of the CodeBuild service role does not list the Amazon S3 service principal in the Principal element.
- DThe target S3 bucket name is stored in Systems Manager Parameter Store, but the buildspec.yml retrieves it using the secrets-manager parameter type.
Answer
The artifact type in the CodeBuild project configuration is set to 'No artifacts'.
The correct answer is correct because AWS CodeBuild requires the artifact output configuration to be enabled in the project configuration (e.g., set to Amazon S3) for it to upload the files specified in the buildspec.yml. When set to 'No artifacts', CodeBuild executes the build successfully but performs no upload actions.
Step-by-Step Solution
Key Concept
AWS CodeBuild project configuration settings for artifacts override buildspec declarations.