# /* # * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # * SPDX-License-Identifier: MIT-0 # * # * Permission is hereby granted, free of charge, to any person obtaining a copy of this # * software and associated documentation files (the "Software"), to deal in the Software # * without restriction, including without limitation the rights to use, copy, modify, # * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to # * permit persons to whom the Software is furnished to do so. # * # * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, # * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A # * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # */ AWSTemplateFormatVersion: 2010-09-09 Description: Builds and runs the kinesis-analytics-taxi-consumer Flink application in a fully managed environment using Amazon Kinesis Data Analytics for Java Applications (amazon-kinesis-analytics-taxi-consumer) Parameters: SshKeyName: Description: Name of an existing EC2 KeyPair to enable SSH access to the EC2 instance for replaying events ConstraintDescription: MuSt be the name of an existing EC2 KeyPair Type: AWS::EC2::KeyPair::KeyName ClientIpAddressRange: AllowedPattern: (\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2}) ConstraintDescription: Must be a valid IP CIDR range of the form x.x.x.x/x Description: IP address range that is able to access the EC2 instance and that gets full read and write access to the Elasticsearch Cluster and the Kibana dashboard MaxLength: 18 MinLength: 9 Type: String Outputs: KinesisReplayInstance: Description: The URL to the Session Management Console for this instance Value: !GetAtt TaxiConsumerInfrastructure.Outputs.KinesisReplayInstance ProducerCommand: Description: Command to populate Kinesis stream with taxi trip events Value: !GetAtt TaxiConsumerInfrastructure.Outputs.ProducerCommand KinesisStreamName: Description: Kinesis Data Stream name Value: !GetAtt TaxiConsumerInfrastructure.Outputs.KinesisStreamName FlinkApplicationName: Description: Kinesis Data Analytics Flink Application name Value: !GetAtt TaxiConsumerInfrastructure.Outputs.FlinkApplicationName ElasticsearchEndpoint: Description: ElasticSearch endpoint URL Value: !GetAtt TaxiConsumerInfrastructure.Outputs.ElasticsearchEndpoint KibanaDashboardURL: Description: URL to access the Kibana dasboard Value: !GetAtt TaxiConsumerInfrastructure.Outputs.KibanaDashboardURL Resources: KinesisReplayBuildStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: https://aws-bigdata-blog.s3.amazonaws.com/artifacts/kds-kpu-optimization/kinesis-replay-build-pipeline.yml Parameters: ExternalArtifactBucket: !Ref ArtifactBucket FlinkKinesisConnectorBuildStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: https://aws-bigdata-blog.s3.amazonaws.com/artifacts/kds-kpu-optimization/flink-kinesis-connector-build-pipeline.yml Parameters: ArtifactBucket: !Ref ArtifactBucket TaxiConsumerBuildStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: https://aws-bigdata-blog.s3.amazonaws.com/artifacts/kds-kpu-optimization/kinesis-analytics-taxi-consumer-build-pipeline.yml Parameters: ArtifactBucket: !Ref ArtifactBucket TaxiConsumerInfrastructure: Type: AWS::CloudFormation::Stack Properties: TemplateURL: https://aws-bigdata-blog.s3.amazonaws.com/artifacts/kds-kpu-optimization/kinesis-analytics-taxi-consumer-infrastructure.yml Parameters: KinesisReplayCopyCommand: !GetAtt KinesisReplayBuildStack.Outputs.KinesisReplayCopyCommand FlinkApplicationS3BucketArn: !GetAtt ArtifactBucket.Arn FlinkApplicationS3Path: !GetAtt TaxiConsumerBuildStack.Outputs.FlinkApplicationS3Path SshKeyName: !Ref SshKeyName ClientIpAddressRange: !Ref ClientIpAddressRange ArtifactBucket: Type: AWS::S3::Bucket Properties: VersioningConfiguration: Status: Enabled BucketEncryption: ServerSideEncryptionConfiguration: - ServerSideEncryptionByDefault: SSEAlgorithm: AES256