AWS CodePipeline: Configuring Input/Output Artifacts for Build Actions

Which Configurations of Input/Output Artifacts are Correct for Two Build Actions in Parallel in AWS CodePipeline?

Prev Question Next Question

Question

You are using AWS CodePipeline service to build up a pipeline for a new web application.

In the Source stage, the source provider is GitHub, and its output artifact is configured as WebApp.

In the Build stage, there are two build actions in parallel and both of them have used AWS CodeBuild as the service provider.

For these two build actions, which configurations of input/output artifacts are correct?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer - C.

Refer to.

https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html?icmpid=docs_acp_console#input-output-artifacts

for how to set up input/output artifacts of the CodeBuild stage in CodePipeline.

One thing to note is that CodeBuild should have at least 1 input artifact:

Option A is incorrect: As there is only 1 output artifact (WebApp) in the Source stage, the input artifact of the Build stage should be exactly the same.

So WebApp2 is incorrect.

Option B is incorrect: Because input artifacts of empty and WebApp2 are incorrect.

Option C is CORRECT: Because both input and output artifacts are appropriate.

Option D is incorrect: Because output artifact names must be unique within a pipeline which means the name of WebAppBuild should not be used in both CodeBuild stages.

Policy ARN —_arn:aws:iamn EEE olicy/CodeDeployDemo-EC2-Permissions (2)

Description

Permissions  Policyusage Policy versions += Access Advisor

Access advisor shows the service permissions granted to this user and when those services were last accessed. You can use this information to revise your policies. Learn more

Note: Recent activity usually appears within 4 hours. Data is stored for a maximum of 365 days, depending when your region began supporting this feature. Learn more

Filter: No filter ~

Service Name + Access by Entities Last Accessed ~

‘Amazon $3 s8-admin-access and 1 more 101 days ago

Showing 1 results

The correct answer is D. Build Action 1 (input artifact: WebApp, output artifact:WebAppBuild); Build Action 2 (input artifact: WebApp, output artifact:WebAppBuild).

Explanation: In the Source stage of the pipeline, the source provider is GitHub, and its output artifact is configured as WebApp.

In the Build stage, there are two build actions in parallel, and both of them use AWS CodeBuild as the service provider.

When using AWS CodeBuild as the service provider, the build output artifacts are automatically uploaded to Amazon S3, where they can be used as inputs to subsequent stages in the pipeline.

Therefore, in order for the second build action to use the output of the first build action as input, they need to have the same output artifact name. That is why option D is the correct answer, since both build actions output the same artifact name 'WebAppBuild'.

Option A is incorrect because it uses different artifact names for both build actions, 'WebAppBuild1' and 'WebAppBuild2'. This would mean that the second build action wouldn't be able to use the output of the first build action.

Option B is incorrect because the first build action does not have an input artifact. This would mean that it would not be able to access the source code from the Source stage, which is essential for building the application.

Option C is incorrect because it uses different artifact names for both build actions, 'WebAppBuild1' and 'WebAppBuild2'. This would mean that the second build action wouldn't be able to use the output of the first build action.

Therefore, the correct configuration of input/output artifacts for the two build actions in parallel is option D.