Question 1
A team wants to send an email to a developer every time a CodePipeline execution fails. Which solution requires the LEAST effort?
- Add a CodeBuild action at the end of the pipeline that sends an email when earlier stages fail.
- Create a notification rule on the pipeline for the failed execution event with an SNS topic target. — Correct
- Create a CloudTrail trail and an S3 event that emails the developer when the pipeline fails.
- Create a CloudWatch alarm on the pipeline's FailedExecutions metric with an email action.
Correct answer
Create a notification rule on the pipeline for the failed execution event with an SNS topic target.
Explanation
Notification rules for developer tools send pipeline events to SNS with a few clicks. Alarms on custom metrics need extra setup. A final action does not run when an earlier stage fails. CloudTrail with S3 events is indirect and delayed.
Question 2
A company runs a Node.js web application on EC2 instances in an Auto Scaling group. A new AMI must be rolled out gradually, keeping at least 90 percent of instances healthy, and the rollout must stop if instances fail health checks. Which solution meets these requirements?
- Update the launch template with the new AMI and terminate all instances so that the group launches new ones.
- Update the launch template with the new AMI and start an Auto Scaling instance refresh with a minimum healthy percentage of 90. — Correct
- Use CodeDeploy with the OneAtATime deployment configuration to install the new AMI on each of the existing instances in the group.
- Create a new Auto Scaling group with the new AMI, and switch the load balancer's listener to the new group's target group immediately.
Correct answer
Update the launch template with the new AMI and start an Auto Scaling instance refresh with a minimum healthy percentage of 90.
Explanation
Instance refresh replaces instances in batches while keeping the minimum healthy percentage, and it can stop on failed checks. Terminating everything causes downtime. A full switch is not gradual. CodeDeploy deploys application revisions, not AMIs.
Question 3
A company has dev and prod stages in an API Gateway REST API. Each stage must invoke a different version of the same Lambda function. The developer wants to promote new code by changing a pointer, without editing the API integration each time. Which solution meets these requirements?
- Create two separate Lambda functions for dev and prod, and redeploy the API with a new integration ARN whenever code is promoted.
- Create Lambda aliases named dev and prod, use a stage variable in the integration ARN to select the alias, and grant API Gateway permission on each alias. — Correct
- Enable a canary release on the prod stage that sends 100 percent of traffic to the newest Lambda function version after the dev stage tests pass.
- Point both stages to the $LATEST version, and use Lambda environment variables and the stage name in the event to choose the code path at runtime.
Correct answer
Create Lambda aliases named dev and prod, use a stage variable in the integration ARN to select the alias, and grant API Gateway permission on each alias.
Explanation
Stage variables can insert the alias name into the integration URI, and moving an alias promotes code without changing the API. Each alias needs its own resource-based permission. Separate functions require integration changes. $LATEST is shared by both stages. A canary release routes traffic between API deployments, not Lambda versions.
Question 4
A CloudFormation stack creation failed and the stack is now in the ROLLBACK_COMPLETE state. The developer fixed the template and wants to deploy again with the same stack name. What must the developer do?
- Run continue-update-rollback on the stack and then update it.
- Run an update on the stack with the fixed template.
- Delete the stack, and then create it again with the fixed template. — Correct
- Import the failed resources into the stack and then update it.
Correct answer
Delete the stack, and then create it again with the fixed template.
Explanation
A stack in ROLLBACK_COMPLETE after a failed create cannot be updated and must be deleted first. continue-update-rollback applies to UPDATE_ROLLBACK_FAILED. Resource import does not change the stack's status.
Question 5
A developer's Lambda deployment package is 120 MB as a zip file. Uploading the package directly with the UpdateFunctionCode API fails. The unzipped size is 200 MB. What should the developer do?
- Request a service quota increase for the direct upload limit of Lambda deployment packages.
- Split the zip file into two parts and upload each part with a separate UpdateFunctionCode call.
- Convert the zip file to a Lambda layer and upload the layer with the PublishLayerVersion API.
- Upload the zip file to an S3 bucket and update the function code by referencing the S3 object. — Correct
Correct answer
Upload the zip file to an S3 bucket and update the function code by referencing the S3 object.
Explanation
Direct uploads are limited to 50 MB zipped, but packages up to 250 MB unzipped can be deployed from S3. Layers have the same direct upload limit. Lambda does not accept multipart code uploads. The limit is fixed.
Question 6
A team's CodePipeline builds a container image and deploys it to ECS. The team wants the build to fail if the image has critical vulnerabilities. Which solution meets this requirement?
- Enable tag immutability on the ECR repository so that images with known vulnerabilities cannot be pushed with an existing release tag.
- Enable Amazon Inspector enhanced scanning for ECR and add a pipeline step that checks the scan findings and fails on critical severity. — Correct
- Configure an ECR lifecycle policy that deletes images with critical findings after 1 day.
- Enable CloudTrail data events for the ECR repository and create a CloudWatch alarm on PutImage calls that include vulnerable layers.
Correct answer
Enable Amazon Inspector enhanced scanning for ECR and add a pipeline step that checks the scan findings and fails on critical severity.
Explanation
Inspector scans images, and a pipeline step can gate deployment on the findings. Tag immutability does not check vulnerabilities. CloudTrail records API calls, not scan results. A lifecycle policy acts after the fact and works on age or count, not findings.
Question 7
A team wants to host a React single-page application with a CI/CD pipeline that builds and deploys every Git push, provides preview URLs for pull requests, and supports a custom domain. The team wants the LEAST operational effort. Which service should be used?
- AWS Elastic Beanstalk with a Node.js platform.
- AWS Amplify Hosting connected to the Git repository. — Correct
- Amazon S3 static website hosting with a CodePipeline.
- Amazon ECS on Fargate with an Application Load Balancer.
Correct answer
AWS Amplify Hosting connected to the Git repository.
Explanation
Amplify Hosting provides Git-based builds, pull request previews, and custom domains out of the box. S3 with CodePipeline works but needs more setup and has no built-in previews. Beanstalk and ECS are designed for server-side applications.
Question 8
An application on Elastic Beanstalk needs an extra operating system package and a custom configuration file on every instance, including instances added by scaling. Which solution meets these requirements with the LEAST operational effort?
- Add a .ebextensions configuration file to the source bundle that installs the package and creates the file. — Correct
- Create a custom AMI with the package and file, and update it by hand every time the platform version changes.
- Add a separate CloudFormation stack that runs an EC2 Run Command document whenever an instance launches.
- Connect to each instance after deployment and install the package and file by running commands manually.
Correct answer
Add a .ebextensions configuration file to the source bundle that installs the package and creates the file.
Explanation
Configuration files in .ebextensions run on every instance during deployment and scaling. Manual changes are lost on replacement. A custom AMI adds maintenance. A separate stack adds moving parts.
Question 9
A developer must update a production CloudFormation stack that includes an Amazon RDS instance. The developer is worried that the change might replace the database. How can the developer find out before applying the update?
- Create a change set and review the Replacement value for the RDS resource. — Correct
- Apply a stack policy that denies updates to the RDS resource during the update.
- Enable termination protection on the stack before updating it with the new template.
- Run drift detection on the stack and review the drift status of the RDS resource.
Correct answer
Create a change set and review the Replacement value for the RDS resource.
Explanation
A change set shows each resource's planned action and whether it will be replaced. Drift detection compares current settings with the template, not the planned change. A stack policy can block the update but does not preview it. Termination protection only stops stack deletion.
Question 10
A team runs an ECS service on Fargate behind an Application Load Balancer. The team wants to send test traffic to a new task set through a test listener, then shift production traffic all at once, with immediate rollback if needed. Which deployment approach meets these requirements?
- Update the existing task definition in place and force a new deployment of the service from the ECS console.
- Create a second ECS service with the new version and update the Route 53 record to point to the new service.
- Use the ECS rolling update deployment type with minimumHealthyPercent set to 100 and maximumPercent set to 200.
- Use a CodeDeploy blue/green deployment with two target groups and a production listener and a test listener on the ALB. — Correct
Correct answer
Use a CodeDeploy blue/green deployment with two target groups and a production listener and a test listener on the ALB.
Explanation
CodeDeploy blue/green for ECS supports a test listener, traffic shifting, and quick rollback by switching target groups. Rolling updates replace tasks gradually and have no test listener. DNS changes are slower to roll back because of caching. Forcing a new deployment is still a rolling update.