【问题标题】:Value of property Event must be of type String in CloudFormation in TopicConfigurations for an S3 bucket属性 Event 的值必须是 S3 存储桶的 TopicConfigurations 中 CloudFormation 中的字符串类型
【发布时间】:2017-04-16 03:14:26
【问题描述】:

我在 cloudformation 模板中有这段代码:

     "MyBucket": {
     "Type" : "AWS::S3::Bucket",
     "Properties" : {
     "NotificationConfiguration": {
              "TopicConfigurations": [
                {
                  "Event": ["s3:ObjectCreated:Put" , "s3:ObjectCreated:Post"], 
                  "Topic": { "Ref": "TopicSNS" }
                }
              ]
            }
}
}

通过在 CloudFormation 中创建堆栈测试此代码后,我收到此错误:Value of property Event must be of type String 并且创建失败。 这样做的理由是什么? 谢谢

【问题讨论】:

    标签: json amazon-s3 amazon-sqs amazon-cloudformation


    【解决方案1】:

    您将列表传递给Event 属性,但Event requires a string value。要配置多个事件,请创建多个 TopicConfigurations 对象:

    "MyBucket": {
      "Type": "AWS::S3::Bucket",
      "Properties": {
        "NotificationConfiguration": {
          "TopicConfigurations": [
            {
              "Event": "s3:ObjectCreated:Put",
              "Topic": {
                "Ref": "TopicSNS"
              }
            },
            {
              "Event": "s3:ObjectCreated:Post",
              "Topic": {
                "Ref": "TopicSNS"
              }
            }
          ]
        }
      }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-05
      • 2021-11-23
      • 2020-03-25
      • 2020-11-06
      • 2020-07-14
      • 2019-04-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多