Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PutMetricStreamCommand

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 logged on to an account that has the iam:PassRole permission and either the CloudWatchFullAccess policy or the cloudwatch:PutMetricStream permission.

When you create or update a metric stream, you choose one of the following:

  • Stream metrics from all metric namespaces in the account.

  • Stream metrics from all metric namespaces in the account, except for the namespaces that you list in ExcludeFilters.

  • Stream metrics from only the metric namespaces that you list in IncludeFilters.

When you use PutMetricStream to create a new metric stream, the stream is created in the running state. If you use it to update an existing stream, the state of the stream is not changed.

example

Use a bare-bones client and the command you need to make an API call.

import { CloudWatchClient, PutMetricStreamCommand } from "@aws-sdk/client-cloudwatch"; // ES Modules import
// const { CloudWatchClient, PutMetricStreamCommand } = require("@aws-sdk/client-cloudwatch"); // CommonJS import
const client = new CloudWatchClient(config);
const command = new PutMetricStreamCommand(input);
const response = await client.send(command);
see

PutMetricStreamCommandInput for command's input shape.

see

PutMetricStreamCommandOutput for command's response shape.

see

config for CloudWatchClient's config shape.

Hierarchy

Implements

Index

Constructors

Properties

Constructors

constructor

Properties

Readonly input

input: PutMetricStreamCommandInput

Readonly middlewareStack

middlewareStack: IMiddlewareStack<PutMetricStreamCommandInput, PutMetricStreamCommandOutput>