AWS CloudFormation
User Guide (API Version 2010-05-15)
AWS 服务或AWS文档中描述的功能,可能因地区/位置而异。请点击 Amazon AWS 入门,可查看中国地区的具体差异

AWS::KinesisFirehose::DeliveryStream

AWS::KinesisFirehose::DeliveryStream 资源创建一个 Amazon Kinesis Firehose (Kinesis Firehose) 传输流,此流将实时流数据传输到 Amazon Simple Storage Service (Amazon S3)、Amazon Redshift 或 Amazon Elasticsearch Service (Amazon ES) 目标。有关更多信息,请参阅 Amazon Kinesis Firehose 开发人员指南 中的创建 Amazon Kinesis Firehose 传输流

语法

要在 AWS CloudFormation 模板中声明此实体,请使用以下语法:

属性

DeliveryStreamName

传输流的名称。

Required: No

Type: String

更新要求替换

DeliveryStreamType

传输流名称类型。此属性可以是以下值之一:

  • DirectPut:提供商应用程序直接访问传输流。

  • KinesisStreamAsSource:传输流使用 Kinesis 流作为来源。

Required: No

Type: String

更新要求替换

ElasticsearchDestinationConfiguration

传输流的 Amazon ES 目标。

Required: Conditional。您必须仅指定一个目标配置。

Type: Kinesis Firehose DeliveryStream ElasticsearchDestinationConfiguration

更新要求无需中断. 如果您将传输流目标从 Amazon ES 目标更改为 Amazon S3 或 Amazon Redshift 目标,则更新需要一些中断

ExtendedS3DestinationConfiguration

传输流的 Amazon S3 目标。

Required: Conditional。您必须仅指定一个目标配置。

类型Kinesis Firehose DeliveryStream ExtendedS3DestinationConfiguration

更新要求无需中断. 如果您将传输流目标从 Amazon Redshift 目标更改为 Amazon ES 目标,则更新需要一些中断

KinesisStreamSourceConfiguration

当 Kinesis 流用作传输流的来源时,Kinesis Firehose DeliveryStream KinesisStreamSourceConfiguration 包含 Kinesis 流 ARN 和来源流的角色 ARN。

Required: No

Type: Kinesis Firehose DeliveryStream KinesisStreamSourceConfiguration

更新要求无需中断

RedshiftDestinationConfiguration

传输流的 Amazon Redshift 目标。

Required: Conditional。您必须仅指定一个目标配置。

Type: Kinesis Firehose DeliveryStream RedshiftDestinationConfiguration

更新要求无需中断. 如果您将传输流目标从 Amazon Redshift 目标更改为 Amazon ES 目标,则更新需要一些中断

S3DestinationConfiguration

传输流的 Amazon S3 目标。

Required: Conditional。您必须仅指定一个目标配置。

Type: Kinesis Firehose DeliveryStream S3DestinationConfiguration

更新要求无需中断. 如果您将传输流目标从 Amazon S3 目标更改为 Amazon ES 目标,则更新需要一些中断

返回值

Ref

当向 Ref 内部函数提供此资源的逻辑 ID 时,Ref 将返回传输流名称,如 mystack-deliverystream-1ABCD2EF3GHIJ

有关使用 Ref 功能的更多信息,请参阅参考

示例

以下示例创建一个将数据传输到 Amazon ES 目标的 Kinesis Firehose 传输流。Kinesis Firehose 将在 Amazon S3 存储桶中备份已发送到目的地的所有数据。

JSON

