SAP-C03 · Domain 5: Operational Excellence and Automation · 20% of the exam
Task 5.2: Design CI/CD and DevSecOps pipelines.
Pipelines that build, scan, sign and promote: CodePipeline, CodeBuild and CodeDeploy, vulnerability scanning and artifact signing, cross-account and cross-Region promotion, evaluation of AI outputs, and releases that roll back.
Study it
Pipelines with CodePipeline, CodeBuild and CodeDeploy, and releases that roll back
Try each one before opening the answer. Every option is explained, with the AWS documentation page that proves it.
Question 1 · choose 1
A team releases new versions of a payment Lambda function several times a week. A new version must first receive 10% of the traffic for 10 minutes. If the function's error-rate CloudWatch alarm goes off during that time, all traffic must return to the previous version without human action. Which deployment approach meets these requirements?
ADeploy through AWS CodeDeploy with a canary configuration on the function alias and the alarm on the deployment group
BUpdate the function code in place through a CloudFormation stack update with a rollback trigger that watches the error-rate alarm
CPublish the new version and run a scheduled script that raises the alias weight by 10% every 10 minutes
DCreate a new function for each version and use Route 53 weighted records to send 10% of requests to it
Show the answer and why
ADeploy through AWS CodeDeploy with a canary configuration on the function alias and the alarm on the deployment group
Correct
CodeDeploy shifts Lambda traffic between versions through an alias with canary or linear configurations, and a deployment can be rolled back automatically when a configured CloudWatch alarm is triggered.
BUpdate the function code in place through a CloudFormation stack update with a rollback trigger that watches the error-rate alarm
Incorrect
Updating the code in place sends all traffic to the new code at once, so there is no 10% phase, even if a rollback trigger can roll the stack back afterward.
CPublish the new version and run a scheduled script that raises the alias weight by 10% every 10 minutes
Incorrect
Weighted aliases can split traffic, but this script only moves traffic forward. Watching the alarm and rolling back would be custom code that the team must write and run.
DCreate a new function for each version and use Route 53 weighted records to send 10% of requests to it
Incorrect
Separate functions behind weighted DNS records split traffic only as well as resolvers honor the weights, and cached answers keep sending clients to the new function after a change, so this gives neither a clean split nor an automatic rollback.
Gradual traffic shifting with an automatic, alarm-driven rollback is a managed CodeDeploy feature for Lambda; anything else rebuilds it by hand.
A new platform will run EC2 fleets in 40 accounts of one OU across three Regions. Every fleet must launch from a company image that already carries the security team's hardening settings and the latest OS patches, and no image may be released until automated tests pass on it. Today an engineer builds the image by hand once a month, and fleets often launch from outdated images. The company wants a new image built every week and made available in every Region and account automatically, without custom code to maintain. Which solution meets these requirements?
AKeep building the image by hand each month, and run an EC2 Auto Scaling instance refresh every week to roll it out to the fleets
BLaunch fleets from the latest AWS-provided AMI and patch and harden each instance after boot with Systems Manager Patch Manager
CCreate an EC2 Image Builder pipeline on a weekly schedule with hardening and test components and distribution settings for the OU
DHave a weekly Lambda function call CreateImage on a patched reference instance, then copy the AMI to each Region and share it
Show the answer and why
AKeep building the image by hand each month, and run an EC2 Auto Scaling instance refresh every week to roll it out to the fleets
Incorrect
An instance refresh replaces the instances of an Auto Scaling group, for example to deploy a new AMI from a new launch template. It rolls out an image but does not build, test or distribute one, so the image stays manual and monthly.
BLaunch fleets from the latest AWS-provided AMI and patch and harden each instance after boot with Systems Manager Patch Manager
Incorrect
Patch Manager automates patching of managed nodes, which keeps running instances current. But each instance starts from an unhardened image and is only fixed after launch, and no tested company image exists.
CCreate an EC2 Image Builder pipeline on a weekly schedule with hardening and test components and distribution settings for the OU
Correct
Image Builder pipelines run on a schedule, apply build components to a base image, run test components, and distribute the image only if every test succeeds. Distribution settings copy the AMI to target Regions and share it with accounts, organizations and OUs.
DHave a weekly Lambda function call CreateImage on a patched reference instance, then copy the AMI to each Region and share it
Incorrect
CreateImage and CopyImage can produce and copy AMIs on a schedule, but the company would write and maintain the function, and nothing tests the image before fleets use it.
The constraints are a hardened and patched image at launch, tests before release, a weekly cadence across Regions and accounts, and no custom code. Instance refresh only rolls out an image, Patch Manager fixes instances after launch, and a Lambda function is custom code that skips testing. An Image Builder pipeline builds, tests and distributes the image on a schedule.
A web application on AWS Elastic Beanstalk is deployed with the all at once policy, and each release causes a few minutes of downtime. The team wants releases with no loss of capacity, wants to test each new version on 10% of production traffic for 30 minutes before the full rollout, and wants a quick way back if the test fails. Which deployment policy meets these requirements?
ARolling, with a batch size of 10% of the instances
BRolling with an additional batch, with a batch size of 10%
CImmutable, so that new instances are launched in a separate Auto Scaling group
DTraffic splitting, with 10% of traffic and a 30-minute evaluation time
Show the answer and why
ARolling, with a batch size of 10% of the instances
Incorrect
Rolling deployments take batches of instances out of service, which reduces capacity, and they do not hold a fixed share of traffic on the new version for an evaluation period.
BRolling with an additional batch, with a batch size of 10%
Incorrect
An additional batch keeps full capacity, but the rollout still moves batch by batch without an evaluation period on a share of traffic.
CImmutable, so that new instances are launched in a separate Auto Scaling group
Incorrect
Immutable deployments keep capacity and are safe to roll back, but they do not send a chosen percentage of traffic to the new version for a set evaluation time.
DTraffic splitting, with 10% of traffic and a 30-minute evaluation time
Correct
Traffic-splitting deployments send a set percentage of client traffic to new instances for an evaluation period and shift back to the old version if the new one is unhealthy, without reducing capacity.
Canary testing on Elastic Beanstalk is the traffic-splitting policy; the other policies differ in capacity and rollback but not in a timed traffic share.
An engineer with broad permissions uploaded a modified .zip package straight to a production Lambda function, bypassing the company's build pipeline. The security team now wants every production function to reject any code package that the approved pipeline did not produce and sign, and to reject a signed package that was altered after signing. Releases from the pipeline must keep deploying without manual steps. Which change meets these requirements?
ATurn on Amazon Inspector Lambda code scanning for the production functions and act on its findings
BAdd a manual approval action to the pipeline before the production deployment stage of each function
CSign packages in the pipeline with an AWS Signer profile and attach an enforcing Lambda code signing configuration
DStore build artifacts in an S3 bucket with Object Lock in governance mode so that they cannot be overwritten
Show the answer and why
ATurn on Amazon Inspector Lambda code scanning for the production functions and act on its findings
Incorrect
Inspector scans function code and dependencies for vulnerabilities. It reports on code that is already deployed, and it does not stop an unsigned or altered package from being deployed.
BAdd a manual approval action to the pipeline before the production deployment stage of each function
Incorrect
A manual approval stops the pipeline until someone approves, which adds the manual step the team must avoid, and it does nothing about uploads that bypass the pipeline.
CSign packages in the pipeline with an AWS Signer profile and attach an enforcing Lambda code signing configuration
Correct
With a code signing configuration that allows only the pipeline's signing profile and is set to Enforce, Lambda blocks packages that fail the signature checks, and its integrity check rejects any package modified since it was signed.
DStore build artifacts in an S3 bucket with Object Lock in governance mode so that they cannot be overwritten
Incorrect
Object Lock protects stored object versions from being overwritten or deleted. Lambda would still accept a package that someone uploads directly instead of the locked artifact.
The control has to sit at the point where code enters the function, not in the pipeline or the artifact store. Lambda code signing checks every new deployment against the allowed signing profiles and verifies that the package has not changed since it was signed, so direct uploads of unsigned or tampered packages fail while signed releases from the pipeline deploy as before.
A pipeline deploys an Amazon ECS service on Fargate by calling UpdateService with a new task definition; the service uses the rolling update deployment type. Two recent releases went wrong: in one, new tasks kept failing health checks while the deployment kept retrying for hours; in the other, the tasks were healthy but the service's 5xx CloudWatch alarm fired. The team wants ECS to fail the deployment and return to the last working version automatically in both cases, while keeping rolling updates and the current load balancer setup, with no extra infrastructure. Which solution meets these requirements?
AMove the service into a CloudFormation stack and add the 5xx alarm as a rollback trigger for every stack update
BLengthen the health check grace period so that new tasks have more time to pass their load balancer health checks
CSet the minimum healthy percent to 100 and the maximum percent to 200 so that old tasks keep running until new tasks are ready
DTurn on the deployment circuit breaker with rollback and add the 5xx alarm to the service's deployment alarms with rollback
Show the answer and why
AMove the service into a CloudFormation stack and add the 5xx alarm as a rollback trigger for every stack update
Incorrect
Rollback triggers make CloudFormation roll back a stack create or update when an alarm breaches, which suits stack-managed releases. This pipeline deploys with UpdateService, and the trigger does nothing about tasks that never reach a steady state.
BLengthen the health check grace period so that new tasks have more time to pass their load balancer health checks
Incorrect
A grace period suits applications that start slowly, because it delays health check evaluation. It neither fails nor rolls back a deployment whose tasks are broken or whose error alarm fires.
CSet the minimum healthy percent to 100 and the maximum percent to 200 so that old tasks keep running until new tasks are ready
Incorrect
These settings bound how many tasks run during a rolling update, which protects capacity. They do not detect a failed deployment or return the service to the previous version.
DTurn on the deployment circuit breaker with rollback and add the 5xx alarm to the service's deployment alarms with rollback
Correct
The circuit breaker detects tasks that do not reach a steady state and can roll back to the deployment in the COMPLETED state. Deployment alarms mark a deployment as failed when a CloudWatch alarm enters ALARM and can also roll it back, all within rolling updates.
The constraints are automatic failure detection for both unhealthy tasks and a breaching alarm, automatic return to the last good version, and rolling updates with no new infrastructure. Grace periods and task percentages tune a rollout but never roll back, and CloudFormation rollback triggers apply only to stack updates. The circuit breaker plus deployment alarms, both with rollback, cover both failure modes.
A support assistant answers from an Amazon Bedrock knowledge base. Changes to its chunking, prompts or model ship through CodePipeline. Twice a change passed all unit tests but made answers worse in production. The team wants every release candidate scored automatically for answer correctness and faithfulness against a curated set of 500 questions with expected answers, and the pipeline must stop the release when a score falls below an agreed threshold. Nobody wants a manual review step. Which approach meets these requirements?
AAdd a manual approval action in which a product manager tries ten questions before each release
BAdd a stage that runs an Amazon Bedrock RAG evaluation job on the curated set and fails when a score is below the threshold
CPublish the assistant's InvocationLatency metric to CloudWatch and block the release when latency rises after deployment
DRun a human-based model evaluation job in which a work team scores every release candidate against the 500 questions
Show the answer and why
AAdd a manual approval action in which a product manager tries ten questions before each release
Incorrect
Ten manual questions are neither automatic nor a scored comparison against the curated set, and the team does not want a manual step.
BAdd a stage that runs an Amazon Bedrock RAG evaluation job on the curated set and fails when a score is below the threshold
Correct
RAG evaluations compute metrics such as correctness and faithfulness for a knowledge base from a dataset with ground truth, so a pipeline stage can compare the scores with the threshold and stop the release.
CPublish the assistant's InvocationLatency metric to CloudWatch and block the release when latency rises after deployment
Incorrect
Latency says nothing about whether answers are correct or grounded, and it is measured only after the release is live.
DRun a human-based model evaluation job in which a work team scores every release candidate against the 500 questions
Incorrect
Human evaluations are useful for subjective criteria, but they are a manual step that the team wants to avoid in every release.
Amazon Bedrock evaluations can score a knowledge base's retrieval and generation against a dataset with expected answers. Running them as a pipeline gate catches quality regressions before release.
An order workflow runs as a Standard state machine in AWS Step Functions and is deployed with CloudFormation. Five producer services start executions with StartExecution. Last month a definition change broke every new order for an hour. For future releases, the team wants a new definition to receive 10% of new executions at first and 10% more every 30 minutes, all traffic to return to the previous definition automatically if the workflow's failed-executions alarm goes into ALARM, and the producers never to change the ARN they call. Which approach meets these requirements?
AKeep the producers on the state machine ARN, update the definition in place, and add the alarm as a stack rollback trigger
BPublish a version per release behind an alias that producers call, and have an engineer raise its routing weight every 30 minutes
CPublish a version per release behind an alias that producers call, and deploy it with a LINEAR deployment preference and the alarm
DPublish a version per release behind an alias that producers call, and deploy it with a CANARY deployment preference and the alarm
Show the answer and why
AKeep the producers on the state machine ARN, update the definition in place, and add the alarm as a stack rollback trigger
Incorrect
A rollback trigger rolls the stack back when the alarm fires, but an execution started without a version or alias runs the most recent revision, so every new order uses the new definition at once.
BPublish a version per release behind an alias that producers call, and have an engineer raise its routing weight every 30 minutes
Incorrect
An alias keeps the producers' ARN stable and can split executions between two versions, but manual weight changes do not return traffic to the previous version when the alarm fires.
CPublish a version per release behind an alias that producers call, and deploy it with a LINEAR deployment preference and the alarm
Correct
With a LINEAR deployment preference on the alias, CloudFormation shifts traffic to the new version in equal increments at a fixed interval and rolls back to the previous version if a listed alarm goes into ALARM.
DPublish a version per release behind an alias that producers call, and deploy it with a CANARY deployment preference and the alarm
Incorrect
A CANARY deployment shifts traffic in two increments: a small percentage first and then all remaining traffic at once, not 10% more every 30 minutes.
Step Functions versions are immutable snapshots of a definition, and an alias points to one or two versions with a routing weight, so callers keep one ARN. A CloudFormation deployment preference on the alias automates the traffic shift: LINEAR in equal steps, CANARY in two steps or ALL_AT_ONCE, with CloudWatch alarms that roll the alias back to the previous version.
A pipeline in a tools account builds container images that run in development, staging and production accounts. Security sets three rules: no image with a critical vulnerability may ever be pushed to a registry, production may run only images that the pipeline produced and approved, and what runs in production must be byte-identical to what passed the staging tests. Which design choices meet these rules? (Choose THREE.)
ATurn on basic scanning on push in the production account's Amazon ECR repositories
BIn the build stage, create an SBOM with the Amazon Inspector SBOM Generator, scan it with the Inspector Scan API, and fail the build on critical findings before any push
CRebuild the image from the same commit in each environment's stage so that every account builds its own copy
DSign each image that passes the scan with an AWS Signer profile, and verify the signature before deploying it
ETag the approved image as latest and configure every environment to deploy the latest tag
FPromote the tested image to staging and production by its immutable image digest instead of rebuilding or retagging it
Show the answer and why
ATurn on basic scanning on push in the production account's Amazon ECR repositories
Incorrect
Scanning on push finds vulnerabilities only after the image is already in a registry, which the first rule forbids.
BIn the build stage, create an SBOM with the Amazon Inspector SBOM Generator, scan it with the Inspector Scan API, and fail the build on critical findings before any push
Correct
The Inspector CI/CD integration scans the image's SBOM inside the pipeline, so an image with critical findings never reaches a registry.
CRebuild the image from the same commit in each environment's stage so that every account builds its own copy
Incorrect
Separate builds can produce different artifacts, so production would not run the exact image that passed staging.
DSign each image that passes the scan with an AWS Signer profile, and verify the signature before deploying it
Correct
Signing ties the image to the pipeline's signing profile, and checking the signature at deployment lets production reject images that the pipeline did not produce.
ETag the approved image as latest and configure every environment to deploy the latest tag
Incorrect
A mutable tag can be moved to another image, so latest does not guarantee which image an environment runs.
FPromote the tested image to staging and production by its immutable image digest instead of rebuilding or retagging it
Correct
A digest identifies exactly one image, so promoting by digest makes production run the same bytes that staging tested.
A secure container supply chain scans before push, signs what passed, and promotes the same artifact by digest through every environment, verifying signatures before deployment.