aws_cloudwatch_dashboards resource
Use the aws_cloudwatch_dashboards
InSpec audit resource to test properties of the plural AWS CloudWatch dashboard.
For additional information, including details on parameters and properties, see the AWS documentation on AWS CloudWatch dashboard..
Syntax
Ensure that the dashboard exists.
describe aws_cloudwatch_dashboards do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
dashboard_names
- The name of the dashboard.
Field:
dashboard_name
dashboard_arns
- The Amazon Resource Name (ARN) of the dashboard.
Field:
dashboard_arn
last_modified
- The time stamp of when the dashboard was last modified, either by an API call or through the console.
Field:
last_modified
sizes
- The size of the dashboard, in bytes.
Field:
size
Examples
Ensure a dashboard ARN is available:
describe aws_cloudwatch_dashboards do
its('dashboard_arns') { should include 'ARN' }
end
Ensure a dashboard name is available:
describe aws_cloudwatch_dashboards do
its('dashboard_names') { should include 'DASHBOARD_NAME' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.The controls will pass if the list
method returns at least one result.
exist
Use should
to test that the entity exists.
describe aws_cloudwatch_dashboards do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_cloudwatch_dashboards do
it { should_not exist }
end
AWS Permissions
Your AWS principal will need the CloudWatch:Client:ListDashboardsOutput
action with Effect
set to Allow
.