Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS policy application failure for a topic with strange error

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "SNS:Subscribe",
      "Resource": "arn:aws:sns:*:*:test-pipeline"
    },
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "SNS:Publish",
      "Resource": "arn:aws:sns:*:*:test-pipeline"
    }
  ]
}

I am not sure why I get the error as

Error code: InvalidParameter - Error message: An error occurred while setting the attribute access policy. Invalid parameter: Every policy statement must have a unique ID

The ID is not mandatory, and when I have only one block in the array, it just works

like image 524
curiousengineer Avatar asked Nov 15 '25 07:11

curiousengineer


1 Answers

Its optional, but not for every service, such as SNS. From docs:

Some AWS services (for example, Amazon SQS or Amazon SNS) might require this element and have uniqueness requirements for it.

like image 111
Marcin Avatar answered Nov 17 '25 22:11

Marcin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!