"ElasticSearchDeliveryStream": { "Type": "AWS::KinesisFirehose::DeliveryStream", "Properties": { "ElasticsearchDestinationConfiguration": { "BufferingHints": { "IntervalInSeconds": 60, "SizeInMBs": 50 }, "CloudWatchLoggingOptions": { "Enabled": true, "LogGroupName": "deliverystream", "LogStreamName": "elasticsearchDelivery" }, "DomainARN": { "Ref" : "MyDomainARN" }, "IndexName": { "Ref" : "MyIndexName" }, "IndexRotationPeriod": "NoRotation", "TypeName" : "fromFirehose", "RetryOptions": { "DurationInSeconds": "60" }, "RoleARN": { "Fn::GetAtt" : ["ESdeliveryRole", "Arn"] }, "S3BackupMode": "AllDocuments", "S3Configuration": { "BucketARN": { "Ref" : "MyBackupBucketARN" }, "BufferingHints": { "IntervalInSeconds": "60", "SizeInMBs": "50" }, "CompressionFormat": "UNCOMPRESSED", "Prefix": "firehose/", "RoleARN": { "Fn::GetAtt" : ["S3deliveryRole", "Arn"] }, "CloudWatchLoggingOptions" : { "Enabled" : true, "LogGroupName" : "deliverystream", "LogStreamName" : "s3Backup" } } } } }

YAML

ElasticSearchDeliveryStream: Type: "AWS::KinesisFirehose::DeliveryStream" Properties: ElasticsearchDestinationConfiguration: BufferingHints: IntervalInSeconds: 60 SizeInMBs: 50 CloudWatchLoggingOptions: Enabled: true LogGroupName: "deliverystream" LogStreamName: "elasticsearchDelivery" DomainARN: Ref: "MyDomainARN" IndexName: Ref: "MyIndexName" IndexRotationPeriod: "NoRotation" TypeName: "fromFirehose" RetryOptions: DurationInSeconds: "60" RoleARN: Fn::GetAtt: - "ESdeliveryRole" - "Arn" S3BackupMode: "AllDocuments" S3Configuration: BucketARN: Ref: "MyBackupBucketARN" BufferingHints: IntervalInSeconds: "60" SizeInMBs: "50" CompressionFormat: "UNCOMPRESSED" Prefix: "firehose/" RoleARN: Fn::GetAtt: - "S3deliveryRole" - "Arn" CloudWatchLoggingOptions: Enabled: true LogGroupName: "deliverystream" LogStreamName: "s3Backup"

以下示例使用 ExtendedS3DestinationConfiguration 属性指定传输流的 Amazon S3 目的地。

JSON

