通过云形成创建 SQS 策略失败

SQS policy failed to create via cloud formation

创建 SQS 策略:它给我错误资源处理程序返回消息:“参数策略的值无效。(服务:Sqs,状态代码:400,请求 ID:5d7ffb34-bd69-5409-aec7-a1809c4f6aeb,扩展请求 ID:null)”(RequestToken:0f7979cf-6aae-a59b-e687-99ba47279537,HandlerErrorCode:GeneralServiceException)

不确定这里有什么问题,我已经提到了这个 Whosebug

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. 我试过版本:'2008-10-17' 或 '2012-10-17' 但同样的错误

而不是

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

应该是:

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