You built an application as an AWS CloudFormation template that you will deploy across multiple Regions. You manually created a CloudWatch dashboard in the console, and each stack deployment must have its own dashboard. How can you automate creation of the CloudWatch dashboard whenever the CloudFormation stack is deployed?
Choose an answer
Tap an option to check your answer.
Correct answer: Export the existing CloudWatch dashboard JSON and add an AWS::CloudWatch::Dashboard resource to the CloudFormation template, placing the exported JSON into the resource’s DashboardBody property..
Why this is the answer
The correct answer automates dashboard creation by integrating it directly into the CloudFormation template. The AWS::CloudWatch::Dashboard resource allows you to define a CloudWatch dashboard as part of your stack. By exporting the JSON definition of your manually created dashboard and placing it into the DashboardBody property, every new stack deployment will automatically create an identical, unique dashboard. The AWS CLI script option is less ideal because it requires an external script and manual execution or orchestration outside of CloudFormation, which is less integrated and prone to errors. Using Ref to point to an existing dashboard ID is incorrect because each stack needs its own dashboard, not a reference to a single, pre-existing one. Setting DashboardName to a pre-existing dashboard name would attempt to create a dashboard with a name that likely already exists, leading to conflicts or overwriting, rather than creating a new, unique dashboard for each stack.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed