属性QueueConfigurations的值必须为List类型

时间:2020-07-14 19:57:08

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

我正在尝试为我的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"
              }
            }   

1 个答案:

答案 0 :(得分: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"
      }
    ]
  }
}