当我提供 QueueName 时,AWS Cloudformation 失败

发布于 2025-01-19 18:08:54 字数 1044 浏览 0 评论 0原文

我有时在 AWS 中的 Cloudformation 中观察到这种行为。

Description: Something here....
Parameters:
  StackName:
    Description: reference the StackName
    Type: String

  StageName:
    Description: reference the environment type (local, alpha, beta, uat, prod)
    Type: String

Resources:
  FileGenerationDLQ:
    Type: AWS::SQS::Queue
    Properties:
      QueueName: !Sub "${StackName}-FileGenerationDLQ-${StageName}"
      MessageRetentionPeriod: 1209600
      ReceiveMessageWaitTimeSeconds: 20
      VisibilityTimeout: 925

  FileGenerationQueue:
    DependsOn: FileGenerationDLQ
    Type: AWS::SQS::Queue
    Properties:
      QueueName: !Sub "${StackName}-FileGeneration-${StageName}"
      MessageRetentionPeriod: 1209600
      ReceiveMessageWaitTimeSeconds: 0
      VisibilityTimeout: 925
      RedrivePolicy:
        deadLetterTargetArn: !GetAtt FileGenerationDLQ.Arn
        maxReceiveCount: 1

以上失败。但是,如果我评论 QueueName 它就会起作用。

当然,模板中还有其他内容,但出于隐私考虑,我省略了它们。 谁能指出我的医生为什么会发生这种情况?这与 Cloudformation 模板版本有关系吗?

There is this behaviour I have observed sometimes with Cloudformation in AWS.

Description: Something here....
Parameters:
  StackName:
    Description: reference the StackName
    Type: String

  StageName:
    Description: reference the environment type (local, alpha, beta, uat, prod)
    Type: String

Resources:
  FileGenerationDLQ:
    Type: AWS::SQS::Queue
    Properties:
      QueueName: !Sub "${StackName}-FileGenerationDLQ-${StageName}"
      MessageRetentionPeriod: 1209600
      ReceiveMessageWaitTimeSeconds: 20
      VisibilityTimeout: 925

  FileGenerationQueue:
    DependsOn: FileGenerationDLQ
    Type: AWS::SQS::Queue
    Properties:
      QueueName: !Sub "${StackName}-FileGeneration-${StageName}"
      MessageRetentionPeriod: 1209600
      ReceiveMessageWaitTimeSeconds: 0
      VisibilityTimeout: 925
      RedrivePolicy:
        deadLetterTargetArn: !GetAtt FileGenerationDLQ.Arn
        maxReceiveCount: 1

The above fails. However, if I comment the QueueName it works.

Ofcourse I have other things in the template but I have omitted them for privacy.
Could anyone point me to the doc why this is happening? Does this have something to do with the Cloudformation template versions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文