aws_cloudwatch_metric_stream Resource
Use the aws_cloudwatch_metric_stream
InSpec audit resource to test properties of a single AWS CloudWatch metric stream.
For additional information, including details on parameters and properties, see the AWS documentation on AWS CloudWatch metric stream..
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 metric stream exists.
describe aws_cloudwatch_metric_stream(metric_stream_name: 'METRIC_STREAM_NAME') do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
arn
- The ARN of the metric stream.
creation_date
- The date that the metric stream was originally created.
last_update_date
- The date that the configuration of this metric stream was most recently updated.
names
- The name of the metric stream.
firehose_arn
- The ARN of the Kinesis Firehose delivery stream that is used for this metric stream.
state
- The current state of this stream. Valid values are running and stopped.
output_format
- The output format of this metric stream. Valid values are
json
andopentelemetry0.7
.
Examples
Ensure an ARN is available.
describe aws_cloudwatch_metric_stream (metric_stream_name: 'METRIC_STREAM_NAME' ) do
its('arn') { should eq 'ARN' }
end
Ensure a firehose_ARN is available.
describe aws_cloudwatch_metric_stream (metric_stream_name: 'METRIC_STREAM_NAME' ) do
its('firehose_arn') { should eq 'FIREHOSE_ARN' }
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 get
method returns at least one result.
exist
Use should
to test that the entity exists.
describe aws_cloudwatch_metric_stream (metric_stream_name: 'METRIC_STREAM_NAME' ) do
it { should exist }
end
Use should_not
to test that the entity does not exist.
describe aws_cloudwatch_metric_stream (metric_stream_name: 'METRIC_STREAM_NAME' ) do
it { should_not exist }
end
AWS Permissions
Your Principal will need the CloudFront:Client:GetMetricStreamsOutput
action with Effect
set to Allow
.
Was this page helpful?