Skip to main content

aws_cloudwatch_insight_rules Resource

Use the aws_cloudwatch_insight_rules InSpec audit resource to test properties of the plural AWS CloudWatch Insight rules.

For additional information, including details on parameters and properties, see the AWS documentation on AWS CloudWatch Insight rules..

Install

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

For information on configuring your AWS environment for Chef InSpec and creating an InSpec profile that uses the InSpec AWS resource pack, see the Chef InSpec documentation on the AWS cloud platform.

Syntax

Ensure that the Insight rule exists.

describe aws_cloudwatch_insight_rules do
  it { should exist }
end

Parameters

This resource does not require any parameters.

Properties

names
The name of the rule.

Field: name

states
Indicates whether the rule is enabled or disabled.

Field: schema

schemas
For rules that you create, this is always {“Name”: “CloudWatchLogRule”, “Version”: 1} . For built-in rules, this is {“Name”: “ServiceLogRule”, “Version”: 1}.

Field: dashboard_name

definitions
The definition of the rule, as a JSON object.

Field: definition

Examples

Ensure a rule name is available.

describe aws_cloudwatch_insight_rules do
  its('names') { should include 'RuleName' }
end

Ensure a state is available.

describe aws_cloudwatch_insight_rules do
    its('states') { should include 'enabled' }
end

Matchers

For a full list of available matchers, see our Universal Matchers page.

The controls will pass if the describe method returns at least one result.

exist

Use should to test that the entity exists.

describe aws_cloudwatch_insight_rules do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_cloudwatch_insight_rules do
  it { should_not exist }
end

AWS Permissions

Your Principal will need the CloudWatch:Client:DescribeInsightRulesOutput action with Effect set to Allow.

Edit this page on GitHub

Thank you for your feedback!

×









Search Results