A company has a multi-account organization managed by AWS Organizations. A SysOps administrator needs to enforce strict cost controls in a development sandbox account. If the monthly forecasted cost for the sandbox account exceeds $5,000, all running Amazon EC2 instances in that account must be stopped automatically. The administrator wants to implement this solution with minimal custom code and administrative overhead. Which configuration will meet these requirements?
- Create an AWS Budget with a monthly cost budget for the sandbox account, set to trigger a budget action when the forecasted spend exceeds $5,000. Create a custom IAM role with a trust policy for the budgets.amazonaws.com service principal and an execution policy allowing ec2:StopInstances and ec2:DescribeInstances actions. Grant the administrator iam:PassRole permissions for this custom role in their IAM policy.Cevap
- BCreate an AWS Cost Anomaly Detection monitor with a threshold of $5,000. Configure an anomaly subscription to send alerts to an Amazon SNS topic. Subscribe an AWS Lambda function to the SNS topic to stop all running EC2 instances in the sandbox account.
- CCreate an Amazon CloudWatch billing alarm that monitors the total monthly charges for the sandbox account and triggers when it exceeds $5,000. Configure the alarm to send a notification to an Amazon SNS topic, and use AWS Systems Manager Automation to automatically stop EC2 instances when the SNS topic receives the alarm.
- DCreate an AWS Budget with a monthly cost budget for the sandbox account, set to trigger a budget action when the forecasted spend exceeds $5,000. Configure the budget action to use the AWS service-linked role AWSServiceRoleForBudgets to stop the EC2 instances, and grant the administrator sts:AssumeRole permissions for this service-linked role in their IAM policy.
Cevap
Create an AWS Budget with a monthly cost budget configured to trigger a budget action based on forecasted spend. Associate this action with a custom IAM role that trusts budgets.amazonaws.com and has ec2:StopInstances permissions, ensuring the administrator has iam:PassRole permissions for that role.
The correct configuration uses AWS Budgets to alert on monthly forecasted costs and leverages native Budget Actions to stop the EC2 instances. To allow AWS Budgets to act on the administrator's behalf, a custom IAM role trusting the budgets.amazonaws.com service principal must be created with ec2:StopInstances permissions, and the administrator must have iam:PassRole permissions to associate that role with the budget action.
Adım Adım Çözüm
Anahtar Kavram
AWS Budgets Actions IAM Requirements and Cost Monitoring Differentiation