Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aws cloud formation template: how to provide StreamName for Kinesis resource?

I wanted to create a Kinesis resource through cloud formation template and it wouldn't let me provide a "StreamName" as property for the resource.

"KinesisResource":{
"Type" : "AWS::Kinesis::Stream",
"Properties" : {
"ShardCount" : 1
"StreamName":"KinesisStream"
}

},

It says "unrecognizable property "StreamName". how do I give a Stream Name in my template. Thanks, Nithya.

like image 726
user2716913 Avatar asked Jul 18 '14 20:07

user2716913


People also ask

How do I refer to a resource in another AWS CloudFormation stack during template creation?

Note: To reference a resource in another AWS CloudFormation stack, you must create cross-stack references. To create a cross-stack reference, use the export field to flag the value of a resource output for export.

How do I create a CloudFormation template from an existing resource in AWS?

Create a stack from existing resources using the AWS Management Console. Sign in to the AWS Management Console and open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation . On the Stacks page, choose Create stack, and then choose With existing resources (import resources).

Does CloudFormation support non AWS resources in templates?

They can help you manage both AWS and non-AWS resources such as AWS application resources and non-AWS SaaS software services such as monitoring, team productivity, incident management, or version control management tools.


2 Answers

Apparently you can't specify a Stream name as of now. The Kinesis Documentation for the CloudFormation supports only ShardCount as the only parameter.

You can perhaps get the Kinesis stream name as part of the CloudFormation Output - using

{ "Ref" : "< resource name of instance of - AWS::Kinesis::Stream>" }

As of now the name of stream is created in the pattern of <Stack-Name> - <Stream Name - Resoruce Name> - < Arbitrary Info >

Stack Name : MyKinesisStack

{
  "AWSTemplateFormatVersion" : "2010-09-09",
  "Resources" : {
    "KinesisStream1" : {
      "Type" : "AWS::Kinesis::Stream",
      "Properties" : {
        "ShardCount" : "1"        
      }
    }
  },
  "Outputs" : {
  "KinesisStreamName" : {
        "Description" : "Kenisis Stream Name",
        "Value" : { "Ref" : "KinesisStream1"}
    }  
  }
}

The above stack would create a Kinesis Stream with the name - MyKinesisStack-KinesisStream1-ARTSDY32AS

like image 95
Naveen Vijay Avatar answered Sep 25 '22 22:09

Naveen Vijay


This has been solved with Name in Property.

{
   "Type" : "AWS::Kinesis::Stream",
   "Properties" : {
      "Name" : String,
      "ShardCount" : Integer,
      "Tags" : [ Resource Tag, ... ]
   }
}

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html

like image 24
joe-l-bright Avatar answered Sep 21 '22 22:09

joe-l-bright