AWS Certified Developer – Associate — All Questions
4 questions
A team wants to shift 10% of production traffic to a new Lambda version, then automatically roll back if a CloudWatch alarm fires. Which approach achieves this?
- a.Delete the old version before deploying
- b.Use a CodeDeploy canary deployment with a Lambda alias and rollback on alarm✓
- c.Manually edit the function code in the console
- d.Increase the function timeout
CodeDeploy's canary (or linear) deployment configurations shift a small percentage of traffic to the new version behind an alias and roll back automatically when a specified CloudWatch alarm triggers. Manual edits, deleting the old version, or changing timeouts do not provide controlled traffic shifting or automatic rollback.
Which file tells AWS CodeBuild the commands to run in each build phase and which artifacts to output?
- a.appspec.yml
- b.template.yaml
- c.buildspec.yml✓
- d.Dockerfile
CodeBuild reads buildspec.yml to run install, pre_build, build, and post_build phases and to declare output artifacts. appspec is used by CodeDeploy, a Dockerfile builds container images, and template.yaml is a SAM/CloudFormation template.
A developer wants to define a serverless application (Lambda, API Gateway, DynamoDB) with concise templates that can be tested locally. Which tool is designed for this?
- a.AWS Config
- b.Amazon Inspector
- c.AWS Serverless Application Model (SAM)✓
- d.Amazon Athena
AWS SAM extends CloudFormation with shorthand for serverless resources and offers the SAM CLI for local build and test. Inspector assesses security, Config tracks resource configuration, and Athena queries data in S3.
Why should Lambda deployments use published versions with an alias rather than always deploying to $LATEST?
- a.Aliases reduce cold starts
- b.Immutable versions let you point a stable alias and roll back instantly by moving it✓
- c.$LATEST runs faster
- d.Versions cost less to invoke
Published versions are immutable snapshots; an alias points to a version, so rolling back is as simple as moving the alias to a previous version. This gives predictable releases and fast rollback. Aliases and versions do not change execution speed, cold starts, or invocation cost.