Question 7
Domain 1: SDLC AutomationA company is building a web and mobile application that uses a serverless architecture powered by AWS Lambda and Amazon API Gateway. The company wants to fully automate the backend Lambda deployment based on code that is pushed to the appropriate environment branch in an AWS CodeCommit repository. The deployment must have the following: Separate environment pipelines for testing and production Automatic deployment that occurs for test environments only Which steps should be taken to meet these requirements?
Correct answer: C
Explanation
This meets the need for "Separate environment pipelines for testing and production" by using two AWS CodePipeline configurations, one per environment. It also satisfies "Automatic deployment that occurs for test environments only" because the production pipeline includes a manual approval step, while each pipeline pulls from the matching CodeCommit branch and deploys Lambda with AWS CloudFormation.
Why each option is right or wrong
A. Configure a new AWS CodePipeline service. Create a CodeCommit repository for each environment. Set up CodePipeline to retrieve the source code from the appropriate repository. Set up the deployment step to deploy the Lambda functions with AWS CloudFormation.
One pipeline cannot cleanly separate test and production release controls or add prod-only approval behavior.
B. Create two AWS CodePipeline configurations for test and production environments. Configure the production pipeline to have a manual approval step. Create a CodeCommit repository for each environment. Set up each CodePipeline to retrieve the source code from the appropriate repository. Set up the deployment step to deploy the Lambda functions with AWS CloudFormation.
Separate repositories are unnecessary; the requirement is satisfied with one repository and environment branches.
C. Create two AWS CodePipeline configurations for test and production environments. Configure the production pipeline to have a manual approval step. Create one CodeCommit repository with a branch for each environment. Set up each CodePipeline to retrieve the source code from the appropriate branch in the repository. Set up the deployment step to deploy the Lambda functions with AWS CloudFormation.
AWS CodePipeline supports distinct pipelines per environment, and a manual approval action is the documented control point for blocking promotion in the production path under the CodePipeline action structure. By using one CodeCommit repository with separate branches and configuring each pipeline’s source action to point at the matching branch, the deployment can be triggered automatically from code pushes for test while production waits for approval; CloudFormation is the correct deployment action for provisioning the Lambda-backed stack as infrastructure as code.
D. Create an AWS CodeBuild configuration for test and production environments. Configure the production pipeline to have a manual approval step. Create one CodeCommit repository with a branch for each environment. Push the Lambda function code to an Amazon S3 bucket. Set up the deployment step to deploy the Lambda functions from the S3 bucket.
CodeBuild builds code; CodePipeline orchestrates source, approval, and deployment workflow across environments.