1

我正在尝试使用 cloudformation 创建一个 SQS 队列及其关联的访问策略。尝试了几次迭代,但它一直给我这个错误:

属性队列的值必须是字符串列表类型

下面是我的模板。谁能帮我指出这个问题:

    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
4

1 回答 1

1

队列应该是List of String. 这意味着,而不是:

Queues: !Ref SQSQueue

你应该有:

Queues: 
    - !Ref SQSQueue

或更短:

Queues: [!Ref SQSQueue]
于 2021-02-04T05:23:25.313 回答