简体   繁体   English

通过 Cloudformation 创建 SQS 队列及其访问策略时出错

[英]Error in creating SQS Queue and its access policy through Cloudformation

I am trying to create an SQS queue and its associated access policy using cloudformation.我正在尝试使用 cloudformation 创建一个 SQS 队列及其关联的访问策略。 Tried a few iterations but it keeps giving me this error:尝试了几次迭代,但它一直给我这个错误:

Value of property Queues must be of type List of String属性队列的值必须是字符串列表类型

Below is my template.下面是我的模板。 Can anyone help me point the issue in this:谁能帮我指出这个问题:

    SQSQueue:
        Type: "AWS::SQS::Queue"
        Properties:
            DelaySeconds: "0"
            MaximumMessageSize: "262144"
            MessageRetentionPeriod: "10800"
            ReceiveMessageWaitTimeSeconds: "0"
            VisibilityTimeout: "30"
            QueueName: "ScanQueueItems"

    DocSQSSNSPolicy:
        Type: AWS::SQS::QueuePolicy
        Properties:
            PolicyDocument:
                Id: MessageToSQSPolicy
                Statement:
                    Effect: Allow
                    Principal: "*"
                    Action:
                        - SQS:SendMessage
                    Resource: !GetAtt SQSQueue.Arn  
            Queues: !Ref SQSQueue

Queues should be List of String . 队列应该是List of String This means that instead of:这意味着,而不是:

Queues: !Ref SQSQueue

you should have:你应该有:

Queues: 
    - !Ref SQSQueue

or shorter:或更短:

Queues: [!Ref SQSQueue]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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