AWS Certified SysOps Administrator – Associate — Question 143
A SysOps administrator creates an AWS CloudFormation template to define an application stack that can be deployed in multiple AWS Regions. The SysOps administrator also creates an Amazon CloudWatch dashboard by using the AWS Management Console. Each deployment of the application requires its own CloudWatch dashboard.
How can the SysOps administrator automate the creation of the CloudWatch dashboard each time the application is deployed?
Answer options
- A. Create a script by using the AWS CLI to run the aws cloudformation put-dashboard command with the name of the dashboard. Run the command each time a new CloudFormation stack is created.
- B. Export the existing CloudWatch dashboard as JSON. Update the CloudFormation template to define an AWS::CloudWatch::Dashboard resource. Include the exported JSON in the resource’s DashboardBody property.
- C. Update the CloudFormation template to define an AWS::CloudWatch::Dashboard resource. Use the Intrinsic Ref function to reference the ID of the existing CloudWatch dashboard.
- D. Update the CloudFormation template to define an AWS::CloudWatch::Dashboard resource. Specify the name of the existing dashboard in the DashboardName property.
Correct answer: B
Explanation
The correct answer is B because it allows for the integration of an exported JSON representation of the CloudWatch dashboard directly into the CloudFormation template, ensuring that a new dashboard is created for each deployment. Option A is incorrect as it requires manual execution of a script. Option C does not create a new dashboard as it references an existing one, and Option D similarly fails to create a new dashboard since it only specifies an existing dashboard's name.