Search code examples
jsonamazon-web-servicesamazon-s3aws-cloudformationamazon-sqs

Value of property QueueConfigurations must be of type List


I am trying to write SQS triggers for my S3 bucket. I am running into an error saying "Value of property QueueConfigurations must be of type List." Is there something wrong with my indentation/formatting? Or is it a content error? I recently had to transcribe this from YAML to JSON, and I could really use a second pair of eyes on this issue. Keep in mind that the reason the codeblock below is so indented is because I have some sensitive info I shouldn't post. Thanks in advance!

          "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"
              }
            }   


Solution

  • It should be something like below. And as per this docs, "Id" is not a valid attribute.

    {
      "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"
          }
        ]
      }
    }