DevOps Engineering on AWS Certification DevOps Engineering on AWS Certification MCQ 2 — Questions and Answers
Question 1: Which AWS service enables you to model and provision AWS infrastructure resources using code in a declarative template format?
- AWS Elastic Beanstalk
- AWS CloudFormation (Correct answer)
- AWS OpsWorks
- AWS Systems Manager
Correct answer: AWS CloudFormation
AWS CloudFormation lets you model, provision, and manage AWS resources by treating infrastructure as code using JSON or YAML templates.
Question 2: A team wants to automatically trigger a pipeline in AWS CodePipeline whenever a developer pushes code to an AWS CodeCommit repository. What is the recommended approach?
- Configure a CloudWatch Events rule to detect repository state changes and trigger the pipeline (Correct answer)
- Set up periodic polling of the repository in CodePipeline settings
- Use an AWS Lambda function that manually calls StartPipelineExecution on a schedule
- Enable Amazon SNS notifications on the repository to invoke the pipeline
Correct answer: Configure a CloudWatch Events rule to detect repository state changes and trigger the pipeline
Amazon CloudWatch Events (EventBridge) rules detect CodeCommit push events and automatically invoke the CodePipeline execution in near real time.
Question 3: When using AWS CodeDeploy with an in-place deployment strategy on EC2 instances, what happens to the application during the deployment?
- Traffic is shifted to new instances before old instances are terminated
- The application on existing instances is stopped, updated, and restarted (Correct answer)
- A new Auto Scaling group is created and the old one is deleted after validation
- A blue/green swap occurs at the load balancer level
Correct answer: The application on existing instances is stopped, updated, and restarted
In an in-place deployment, CodeDeploy stops the running application on each instance, installs the new revision, and restarts it on the same instance.
Question 4: Which metric should a DevOps engineer monitor in Amazon SQS to determine if consumers are keeping up with the message production rate?
- NumberOfMessagesSent
- ApproximateNumberOfMessagesVisible
- NumberOfMessagesDeleted
- ApproximateAgeOfOldestMessage (Correct answer)
Correct answer: ApproximateAgeOfOldestMessage
ApproximateAgeOfOldestMessage measures how long the oldest unprocessed message has been in the queue, indicating processing lag when the value grows.
Question 5: A DevOps engineer needs to enforce that all S3 buckets in an AWS account block public access. Which AWS service can automatically detect and remediate non-compliant buckets?
- AWS Trusted Advisor
- Amazon Macie
- AWS Config with auto-remediation (Correct answer)
- Amazon Inspector
Correct answer: AWS Config with auto-remediation
AWS Config managed rules can detect S3 buckets that don't block public access, and auto-remediation using SSM Automation documents can fix them automatically.
Question 6: Which deployment configuration in AWS CodeDeploy ensures that at least half of the instances remain in service during an in-place deployment?
- CodeDeployDefault.AllAtOnce
- CodeDeployDefault.HalfAtATime (Correct answer)
- CodeDeployDefault.OneAtATime
- CodeDeployDefault.Linear10PercentEvery1Minute
Correct answer: CodeDeployDefault.HalfAtATime
CodeDeployDefault.HalfAtATime deploys to half the instances at a time, keeping the other half serving traffic throughout the deployment.
Question 7: An application uses Amazon ECS with the Fargate launch type. A DevOps engineer wants to implement canary deployments. Which feature enables traffic shifting between task revisions?
- ECS rolling update with minimumHealthyPercent set to 50
- AWS CodeDeploy blue/green deployment with an Application Load Balancer (Correct answer)
- Amazon Route 53 weighted routing between two ECS services
- CloudFront origin groups with failover routing
Correct answer: AWS CodeDeploy blue/green deployment with an Application Load Balancer
CodeDeploy supports blue/green deployments for ECS Fargate by shifting traffic between two target groups on an ALB using canary, linear, or all-at-once strategies.
Which AWS service enables you to model and provision AWS infrastructure resources using code in a declarative template format?