简体   繁体   中英

SQS policy failed to create via cloud formation

creating SQS policy: its giving me error Resource handler returned message: "Invalid value for the parameter Policy. (Service: Sqs, Status Code: 400, Request ID: 5d7ffb34-bd69-5409-aec7-a1809c4f6aeb, Extended Request ID: null)" (RequestToken: 0f7979cf-6aae-a59b-e687-99ba47279537, HandlerErrorCode: GeneralServiceException)

Not sure what is wrong here, I have referred this Stackoverflow

SQSQueuePolicy:
   Type: AWS::SQS::QueuePolicy
   Properties:
     PolicyDocument:
      Version: '2008-10-17'
      Id: '__default_policy_ID'
      Statement:
      - Sid: '__owner_statement'
        Effect: Allow
        Principal:
          AWS: 'arn:aws:iam::${AWS::AccountId}:root'
        Action: 'SQS:*'
        Resource: !GetAtt test12StandardQueue.Arn
      - Sid: 'Allow-SNS-SendMessage'
        Effect: Allow
        Principal: '*'
        Action: SQS:SendMessage
        Resource: !GetAtt test12StandardQueue.Arn
        Condition:
         ArnLike:
          aws:SourceArn: !Ref SNSTopicARN
     Queues:
        - !Ref test12StandardQueue
  1. I have tried instead of Version: '2008-10-17' or '2012-10-17' but same error

Instead of

   AWS: 'arn:aws:iam::${AWS::AccountId}:root'

it should be:

   AWS: !Sub 'arn:aws:iam::${AWS::AccountId}:root'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM