aws_cloudwatch_metric_streams Resource
Use the aws_cloudwatch_metric_streams InSpec audit resource to test properties of multiple AWS CloudWatch metric streams.
For additional information, including details on parameters and properties, see the AWS documentation on AWS CloudWatch metric stream..
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 metric streams exists.
describe aws_cloudwatch_metric_streams do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
arns- The ARN of the metric stream.
Field:
arncreation_date- The date that the metric stream was originally created.
Field:
creation_datelast_update_date- The date that the configuration of this metric stream was most recently updated.
Field:
last_update_datenames- The name of the metric stream.
Field:
namefirehose_arns- The ARN of the Kinesis Firehose delivery stream that is used for this metric stream.
Field:
firehose_arnstates- The current state of this stream. Valid values are running and stopped .
Field:
stateoutput_formats- The output format of this metric stream. Valid values are ‘json’ and ‘opentelemetry0.7’.
Field:
output_format
Examples
Ensure an ARN is available.
describe aws_cloudwatch_metric_streams do
its('arns') { should include 'ARN' }
end
Ensure a Firehose ARN is available.
describe aws_cloudwatch_metric_streams do
its('firehose_arns') { should include 'FIREHOSE_ARN' }
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_metric_streams do
it { should exist }
end
Use should_not to test that the entity does not exist.
describe aws_cloudwatch_metric_streams do
it { should_not exist }
end
AWS Permissions
Your Principal will need the CloudFront:Client:ListMetricStreamsOutput action with Effect set to Allow.