{ "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "Stack for Firehose DeliveryStream S3 Destination.", "Resources": { "deliverystream": { "DependsOn": ["deliveryPolicy"], "Type": "AWS::KinesisFirehose::DeliveryStream", "Properties": { "ExtendedS3DestinationConfiguration": { "BucketARN": {"Fn::Join": ["", ["arn:aws:s3:::", {"Ref":"s3bucket"}]]}, "BufferingHints": { "IntervalInSeconds": "60", "SizeInMBs": "50" }, "CompressionFormat": "UNCOMPRESSED", "Prefix": "firehose/", "RoleARN": {"Fn::GetAtt" : ["deliveryRole", "Arn"] }, "ProcessingConfiguration" : { "Enabled": "true", "Processors": [ { "Parameters": [ { "ParameterName": "LambdaArn", "ParameterValue": {"Ref":"myLambda"} }], "Type": "Lambda" }] } } } }, "s3bucket": { "Type": "AWS::S3::Bucket", "Properties": { "VersioningConfiguration": { "Status": "Enabled" } } }, "deliveryRole": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "Service": "firehose.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "sts:ExternalId": {"Ref":"AWS::AccountId"} } } } ] } } }, "deliveryPolicy": { "Type": "AWS::IAM::Policy", "Properties": { "PolicyName": "firehose_delivery_policy", "PolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:AbortMultipartUpload", "s3:GetBucketLocation", "s3:GetObject", "s3:ListBucket", "s3:ListBucketMultipartUploads", "s3:PutObject" ], "Resource": [ {"Fn::Join": ["", ["arn:aws:s3:::", {"Ref":"s3bucket"}]]}, {"Fn::Join": ["", ["arn:aws:s3:::", {"Ref":"s3bucket"}, "*"]]} ] } ] }, "Roles": [{"Ref": "deliveryRole"}] } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Description: Stack for Firehose DeliveryStream S3 Destination. Resources: deliverystream: DependsOn: - deliveryPolicy Type: 'AWS::KinesisFirehose::DeliveryStream' Properties: ExtendedS3DestinationConfiguration: BucketARN: !Join - '' - - 'arn:aws:s3:::' - !Ref s3bucket BufferingHints: IntervalInSeconds: '60' SizeInMBs: '50' CompressionFormat: UNCOMPRESSED Prefix: firehose/ RoleARN: !GetAtt - deliveryRole - Arn ProcessingConfiguration: Enabled: 'true' Processors: - Parameters: - ParameterName: LambdaArn ParameterValue: !Ref myLambda Type: Lambda s3bucket: Type: 'AWS::S3::Bucket' Properties: VersioningConfiguration: Status: Enabled deliveryRole: Type: 'AWS::IAM::Role' Properties: AssumeRolePolicyDocument: Version: 2012-10-17 Statement: - Sid: '' Effect: Allow Principal: Service: firehose.amazonaws.com Action: 'sts:AssumeRole' Condition: StringEquals: 'sts:ExternalId': !Ref 'AWS::AccountId' deliveryPolicy: Type: 'AWS::IAM::Policy' Properties: PolicyName: firehose_delivery_policy PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Action: - 's3:AbortMultipartUpload' - 's3:GetBucketLocation' - 's3:GetObject' - 's3:ListBucket' - 's3:ListBucketMultipartUploads' - 's3:PutObject' Resource: - !Join - '' - - 'arn:aws:s3:::' - !Ref s3bucket - !Join - '' - - 'arn:aws:s3:::' - !Ref s3bucket - '*' Roles: - !Ref deliveryRole

以下示例使用 KinesisStreamSourceConfiguration 属性指定 Kinesis 流作为传输流的来源。

JSON

{ "Parameters": { "deliveryRoleArn": { "Type": "String" }, "deliveryStreamName": { "Type": "String" }, "kinesisStreamARN": { "Type": "String" }, "kinesisStreamRoleArn": { "Type": "String" }, "s3bucketArn": { "Type": "String" } }, "Resources": { "Deliverystream": { "Type": "AWS::KinesisFirehose::DeliveryStream", "Properties": { "DeliveryStreamName": { "Ref": "deliveryStreamName" }, "DeliveryStreamType": "KinesisStreamAsSource", "KinesisStreamSourceConfiguration": { "KinesisStreamARN": { "Ref": "kinesisStreamARN" }, "RoleARN": { "Ref": "kinesisStreamRoleArn" } }, "ExtendedS3DestinationConfiguration": { "BucketARN": { "Ref": "s3bucketArn" }, "BufferingHints": { "IntervalInSeconds": 60, "SizeInMBs": 50, "CompressionFormat": "UNCOMPRESSED" }, "Prefix": "firehose/", "RoleARN": { "Ref": "deliveryRoleArn" } } } } } }

YAML

Parameters: deliveryRoleArn: Type: String deliveryStreamName: Type: String kinesisStreamARN : Type : String kinesisStreamRoleArn: Type : String s3bucketArn: Type: String Resources : Deliverystream: Type: AWS::KinesisFirehose::DeliveryStream Properties: DeliveryStreamName: !Ref deliveryStreamName DeliveryStreamType: KinesisStreamAsSource KinesisStreamSourceConfiguration: KinesisStreamARN: !Ref kinesisStreamARN RoleARN: !Ref kinesisStreamRoleArn ExtendedS3DestinationConfiguration: BucketARN: !Ref s3bucketArn BufferingHints: IntervalInSeconds: 60 SizeInMBs: 50 CompressionFormat: UNCOMPRESSED Prefix: firehose/ RoleARN: !Ref deliveryRoleArn

另请参阅