Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::KinesisAnalytics::Application

The AWS::KinesisAnalytics::Application resource creates an Amazon Kinesis Analytics application. For more information, see the Amazon Kinesis Analytics Developer Guide.

Syntax

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

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

Properties

ApplicationName

The name of your Amazon Kinesis Analytics application.

Required: No

Type: String

Update requires: Replacement

ApplicationDescription

The summary description of the application.

Required: No

Type: String

Update requires: No interruption

ApplicationCode

One or more SQL statements that read input data, transform it, and generate output.

Required: No

Type: String

Update requires: No interruption

Inputs

Use this parameter to configure the application input.

Required: Yes

Type: List of Kinesis Analytics Application Input

Update requires: No interruption

Example

Creating an Amazon Kinesis Analytics Application

The following example demonstrates how to create and configure a Kinesis Analytics application.

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

On this page: