【问题标题】:Value of property QueueConfigurations must be of type List属性 QueueConfigurations 的值必须是 List 类型
【发布时间】:2020-11-04 06:09:37
【问题描述】:

我正在尝试为我的 S3 存储桶编写 SQS 触发器。我遇到了一个错误,提示“属性 QueueConfigurations 的值必须是 List 类型。”我的缩进/格式有问题吗?还是内容错误?我最近不得不将它从 YAML 转录为 JSON,我真的可以用第二双眼睛来解决这个问题。请记住,下面的代码块如此缩进的原因是因为我有一些不应该发布的敏感信息。提前致谢!

          "NotificationConfiguration" : {
              "QueueConfigurations" : {
                "Id" : "1",
                "Event" : "s3:ObjectCreated:*",
                "Filter" : { 
                  "S3Key" : {
                    "Rules" : {
                      "Name" : "prefix",
                      "Value" : "prod_hvr/cdc/"
                    }
                  }
                },
                "Queue" : "arn:aws:sqs:us-east-1:958262988361:interstate-cdc_feeder_prod_hvr_dev"
              },   
              "QueueConfigurations" : {
                "Id" : "2",
                "Event" : "s3:ObjectCreated:*",
                "Filter" : { 
                  "S3Key" : {
                    "Rules" : {
                      "Name" : "prefix",
                      "Value" : "prod_hvr/latency/"
                    }
                  }
                },
                "Queue" : "arn:aws:sqs:us-east-1:958262988361:interstate-latency_hvr_dev"
              }
            }   

【问题讨论】:

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


    【解决方案1】:

    应该如下所示。根据docs,“Id”不是有效属性。

    {
      "NotificationConfiguration": {
        "QueueConfigurations": [
          {
            "Event": "s3:ObjectCreated:*",
            "Filter": {
              "S3Key": {
                "Rules": {
                  "Name": "prefix",
                  "Value": "prod_hvr/cdc/"
                }
              }
            },
            "Queue": "arn:aws:sqs:us-east-1:958262988361:interstate-cdc_feeder_prod_hvr_dev"
          },
          {
            "Event": "s3:ObjectCreated:*",
            "Filter": {
              "S3Key": {
                "Rules": {
                  "Name": "prefix",
                  "Value": "prod_hvr/latency/"
                }
              }
            },
            "Queue": "arn:aws:sqs:us-east-1:958262988361:interstate-latency_hvr_dev"
          }
        ]
      }
    }
    

    【讨论】:

    • 谢谢你,@sayboras!这真的很有帮助!
    猜你喜欢
    • 2019-04-22
    • 2020-09-24
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-11
    • 1970-01-01
    • 2020-07-23
    相关资源
    最近更新 更多