CloudFormation在AWS::SQS::Queue与RedriveAllowPolicy属性结合使用时出现问题

0

【以下的问题经过翻译处理】 我们在CloudFormation中为AWS::SQS::Queue指定了RedriveAllowPolicy,并且再次在CloudFormation中收到错误,尽管我们没有对模板进行任何更改。

这种情况在几周前也发生过,所以这是我们看到的此属性的第二次变化。

因此,我们修改了我们的模板定义为:

TestQueue:
    Type: AWS::SQS::Queue
    Properties:
      VisibilityTimeout: 450
      RedriveAllowPolicy: '{"redrivePermission":"denyAll"}'
      RedrivePolicy:
        deadLetterTargetArn: !GetAtt TestDeadLetterQueue.Arn
        maxReceiveCount: 5

  TestDeadLetterQueue:
    Type: AWS::SQS::Queue
    Properties:
      MessageRetentionPeriod: 1209600

这个方法运行了几周,但现在 CloudFormation 在使用该模板时出现了以下错误:

2021-12-14 10:33:14 UTC+0100 TestQueue CREATE_FAILED

Properties validation failed for resource TestQueue with message: #: extraneous key [RedriveAllowPolicy] is not permitted

从模板中移除RedriveAllowPolicy: '{"redrivePermission":"denyAll"}'可以解决这个问题,但我们希望设置这个策略。

我希望我们准确地遵循 https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues.html#aws-sqs-queue-redriverallowpolicy 中的文档。

重现错误的完整模板文件:

AWSTemplateFormatVersion: '2010-09-09'
Description: A prototype stack to test out CloudFormation definitions.
Metadata: {}
Transform: AWS::Serverless-2016-10-31

Resources:

  TestQueue:
    Type: AWS::SQS::Queue
    Properties:
      VisibilityTimeout: 450
      RedriveAllowPolicy: '{"redrivePermission":"denyAll"}'
      RedrivePolicy:
        deadLetterTargetArn: !GetAtt TestDeadLetterQueue.Arn
        maxReceiveCount: 5

  TestDeadLetterQueue:
    Type: AWS::SQS::Queue
    Properties:
      MessageRetentionPeriod: 1209600
profile picture
专家
已提问 5 个月前27 查看次数
1 回答
0

【以下的回答经过翻译处理】 我已将提供的示例模板部署到 eu-central-1(欧洲-法兰克福)区域,栈和资源已成功部署到我的账户中。我为资源 AWS::SQS::Queue 使用了 RedriveAllowPolicy: '{"redrivePermission": "denyAll"}' 属性。

也许您可以再试一次,确认一下您的行为。否则,我建议打开一个支持案例,以便工程师排除故障并验证问题。

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容