【问题标题】:Property 'Queue' cannot be empty属性“队列”不能为空
【发布时间】:2020-10-29 10:22:30
【问题描述】:

这是我的第一篇 StackOverflow 帖子,如果格式不好,请见谅。

我真的可以在我的 CloudFormation 模板上使用第二双眼睛。我目前正在尝试连接 SQS 以在我的 S3 存储桶中创建任何对象时发出警报。我不断收到错误Property Queue cannot be empty,(即使不是)。我尝试将 ARN 放在单引号、双引号、无引号中,但没有任何效果。我最近尝试为它创建一个 QueuePolicy,但这只会让它变得更糟......

  rS3SqsTriggerDummy:
    DependsOn: rS3SqsTriggerPolicyQA
    Type: AWS::S3::Bucket
    Properties:
      BucketName: !Sub
          - "${bucketName}"
          - { bucketName: !FindInMap [Stage, !Ref StageName, bucketName]}
      NotificationConfiguration:
          QueueConfigurations:
          - Event: 's3:ObjectCreated:*'
          - Filter: 
                S3Key:
                  Rules:
                      Name: prefix
                      Value: 'dummy/'
            Queue: arn:aws:sqs:us-east-1:958262988361:interstate-claire-dummy-trigger-qa

如果有人可以看看并给我一些反馈,我将永远感激不尽!提前致谢。

【问题讨论】:

标签: amazon-web-services amazon-s3 yaml amazon-cloudformation amazon-sqs


【解决方案1】:

AWS::S3::Bucket QueueConfiguration 的形式为:

  QueueConfigurations: 
    - QueueConfiguration

这意味着QueueConfigurationsQueueConfiguration列表,其中QueueConfiguration 是带有EventFilterQueue对象特性。因此QueueConfigurations 应该是(注意只有一个-):

  NotificationConfiguration:
          QueueConfigurations:
            - Event: 's3:ObjectCreated:*'
              Filter: 
                S3Key:
                  Rules:
                    - Name: prefix
                      Value: 'dummy/'
              Queue: arn:aws:sqs:us-east-1:958262988361:interstate-claire-dummy-trigger-qa

请注意缩进。从 SO 复制和粘贴可能需要重新格式化。

【讨论】:

  • 谢谢!我再次运行它,现在我遇到了一个新错误,Value of property Rules must be of type List。这是否意味着我在Name 之前也需要-
  • @ClaireLe 嗨。是的。我更新了答案以添加缺少的- :-)
猜你喜欢
  • 2020-11-24
  • 1970-01-01
  • 2017-04-10
  • 1970-01-01
  • 2012-05-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多