AWS::KinesisAnalyticsV2::Application - AWS CloudFormation

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, "ApplicationMode" : String, "ApplicationName" : String, "RuntimeEnvironment" : String, "ServiceExecutionRole" : String, "Tags" : [ Tag, ... ] } }

YAML

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

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

ApplicationMode

To create a Kinesis Data Analytics Studio notebook, you must set the mode to INTERACTIVE. However, for a Kinesis Data Analytics for Apache Flink application, the mode is optional.

Required: No

Type: String

Allowed values: INTERACTIVE | STREAMING

Update requires: Replacement

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, FLINK-1_6, FLINK-1_8, or FLINK-1_11).

Required: Yes

Type: String

Allowed values: FLINK-1_11 | FLINK-1_6 | FLINK-1_8 | SQL-1_0 | ZEPPELIN-FLINK-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:.*

Update requires: No interruption

Tags

A list of one or more tags to assign to the application. A tag is a key-value pair that identifies an application. Note that the maximum number of application tags includes system tags. The maximum number of user-defined application tags is 50.

Required: No

Type: List of Tag

Update requires: No interruption

Examples

The following example shows how to create a simple application by using a deployment package from Amazon S3. You must add permissions to the IAM role to access any streams that your code requires.

{ "Description": "Simple KDA Flink application", "Parameters": { "CodeBucketArn": { "Type": "String" }, "CodeKey": { "Type": "String" } }, "Resources": { "MyApplication": { "Type": "AWS::KinesisAnalyticsV2::Application", "Properties": { "RuntimeEnvironment": "FLINK-1_11", "ServiceExecutionRole": { "Fn::GetAtt": [ "ServiceExecutionRole", "Arn" ] }, "ApplicationConfiguration": { "ApplicationCodeConfiguration": { "CodeContent": { "S3ContentLocation": { "BucketARN": { "Ref": "CodeBucketArn" }, "FileKey": { "Ref": "CodeKey" } } }, "CodeContentType": "ZIPFILE" } } } }, "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": "s3-code-access", "PolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject" ], "Resource": [ { "Fn::Sub": "${CodeBucketArn}/${CodeKey}" } ] } ] } } ] } } } }
Description: Simple KDA Flink application Parameters: CodeBucketArn: Type: String CodeKey: Type: String ​ Resources: MyApplication: Type: AWS::KinesisAnalyticsV2::Application Properties: RuntimeEnvironment: FLINK-1_11 ServiceExecutionRole: !GetAtt ServiceExecutionRole.Arn ApplicationConfiguration: ApplicationCodeConfiguration: CodeContent: S3ContentLocation: BucketARN: !Ref CodeBucketArn FileKey: !Ref CodeKey CodeContentType: 'ZIPFILE' ​ 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: s3-code-access PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Action: - s3:GetObject Resource: - !Sub "${CodeBucketArn}/${CodeKey}"

Creating an Amazon Kinesis Data Analytics Studio Application

The following example shows how to create a simple Studio application with an Amazon Glue database. You must add permissions to the IAM role to create or access any streams you require, and any that already exist must be added to the Glue database.

JSON

{ "Description": "KDA Studio application", "Parameters": { "GlueDatabaseName": { "Type": "String" } }, "Resources": { "MyApplication": { "Type": "AWS::KinesisAnalyticsV2::Application", "Properties": { "ApplicationMode": "INTERACTIVE", "RuntimeEnvironment": "ZEPPELIN-FLINK-1_0", "ServiceExecutionRole": { "Fn::GetAtt": [ "ServiceExecutionRole", "Arn" ] }, "ApplicationConfiguration": { "FlinkApplicationConfiguration": { "ParallelismConfiguration": { "Parallelism": 4, "ConfigurationType": "CUSTOM" } }, "ZeppelinApplicationConfiguration": { "CatalogConfiguration": { "GlueDataCatalogConfiguration": { "DatabaseARN": { "Fn::Sub": "arn:aws:glue:${AWS::Region}:${AWS::AccountId}:database/${GlueDatabase}" } } }, "CustomArtifactsConfiguration": [ { "ArtifactType": "DEPENDENCY_JAR", "MavenReference": { "GroupId": "software.amazon.kinesis", "ArtifactId": "amazon-kinesis-sql-connector-flink", "Version": "2.0.3" } }, { "ArtifactType": "DEPENDENCY_JAR", "MavenReference": { "GroupId": "org.apache.flink", "ArtifactId": "flink-sql-connector-kafka_2.12", "Version": "1.11.1" } } ] } } } }, "GlueDatabase": { "Type": "AWS::Glue::Database", "Properties": { "CatalogId": { "Ref": "AWS::AccountId" }, "DatabaseInput": { "Name": { "Ref": "GlueDatabaseName" }, "Description": "My glue database" } } }, "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": "glue-access", "PolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "glue:GetConnection", "glue:GetTable", "glue:GetTables", "glue:CreateTable", "glue:UpdateTable", "glue:GetDatabases", "glue:GetUserDefinedFunction" ], "Resource": [ { "Fn::Sub": "arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:connection/*" }, { "Fn::Sub": "arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:table/*" }, { "Fn::Sub": "arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:database/${GlueDatabase}/*" }, { "Fn::Sub": "arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:catalog" }, { "Fn::Sub": "arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:userDefinedFunction/*" } ] }, { "Effect": "Allow", "Action": [ "glue:GetDatabase" ], "Resource": [ "*" ] } ] } } ] } } } }

YAML

Description: KDA Studio application Parameters: GlueDatabaseName: Type: String Resources: MyApplication: Type: AWS::KinesisAnalyticsV2::Application Properties: ApplicationMode: INTERACTIVE RuntimeEnvironment: ZEPPELIN-FLINK-1_0 ServiceExecutionRole: !GetAtt ServiceExecutionRole.Arn ApplicationConfiguration: FlinkApplicationConfiguration: ParallelismConfiguration: Parallelism: 4 ConfigurationType: CUSTOM ZeppelinApplicationConfiguration: CatalogConfiguration: GlueDataCatalogConfiguration: DatabaseARN: !Sub "arn:aws:glue:${AWS::Region}:${AWS::AccountId}:database/${GlueDatabase}" CustomArtifactsConfiguration: - ArtifactType: DEPENDENCY_JAR MavenReference: GroupId: software.amazon.kinesis ArtifactId: amazon-kinesis-sql-connector-flink Version: 2.0.3 - ArtifactType: DEPENDENCY_JAR MavenReference: GroupId: org.apache.flink ArtifactId: flink-sql-connector-kafka_2.12 Version: 1.11.1 GlueDatabase: Type: AWS::Glue::Database Properties: CatalogId: !Ref AWS::AccountId DatabaseInput: Name: !Ref GlueDatabaseName Description: My glue database 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: glue-access PolicyDocument: Version: 2012-10-17 Statement: - Effect: Allow Action: - glue:GetConnection - glue:GetTable - glue:GetTables - glue:CreateTable - glue:UpdateTable - glue:GetDatabases - glue:GetUserDefinedFunction Resource: - !Sub "arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:connection/*" - !Sub "arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:table/*" - !Sub "arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:database/${GlueDatabase}/*" - !Sub "arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:catalog" - !Sub "arn:${AWS::Partition}:glue:${AWS::Region}:${AWS::AccountId}:userDefinedFunction/*" - Effect: Allow Action: - glue:GetDatabase Resource: - "*"

See also