【问题标题】:Aws cloud formation template: how to provide StreamName for Kinesis resource?Aws cloudformation 模板:如何为 Kinesis 资源提供流名称?
【发布时间】:2014-09-10 01:22:42
【问题描述】:

我想通过云形成模板创建 Kinesis 资源,但它不允许我提供“StreamName”作为资源的属性。

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

},

上面写着“无法识别的属性“StreamName”。 如何在模板中提供流名称。 谢谢, 尼西亚。

【问题讨论】:

    标签: amazon-cloudformation amazon-kinesis


    【解决方案1】:

    这已通过 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

    【讨论】:

      【解决方案2】:

      显然,您现在无法指定 Stream 名称。 CloudFormation 的 Kinesis 文档仅支持将 ShardCount 作为唯一参数。

      您也许可以获取 Kinesis 流名称作为 CloudFormation 输出的一部分 - 使用

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

      到目前为止,流的名称是以<Stack-Name> - <Stream Name - Resoruce Name> - < Arbitrary Info >的模式创建的

      堆栈名称:MyKinesisStack

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

      上述堆栈将创建一个名为 - MyKinesisStack-KinesisStream1-ARTSDY32AS

      的 Kinesis Stream

      【讨论】:

      • 您好 Naveen,感谢您的回复。是的,这就是我所做的,并在环境的 OptionSetting 中使用了输出值。但我还是想知道,因为 API 有 setStreamName,只有 cloudFormation 不允许命名流。
      • @NaveenVijay 请在有官方更新时在此处更新。
      • 当然可以@advncd
      猜你喜欢
      • 2017-01-31
      • 1970-01-01
      • 1970-01-01
      • 2013-08-07
      • 1970-01-01
      • 1970-01-01
      • 2016-09-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多