AWS DevOps Cost Optimization 3 — Questions and Answers
Question 1: A DevOps team uses AWS CloudFormation for infrastructure deployments and notices high costs from frequent stack updates in lower environments. Which approach best reduces these costs?
- Deploy all environments into a single CloudFormation stack
- Use CloudFormation Change Sets to preview and batch changes before applying (Correct answer)
- Switch to AWS CDK to avoid CloudFormation costs
- Disable drift detection to reduce API calls
Correct answer: Use CloudFormation Change Sets to preview and batch changes before applying
Change Sets allow teams to review and batch multiple infrastructure changes before a single deployment, reducing the number of stack update operations and associated resource churn.
Question 2: Which AWS Cost Explorer feature helps a DevOps team identify which CI/CD pipeline components are driving the highest AWS spend?
- Reserved Instance utilization reports
- Cost allocation tags filtered by pipeline name or environment (Correct answer)
- Savings Plans coverage reports
- Trusted Advisor cost checks
Correct answer: Cost allocation tags filtered by pipeline name or environment
Cost allocation tags applied to pipeline-created resources (e.g., 'pipeline:my-app', 'env:staging') allow Cost Explorer to break down spend by pipeline component or environment.
Question 3: A team's CodeDeploy blue/green deployments leave old Auto Scaling Groups running for 1 hour after successful deployment. What change reduces unnecessary costs?
- Switch from blue/green to in-place deployments
- Reduce the termination wait time for the original environment in the deployment group (Correct answer)
- Disable deployment rollback to avoid keeping old instances
- Use Lambda deployments instead of EC2
Correct answer: Reduce the termination wait time for the original environment in the deployment group
The original environment termination wait time in a blue/green deployment controls how long old instances stay running; reducing it minimizes the overlap period where both environments incur costs.
Question 4: A DevOps team uses Systems Manager Automation documents to run remediation tasks across hundreds of accounts. Which approach minimizes SSM Automation costs?
- Use SSM Run Command instead of Automation for all tasks
- Consolidate multiple small automation steps into fewer, larger documents (Correct answer)
- Schedule automations during off-peak hours only
- Use SSM State Manager associations instead of Automation
Correct answer: Consolidate multiple small automation steps into fewer, larger documents
SSM Automation pricing is per automation step executed; consolidating steps reduces the total step count and therefore total cost.
Question 5: Which action reduces costs when using Amazon EventBridge rules to trigger CodePipeline executions?
- Use the default event bus instead of custom event buses
- Add event pattern filters to EventBridge rules to avoid triggering pipelines on irrelevant events (Correct answer)
- Convert all EventBridge rules to scheduled rules
- Increase the retry count on EventBridge targets
Correct answer: Add event pattern filters to EventBridge rules to avoid triggering pipelines on irrelevant events
Precise event patterns filter out irrelevant events before they trigger pipeline executions, reducing unnecessary pipeline runs and their associated build, test, and deploy costs.
Question 6: A team runs Selenium-based end-to-end tests in CodeBuild that take 45 minutes each. Which optimization reduces cost without sacrificing coverage?
- Run all tests on a single large CodeBuild instance in sequence
- Split the test suite and run shards in parallel across multiple smaller CodeBuild instances (Correct answer)
- Replace CodeBuild with AWS Device Farm for all browser tests
- Increase the CodeBuild timeout limit to reduce retries
Correct answer: Split the test suite and run shards in parallel across multiple smaller CodeBuild instances
Parallelizing test shards across multiple smaller instances reduces total wall-clock time (and sometimes total compute cost) while keeping the same test coverage.
Question 7: A company wants to optimize costs for AWS Config rules used to enforce compliance in their CI/CD pipeline. Which configuration reduces Config evaluation costs?
- Enable continuous recording for all resource types
- Use periodic evaluation mode instead of configuration-change-triggered mode for stable resources (Correct answer)
- Create separate Config rules for each AWS account
- Enable Config aggregation across all regions
Correct answer: Use periodic evaluation mode instead of configuration-change-triggered mode for stable resources
Periodic evaluation mode reduces the number of Config rule evaluations triggered for resources that change infrequently, lowering the per-evaluation cost.
A DevOps team uses AWS CloudFormation for infrastructure deployments and notices high costs from frequent stack updates in lower environments.
Which approach best reduces these costs?