Skip to main content

metric_streams

Creates, updates, deletes or gets a metric_stream resource or lists metric_streams in a region

Overview

Namemetric_streams
TypeResource
DescriptionResource Type definition for Metric Stream
Idawscc.cloudwatch.metric_streams

Fields

NameDatatypeDescription
arnstringAmazon Resource Name of the metric stream.
creation_datestringThe date of creation of the metric stream.
exclude_filtersarrayDefine which metrics will be not streamed. Metrics matched by multiple instances of MetricStreamFilter are joined with an OR operation by default. If both IncludeFilters and ExcludeFilters are omitted, all metrics in the account will be streamed. IncludeFilters and ExcludeFilters are mutually exclusive. Default to null.
firehose_arnstringThe ARN of the Kinesis Firehose where to stream the data.
include_filtersarrayDefine which metrics will be streamed. Metrics matched by multiple instances of MetricStreamFilter are joined with an OR operation by default. If both IncludeFilters and ExcludeFilters are omitted, all metrics in the account will be streamed. IncludeFilters and ExcludeFilters are mutually exclusive. Default to null.
last_update_datestringThe date of the last update of the metric stream.
namestringName of the metric stream.
role_arnstringThe ARN of the role that provides access to the Kinesis Firehose.
statestringDisplays the state of the Metric Stream.
output_formatstringThe output format of the data streamed to the Kinesis Firehose.
statistics_configurationsarrayBy default, a metric stream always sends the MAX, MIN, SUM, and SAMPLECOUNT statistics for each metric that is streamed. You can use this parameter to have the metric stream also send additional statistics in the stream. This array can have up to 100 members.
tagsarrayA set of tags to assign to the delivery stream.
include_linked_accounts_metricsbooleanIf you are creating a metric stream in a monitoring account, specify true to include metrics from source accounts that are linked to this monitoring account, in the metric stream. The default is false.
regionstringAWS region.

For more information, see AWS::CloudWatch::MetricStream.

Methods

NameResourceAccessible byRequired Params
create_resourcemetric_streamsINSERTregion
delete_resourcemetric_streamsDELETEIdentifier, region
update_resourcemetric_streamsUPDATEIdentifier, PatchDocument, region
list_resourcesmetric_streams_list_onlySELECTregion
get_resourcemetric_streamsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual metric_stream.

SELECT
region,
arn,
creation_date,
exclude_filters,
firehose_arn,
include_filters,
last_update_date,
name,
role_arn,
state,
output_format,
statistics_configurations,
tags,
include_linked_accounts_metrics
FROM awscc.cloudwatch.metric_streams
WHERE
region = 'us-east-1' AND
Identifier = '{{ name }}';

INSERT example

Use the following StackQL query and manifest file to create a new metric_stream resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.cloudwatch.metric_streams (
ExcludeFilters,
FirehoseArn,
IncludeFilters,
Name,
RoleArn,
OutputFormat,
StatisticsConfigurations,
Tags,
IncludeLinkedAccountsMetrics,
region
)
SELECT
'{{ exclude_filters }}',
'{{ firehose_arn }}',
'{{ include_filters }}',
'{{ name }}',
'{{ role_arn }}',
'{{ output_format }}',
'{{ statistics_configurations }}',
'{{ tags }}',
'{{ include_linked_accounts_metrics }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a metric_stream resource, using stack-deploy.

/*+ update */
UPDATE awscc.cloudwatch.metric_streams
SET PatchDocument = string('{{ {
"ExcludeFilters": exclude_filters,
"FirehoseArn": firehose_arn,
"IncludeFilters": include_filters,
"RoleArn": role_arn,
"OutputFormat": output_format,
"StatisticsConfigurations": statistics_configurations,
"Tags": tags,
"IncludeLinkedAccountsMetrics": include_linked_accounts_metrics
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}';

DELETE example

/*+ delete */
DELETE FROM awscc.cloudwatch.metric_streams
WHERE
Identifier = '{{ name }}' AND
region = 'us-east-1';

Permissions

To operate on the metric_streams resource, the following permissions are required:

cloudwatch:PutMetricStream,
cloudwatch:GetMetricStream,
cloudwatch:TagResource,
iam:PassRole