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
, "ApplicationMaintenanceConfiguration" :ApplicationMaintenanceConfiguration
, "ApplicationMode" :String
, "ApplicationName" :String
, "RunConfiguration" :RunConfiguration
, "RuntimeEnvironment" :String
, "ServiceExecutionRole" :String
, "Tags" :[ Tag, ... ]
} }
YAML
Type: AWS::KinesisAnalyticsV2::Application Properties: ApplicationConfiguration:
ApplicationConfiguration
ApplicationDescription:String
ApplicationMaintenanceConfiguration:ApplicationMaintenanceConfiguration
ApplicationMode:String
ApplicationName:String
RunConfiguration:RunConfiguration
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
ApplicationMaintenanceConfiguration
Property description not available.
Required: No
Type: ApplicationMaintenanceConfiguration
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
Pattern:
^[a-zA-Z0-9_.-]+$
Minimum:
1
Maximum:
128
Update requires: Replacement
RunConfiguration
-
Describes the starting parameters for an Managed Service for Apache Flink application.
Required: No
Type: RunConfiguration
Update requires: No interruption
RuntimeEnvironment
-
The runtime environment for the application.
Required: Yes
Type: String
Allowed values:
SQL-1_0 | FLINK-1_6 | FLINK-1_8 | ZEPPELIN-FLINK-1_0 | FLINK-1_11 | FLINK-1_13 | ZEPPELIN-FLINK-2_0 | FLINK-1_15 | ZEPPELIN-FLINK-3_0 | FLINK-1_18 | FLINK-1_19
Update requires: No interruption
ServiceExecutionRole
-
Specifies the IAM role that the application uses to access external resources.
Required: Yes
Type: String
Pattern:
^arn:.*$
Minimum:
1
Maximum:
2048
Update requires: No interruption
-
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: Array of Tag
Minimum:
1
Maximum:
50
Update requires: No interruption
Examples
Creating an Amazon Kinesis Data Analytics Application using Apache Flink
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.
JSON
{ "Description": "Simple KDA Flink application", "Parameters": { "CodeBucketArn": { "Type": "String" }, "CodeKey": { "Type": "String" } }, "Resources": { "MyApplication": { "Type": "AWS::KinesisAnalyticsV2::Application", "Properties": { "RuntimeEnvironment": "FLINK-1_15", "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}" } ] } ] } } ] } } } }
YAML
Description: Simple KDA Flink application Parameters: CodeBucketArn: Type: String CodeKey: Type: String Resources: MyApplication: Type: AWS::KinesisAnalyticsV2::Application Properties: RuntimeEnvironment: FLINK-1_15 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-3_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": "org.apache.flink", "ArtifactId": "flink-sql-connector-kinesis", "Version": "1.15.4" } }, { "ArtifactType": "DEPENDENCY_JAR", "MavenReference": { "GroupId": "org.apache.flink", "ArtifactId": "flink-connector-kafka", "Version": "1.15.4" } }, { "ArtifactType": "DEPENDENCY_JAR", "MavenReference": { "GroupId": "software.amazon.msk", "ArtifactId": "aws-msk-iam-auth", "Version": "1.1.6" } } ] } } } }, "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-3_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: org.apache.flink ArtifactId: flink-sql-connector-kinesis Version: 1.15.4 - ArtifactType: DEPENDENCY_JAR MavenReference: GroupId: org.apache.flink ArtifactId: flink-connector-kafka Version: 1.15.4 - ArtifactType: DEPENDENCY_JAR MavenReference: GroupId: software.amazon.msk ArtifactId: aws-msk-iam-auth Version: 1.1.6 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
-
CreateApplication in the Amazon Kinesis Data Analytics API Reference