Skip to content

Instantly share code, notes, and snippets.

@jm42
Created April 5, 2021 17:05
Show Gist options
  • Save jm42/6a13605e73e389e3e50a733e34f300e6 to your computer and use it in GitHub Desktop.
Save jm42/6a13605e73e389e3e50a733e34f300e6 to your computer and use it in GitHub Desktop.
Example resource to create a CloudWatch Dashboard for an Alarm in CloudFormation
CloudWatchDashboard:
Type: AWS::CloudWatch::Dashboard
Properties:
DashboardName: !Sub ${AWS::StackName}
DashboardBody: !Sub
- |
{
"periodOverride": "inherit",
"widgets": [
{
"type": "alarm",
"x": 0,
"y": 0,
"width": 12,
"height": 6,
"properties": {
"alarms": ["${ECSCPUUtilizationAlarmArn}"],
"title": "Cluster CPU Utilization"
}
}
]
}
- ECSCPUUtilizationAlarmArn: !GetAtt ECSCPUUtilizationAlarm.Arn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment