【问题标题】:Property validation failure: [Value of property {/Tags} does not match type {Map}] for AWS::SSM::Parameter in YAML属性验证失败:YAML 中 AWS::SSM::Parameter 的 [属性值 {/Tags} 与类型 {Map} 不匹配]
【发布时间】:2021-10-26 14:17:25
【问题描述】:

以下代码n-p:

AWSTemplateFormatVersion: '2010-09-09'
Description: Some CloudFormation template

Resources:
  MyResourceName:
    Type: AWS::SSM::Parameter
    Properties:
      Name: myParameterName
      Type: String
      Value: "somevalue"
      Tags:
        - Key: firstTagName
          Value: firstTagValue
        - Key: secondTagName
          Value: secondTagValue

在 CloudFormation 中生成以下错误:

我应该如何正确构建 Tags 属性?

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation aws-ssm


    【解决方案1】:

    https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-parameter.html的例子所示。 Tags 属性的结构因资源而异(请参阅https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html)。 对于 AWS::SSM::Parameter 使用键值对而不是 Map:

    AWSTemplateFormatVersion: '2010-09-09'
    Description: Some CloudFormation template
    
    Resources:
      MyResourceName:
        Type: AWS::SSM::Parameter
        Properties:
          Name: myParameterName
          Type: String
          Value: "somevalue"
          Tags:
            firstTagName: firstTagValue
            secondTagName: secondTagValue
    

    这解决了我的问题。

    【讨论】:

      猜你喜欢
      • 2021-12-06
      • 1970-01-01
      • 1970-01-01
      • 2020-02-05
      • 2021-10-15
      • 2013-12-22
      • 2014-09-17
      • 1970-01-01
      • 2021-05-31
      相关资源
      最近更新 更多