选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

AWS::Logs::Destination

聚焦模式
AWS::Logs::Destination - AWS CloudFormation
此页面尚未翻译为您的语言。 请求翻译
筛选器视图

The AWS::Logs::Destination resource specifies a CloudWatch Logs destination. A destination encapsulates a physical resource (such as an Amazon Kinesis data stream) and enables you to subscribe that resource to a stream of log events.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::Logs::Destination", "Properties" : { "DestinationName" : String, "DestinationPolicy" : String, "RoleArn" : String, "TargetArn" : String } }

YAML

Type: AWS::Logs::Destination Properties: DestinationName: String DestinationPolicy: String RoleArn: String TargetArn: String

Properties

DestinationName

The name of the destination.

Required: Yes

Type: String

Pattern: ^[^:*]{1,512}$

Minimum: 1

Maximum: 512

Update requires: Replacement

DestinationPolicy

An IAM policy document that governs which AWS accounts can create subscription filters against this destination.

Required: No

Type: String

Minimum: 1

Update requires: No interruption

RoleArn

The ARN of an IAM role that permits CloudWatch Logs to send data to the specified AWS resource.

Required: Yes

Type: String

Minimum: 1

Update requires: No interruption

TargetArn

The Amazon Resource Name (ARN) of the physical target where the log events are delivered (for example, a Kinesis stream).

Required: Yes

Type: String

Minimum: 1

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the resource name, such as TestDestination.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

The ARN of the CloudWatch Logs destination, such as arn:aws:logs:us-west-1:123456789012:destination:MyDestination.

Examples

Create a Destination

In the following example, the target stream (TestStream) can receive log events from CloudWatch Logs. CloudWatch Logs can use only the PutSubscriptionFilter action against the TestDestination destination.

JSON

"DestinationWithName" : { "Type" : "AWS::Logs::Destination", "Properties" : { "DestinationName": "TestDestination", "RoleArn": "arn:aws:iam::123456789012:role/LogKinesisRole", "TargetArn": "arn:aws:kinesis:us-east-1:123456789012:stream/TestStream", "DestinationPolicy": "{ \"Version\": \"2012-10-17\", \"Statement\": [{ \"Effect\": \"Allow\", \"Principal\": { \"AWS\": \"logs.amazonaws.com\"}, \"Action\": \"logs:PutSubscriptionFilter\",\"Resource\": \"arn:aws:logs:us-east-1:123456789012:destination:TestDestination\"}]}" } }

YAML

DestinationWithName: Type: AWS::Logs::Destination Properties: DestinationName: "TestDestination" RoleArn: "arn:aws:iam::123456789012:role/LogKinesisRole" TargetArn: "arn:aws:kinesis:us-east-1:123456789012:stream/TestStream" DestinationPolicy: > {"Version" : "2012-10-17","Statement" : [{"Effect" : "Allow", "Principal" : {"AWS" : "logs.amazonaws.com"}, "Action" : "logs:PutSubscriptionFilter", "Resource" : "arn:aws:logs:us-east-1:123456789012:destination:TestDestination"}]}

本页内容

下一主题:

AWS::Logs::Integration

上一主题:

Tag
隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。