Skip to main content

aws_cloudwatch_dashboards Resource

[edit on GitHub]

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..

Installation

This resource is available in the Chef InSpec AWS resource pack.

See the Chef InSpec documentation on cloud platforms for information on configuring your AWS environment for InSpec and creating an InSpec profile that uses the InSpec AWS resource pack.

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

This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit 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 Principal will need the CloudWatch:Client:ListDashboardsOutput action with Effect set to Allow.

Was this page helpful?

×









Search Results