AWS::KinesisAnalyticsV2::Application - AWS CloudFormation
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

AWS::KinesisAnalyticsV2::Application

创建 Amazon Kinesis Data Analytics 应用程序。有关创建 Kinesis Data Analytics 应用程序的信息,请参阅创建应用程序

语法

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

JSON

{ "Type" : "AWS::KinesisAnalyticsV2::Application", "Properties" : { "ApplicationConfiguration" : ApplicationConfiguration, "ApplicationDescription" : String, "ApplicationName" : String, "RuntimeEnvironment" : String, "ServiceExecutionRole" : String, "Tags" : [ Tag, ... ] } }

YAML

Type: AWS::KinesisAnalyticsV2::Application Properties: ApplicationConfiguration: ApplicationConfiguration ApplicationDescription: String ApplicationName: String RuntimeEnvironment: String ServiceExecutionRole: String Tags: - Tag

属性

ApplicationConfiguration

使用该参数可配置应用程序。

必需:否

类型ApplicationConfiguration

Update requires: No interruption

ApplicationDescription

关于应用程序的描述。

必需:否

类型:字符串

最低0

最高1024

Update requires: No interruption

ApplicationName

应用程序名称。

必需:否

类型:字符串

最低1

最高128

模式[a-zA-Z0-9_.-]+

Update requires: Replacement

RuntimeEnvironment

应用程序的运行时环境(SQL-1.0FLINK-1_6FLINK-1_8)。

必需:是

类型:字符串

允许的值FLINK-1_6 | FLINK-1_8 | SQL-1_0

Update requires: Replacement

ServiceExecutionRole

指定应用程序用来访问外部资源的 IAM 角色。

必需:是

类型:字符串

最低1

最高2048

模式arn:aws:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+

Update requires: No interruption

Tags

分配给应用程序的一个或多个标签的列表。标签是用于标识应用程序的键/值对。请注意,应用程序标签的最大数量包括系统标签。用户定义的应用程序标签的最大数量为 50。

必需:否

类型Tag 的列表

Update requires: No interruption

示例

创建应用程序

JSON

{ "Description": "Sample KinesisAnalytics via CloudFormation", "Resources": { "BasicApplication": { "Type": "AWS::KinesisAnalyticsV2::Application", "Properties": { "ApplicationName": "sampleApplication", "ApplicationDescription": "SampleApp", "RuntimeEnvironment": "SQL-1_0", "ServiceExecutionRole": { "Fn::GetAtt": [ "ServiceExecutionRole", "Arn" ] }, "ApplicationConfiguration": { "SqlApplicationConfiguration": { "Inputs": [ { "NamePrefix": "exampleNamePrefix", "InputSchema": { "RecordColumns": [ { "Name": "example", "SqlType": "VARCHAR(16)", "Mapping": "$.example" } ], "RecordFormat": { "RecordFormatType": "JSON", "MappingParameters": { "JSONMappingParameters": { "RecordRowPath": "$" } } } }, "KinesisStreamsInput": { "ResourceARN": { "Fn::GetAtt": [ "InputKinesisStream", "Arn" ] } } } ] }, "ApplicationCodeConfiguration": { "CodeContent": { "TextContent": "Example Application Code" }, "CodeContentType": "PLAINTEXT" } } } }, "ServiceExecutionRole": { "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": "*" } ] } } ] } }, "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::KinesisAnalyticsV2::ApplicationOutput", "DependsOn": "BasicApplication", "Properties": { "ApplicationName": { "Ref": "BasicApplication" }, "Output": { "Name": "exampleOutput", "DestinationSchema": { "RecordFormatType": "CSV" }, "KinesisStreamsOutput": { "ResourceARN": { "Fn::GetAtt": [ "OutputKinesisStream", "Arn" ] } } } } }, "OutputKinesisStream": { "Type": "AWS::Kinesis::Stream", "Properties": { "ShardCount": 1 } }, "BasicApplicationReferenceDataSource": { "Type": "AWS::KinesisAnalyticsV2::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": { "Fn::GetAtt": [ "S3Bucket", "Arn" ] }, "FileKey": "fakeKey" } } } }, "S3Bucket": { "Type": "AWS::S3::Bucket" } }, "Outputs": { "ApplicationPhysicalResourceId": { "Value": { "Ref": "BasicApplication" } } } }

YAML

Description: Sample KinesisAnalytics via CloudFormation Description: Sample KinesisAnalytics via CloudFormation Resources: BasicApplication: Type: 'AWS::KinesisAnalyticsV2::Application' Properties: ApplicationName: sampleApplication ApplicationDescription: SampleApp RuntimeEnvironment: SQL-1_0 ServiceExecutionRole: !GetAtt - ServiceExecutionRole - Arn ApplicationConfiguration: SqlApplicationConfiguration: Inputs: - NamePrefix: exampleNamePrefix InputSchema: RecordColumns: - Name: example SqlType: VARCHAR(16) Mapping: $.example RecordFormat: RecordFormatType: JSON MappingParameters: JSONMappingParameters: RecordRowPath: $ KinesisStreamsInput: ResourceARN: !GetAtt - InputKinesisStream - Arn ApplicationCodeConfiguration: CodeContent: TextContent: Example Application Code CodeContentType: PLAINTEXT ServiceExecutionRole: 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: '*' 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::KinesisAnalyticsV2::ApplicationOutput' DependsOn: BasicApplication Properties: ApplicationName: !Ref BasicApplication Output: Name: exampleOutput DestinationSchema: RecordFormatType: CSV KinesisStreamsOutput: ResourceARN: !GetAtt - OutputKinesisStream - Arn OutputKinesisStream: Type: 'AWS::Kinesis::Stream' Properties: ShardCount: 1 BasicApplicationReferenceDataSource: Type: 'AWS::KinesisAnalyticsV2::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 S3Bucket: Type: 'AWS::S3::Bucket' Outputs: ApplicationPhysicalResourceId: Value: !Ref BasicApplication

另请参阅