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

AWS::KinesisAnalytics::Application

AWS::KinesisAnalytics::Application 资源将创建 Amazon Kinesis Analytics 应用程序。有关更多信息,请参阅 Amazon Kinesis Analytics 开发人员指南

语法

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

JSON

Copy
{ "Type" : "AWS::KinesisAnalytics::Application", "Properties" : { "ApplicationName" : String, "ApplicationDescription" : String, "ApplicationCode" : String, "Inputs" : [ Input, ... ] } }

YAML

Copy
Type: "AWS::KinesisAnalytics::Application" Properties: ApplicationName: String ApplicationDescription: String ApplicationCode: String Inputs: - Input

属性

ApplicationName

Amazon Kinesis Analytics 应用程序的名称。

必需:否

类型:字符串

更新要求替换

ApplicationDescription

应用程序的摘要描述。

必需:否

类型:字符串

更新要求无需中断

ApplicationCode

一个或多个读取输入数据、转换数据并生成输出的 SQL 语句。

必需:否

类型:字符串

更新要求无需中断

Inputs

使用此参数可配置应用程序输入。

必需:是

类型Kinesis Analytics 应用程序 Input 的列表

更新要求无需中断

示例

创建 Amazon Kinesis Analytics 应用程序

以下示例演示如何创建和配置 Kinesis Analytics 应用程序。

YAML

Copy
--- Description: "Sample KinesisAnalytics via CloudFormation" Resources: BasicApplication: Type: "AWS::KinesisAnalytics::Application" Properties: ApplicationName: "sampleApplication" ApplicationDescription: "SampleApp" ApplicationCode: "Example Application Code" Inputs: - NamePrefix: "exampleNamePrefix" InputSchema: RecordColumns: - Name: "example" SqlType: "VARCHAR(16)" Mapping: "$.example" RecordFormat: RecordFormatType: "JSON" MappingParameters: JSONMappingParameters: RecordRowPath: "$" KinesisStreamsInput: ResourceARN: !GetAtt InputKinesisStream.Arn RoleARN: !GetAtt KinesisAnalyticsRole.Arn InputKinesisStream: Type: "AWS::Kinesis::Stream" Properties: ShardCount: 1 KinesisAnalyticsRole: Type: "AWS::IAM::Role" Properties: AssumeRolePolicyDocument: Version: "2012-10-17" Statement: - Effect: Allow Principal: Service: kinesisanalytics.amazonaws.com Action: "sts:AssumeRole" Path: "/" Policies: - PolicyName: Open PolicyDocument: Version: "2012-10-17" Statement: - Effect: Allow Action: "*" Resource: "*" BasicApplicationOutputs: Type: "AWS::KinesisAnalytics::ApplicationOutput" DependsOn: BasicApplication Properties: ApplicationName: !Ref BasicApplication Output: Name: "exampleOutput" DestinationSchema: RecordFormatType: "CSV" KinesisStreamsOutput: ResourceARN: !GetAtt OutputKinesisStream.Arn RoleARN: !GetAtt KinesisAnalyticsRole.Arn OutputKinesisStream: Type: "AWS::Kinesis::Stream" Properties: ShardCount: 1 ApplicationReferenceDataSource: Type: "AWS::KinesisAnalytics::ApplicationReferenceDataSource" DependsOn: BasicApplicationOutputs Properties: ApplicationName: !Ref BasicApplication ReferenceDataSource: TableName: "exampleTable" ReferenceSchema: RecordColumns: - Name: "example" SqlType: "VARCHAR(16)" Mapping: "$.example" RecordFormat: RecordFormatType: "JSON" MappingParameters: JSONMappingParameters: RecordRowPath: "$" S3ReferenceDataSource: BucketARN: !GetAtt S3Bucket.Arn FileKey: 'fakeKey' ReferenceRoleARN: !GetAtt KinesisAnalyticsRole.Arn S3Bucket: Type: AWS::S3::Bucket Outputs: ApplicationPhysicalResourceId: Value: !Ref BasicApplication

本页内容: