First, create a new file called “budget.yml” and add a budget constraint of 100$ and respective alerting via email. A sample can be found below (based on this).
Description: "Basic Budget 100$"
Resources:
BudgetBase:
Type: "AWS::Budgets::Budget"
Properties:
Budget:
BudgetLimit:
Amount: 100
Unit: USD
TimeUnit: MONTHLY
TimePeriod:
Start: 1225864800
End: 1926864800
BudgetType: COST
NotificationsWithSubscribers:
- Notification:
NotificationType: ACTUAL
ComparisonOperator: GREATER_THAN
Threshold: 99
Subscribers:
- SubscriptionType: EMAIL
Address: <youremail>
- Notification:
NotificationType: ACTUAL
ComparisonOperator: GREATER_THAN
Threshold: 80
Subscribers:
- SubscriptionType: EMAIL
Address: <youremail>
Outputs:
BudgetId:
Value: !Ref BudgetBase
CFCT = (Customizations for AWS Control Tower Solution)[https://controltower.aws-management.tools/automation/cfct/].
See also https://docs.aws.amazon.com/solutions/latest/customizations-for-aws-control-tower/welcome.html.
Steps:
...
# Control Tower Custom CloudFormation Resources
cloudformation_resources:
- name: myBudget
template_file: templates/budget.template
deploy_method: stack_set
deploy_to_ou: # :type: list
- <YourOU> # OU Name
regions:
- <YourRegion>
...
See also https://s3.amazonaws.com/solutions-reference/customizations-for-aws-control-tower/latest/customizations-for-aws-control-tower-developer-guide.pdf for more info.
Note: The CFCT solution does support changes of SCPs or CF templates out of the box (S3 Update triggers CodePipeline). However OU StackSet deployments “Auto Deploy” are not yet supported!
See also - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html - https://aws.amazon.com/de/blogs/aws/new-use-aws-cloudformation-stacksets-for-multiple-accounts-in-an-aws-organization/ for more info.
Note: In this solution, you would have to provide Account IDs manually. Constraints on OUs are not supported yet!