AWS CloudFormation
User Guide (Version )

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

AWS::KinesisAnalyticsV2::Application

Creates an Amazon Kinesis Data Analytics application. For information about creating a Kinesis Data Analytics application, see Creating an Application.

Syntax

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

JSON

{ "Type" : "AWS::KinesisAnalyticsV2::Application", "Properties" : { "ApplicationConfiguration" : ApplicationConfiguration, "ApplicationDescription" : String, "ApplicationName" : String, "RuntimeEnvironment" : String, "ServiceExecutionRole" : String } }

YAML

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

Properties

ApplicationConfiguration

Use this parameter to configure the application.

Required: No

Type: ApplicationConfiguration

Update requires: No interruption

ApplicationDescription

The description of the application.

Required: No

Type: String

Minimum: 0

Maximum: 1024

Update requires: No interruption

ApplicationName

The name of the application.

Required: No

Type: String

Minimum: 1

Maximum: 128

Pattern: [a-zA-Z0-9_.-]+

Update requires: Replacement

RuntimeEnvironment

The runtime environment for the application (SQL-1.0 or FLINK-1_6).

Required: Yes

Type: String

Allowed Values: FLINK-1_6 | SQL-1_0

Update requires: Replacement

ServiceExecutionRole

Specifies the IAM role that the application uses to access external resources.

Required: Yes

Type: String

Minimum: 1

Maximum: 2048

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

Update requires: No interruption

Examples

Create an application

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": [ "SQLCanaryInputStream", "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::KinesisAnalytics::ApplicationOutput", "DependsOn": "BasicApplication", "Properties": { "ApplicationName": { "Ref": "BasicApplication" }, "Output": { "Name": "exampleOutput", "DestinationSchema": { "RecordFormatType": "CSV" }, "KinesisStreamsOutput": { "ResourceARN": { "Fn::GetAtt": [ "OutputKinesisStream", "Arn" ] }, "RoleARN": { "Fn::GetAtt": [ "KinesisAnalyticsRole", "Arn" ] } } } } }, "OutputKinesisStream": { "Type": "AWS::Kinesis::Stream", "Properties": { "ShardCount": 1 } }, "BasicApplicationReferenceDataSource": { "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": { "Fn::GetAtt": [ "S3Bucket", "Arn" ] }, "FileKey": "fakeKey", "ReferenceRoleARN": { "Fn::GetAtt": [ "KinesisAnalyticsRole", "Arn" ] } } } } }, "S3Bucket": { "Type": "AWS::S3::Bucket" } }, "Outputs": { "ApplicationPhysicalResourceId": { "Value": { "Ref": "BasicApplication" } } } }

YAML

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 - SQLCanaryInputStream - 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::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 BasicApplicationReferenceDataSource: 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

See Also