Skip to content

CloudWatchClient.put_metric_stream

rboto-cloudwatch==0.4.0 · Service index · Types

Model summary (excerpt): Creates or updates a metric stream. Metric streams can automatically stream CloudWatch metrics to Amazon Web Services destinations, including Amazon S3, and to many third-party solutions. For more information, see Using Metric Streams . To create a metric stream, you must be signed in to an account that has the iam:PassRole permission and either the CloudWatchFullAccess policy or the...

Install and imports

python -m pip install "rboto[cloudwatch]==0.4.0"
from rboto import CloudWatchClient
from collections.abc import Sequence
from rboto_cloudwatch.types import (
    MetricStreamFilter,
    MetricStreamOutputFormat,
    MetricStreamStatisticsConfiguration,
    PutMetricStreamOutput,
    Tag,
)

Signature

async def put_metric_stream(
    *,
    name: str,
    firehose_arn: str,
    role_arn: str,
    output_format: MetricStreamOutputFormat,
    include_filters: Sequence[MetricStreamFilter] | None = None,
    exclude_filters: Sequence[MetricStreamFilter] | None = None,
    tags: Sequence[Tag] | None = None,
    statistics_configurations: Sequence[MetricStreamStatisticsConfiguration] | None = None,
    include_linked_accounts_metrics: bool | None = None,
) -> PutMetricStreamOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
name Yes If you are creating a new metric stream, this is the name for the new stream. The name must be different than the names of other metric streams in this account and Region. If you are updating a metric stream, specify the name of that stream here. Valid characters are A-Z, a-z, 0-9, "-" and "_".
firehose_arn Yes The ARN of the Amazon Kinesis Data Firehose delivery stream to use for this metric stream. This Amazon Kinesis Data Firehose delivery stream must already exist and must be in the same account as the metric stream.
role_arn Yes The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Data Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the following permissions: firehose:PutRecord firehose:PutRecordBatch
output_format Yes The output format for the stream. Valid values are json , opentelemetry1.0 , and opentelemetry0.7 . For more information about metric stream output formats, see Metric streams output formats .
include_filters No If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. You cannot include IncludeFilters and ExcludeFilters in the same operation.
exclude_filters No If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. You cannot include ExcludeFilters and IncludeFilters in the same operation.
tags No A list of key-value pairs to associate with the metric stream. You can associate as many as 50 tags with a metric stream. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. You can use this parameter only when you are creating a new metric stream. If...
statistics_configurations No By 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. For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The...
include_linked_accounts_metrics No If you are creating a metric stream in a monitoring account, specify true to include metrics from source accounts in the metric stream.

Output

PutMetricStreamOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
arn str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

MetricStreamFilter, MetricStreamOutputFormat, MetricStreamStatisticsConfiguration, PutMetricStreamOutput, Tag

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_cloudwatch.exceptions:

ConcurrentModificationError, InternalServiceFaultError, InvalidParameterCombinationError, InvalidParameterValueError, MissingRequiredParameterError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model