Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQS: Resource dependencies are not circular #782

Open
alucard001 opened this issue Feb 24, 2023 · 0 comments
Open

SQS: Resource dependencies are not circular #782

alucard001 opened this issue Feb 24, 2023 · 0 comments

Comments

@alucard001
Copy link

I got the following error of circular reference when creating SQS.

[Resource dependencies are not circular] Circular Dependencies for resource SQSSendNotifications. Circular dependency with [SQSSendNotificationsDeadLetterQueue]
Resource dependencies are not circular] Circular Dependencies for resource SQSSendNotificationsDeadLetterQueue. Circular dependency with [SQSSendNotifications]

Here is my CloudFormation file for SQS:

Resources:
  SQSSendNotifications:
    Type: AWS::SQS::Queue
    Properties:
      DeduplicationScope: messageGroup
      FifoQueue: true
      FifoThroughputLimit: perMessageGroupId
      KmsDataKeyReusePeriodSeconds: 3600
      MessageRetentionPeriod: 300
      QueueName: sso-sendnotification.fifo

      RedriveAllowPolicy:
        Fn::ToJsonString:
          - redrivePermission: denyAll

      RedrivePolicy:
        Fn::ToJsonString:
          - deadLetterTargetArn: !GetAtt SQSSendNotificationsDeadLetterQueue.Arn
            maxReceiveCount: 3

      SqsManagedSseEnabled: true

  SQSSendNotificationsDeadLetterQueue:
    Type: AWS::SQS::Queue
    Properties:
      DeduplicationScope: messageGroup
      FifoQueue: true
      FifoThroughputLimit: perMessageGroupId
      KmsDataKeyReusePeriodSeconds: 86400
      MessageRetentionPeriod: 1209600
      QueueName: sso-sendnotification-dl.fifo
      RedriveAllowPolicy:
        Fn::ToJsonString:
          - redrivePermission: byQueue
            sourceQueueArns: !GetAtt SQSSendNotifications.Arn

I know that there is a clear "circular-reference" in the queue and DL-queue seciton. But here is what I want to ask: From the logic standpoint:

  • SQSSendNotifications "denyAll" queue from using this queue as DL
  • SQSSendNotifications will redirect all failed messages to SQSSendNotificationsDeadLetterQueue.Arn

While

  • SQSSendNotificationsDeadLetterQueue only accept (i.e. byQueue) this queue as source queue: SQSSendNotifications.Arn
  • There is no RedrivePolicy as this is a DL queue.

If the logic above is correct, why would there be a "circular reference" and throw error? These two different sections referring each other, which is normal and correct.

Can anyone please help explain it to me?

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant