CloudFormation Nonsense: Seven (7) SNS Subscriptions created for SQS Queues by a Template

0

Greetings!,

I have a nonsense CloudFormation behaviour, the problem is in the section where i create an SNS Topic and two SQS Queues in a typical Fan-out pattern:

Resources:
  ForwardMessageQueue:
    Type: AWS::SQS::Queue
    Properties:
      QueueName: !Sub 'ForwardMessageQueue${EnvironmentPrm}'
      Tags:
        - Key: 'Environment'
          Value: !Ref EnvironmentPrm
  AuditMessageQueue:
    Type: AWS::SQS::Queue
    Properties:
      QueueName: !Sub 'AuditMessageQueue${EnvironmentPrm}'
      Tags:
        - Key: 'Environment'
          Value: !Ref EnvironmentPrm

  CallbackNotificationTopic:
    Type: AWS::SNS::Topic
    Properties:
      TopicName: !Sub 'CallbackNotificationTopic${EnvironmentPrm}'
      Subscription:
        - Endpoint: !GetAtt ForwardMessageQueue.Arn
          Protocol: "sqs"
        - Endpoint: !GetAtt AuditMessageQueue.Arn
          Protocol: "sqs"
      Tags:
        - Key: 'Environment'
          Value: !Ref EnvironmentPrm

The template executes successfully and the solution once deployed, does what it has todo. The problem is when I checkout the configuration of the Queues through the AWS Web Console, I find seven SNS Subscriptions like:

Subscription ARNTopic ARN
arn:aws:sns:us-east-1:012345678901:CallbackNotificationTopicDev:cef23e99-12c6-4120-9219-bb4b7ac05ef4arn:aws:sns:us-east-1:012345678901:CallbackNotificationTopicDev
arn:aws:sns:us-east-1:012345678901:CallbackNotificationTopicDev:afdfc906-5b0d-41f0-9185-572b51fecaf5arn:aws:sns:us-east-1:012345678901:CallbackNotificationTopicDev
arn:aws:sns:us-east-1:012345678901:CallbackNotificationTopicDev:ab1ebde3-91b9-4567-a2b4-9613afefbbd7arn:aws:sns:us-east-1:012345678901:CallbackNotificationTopicDev
arn:aws:sns:us-east-1:012345678901:CallbackNotificationTopicDev:930edf3c-ccb4-4184-b263-32ee64136387arn:aws:sns:us-east-1:012345678901:CallbackNotificationTopicDev

... and other 3 rows more, seven rows in total.

Any idea of the cause of this misbehavior? Thanks in advanced!.

  • Today I created a very simple CloudFormation template just for the fan-out pattern (identical to the previous one, I just changed the logical names of the SNS Topic and SQS Queues), the result was as expected: one SNS subscription for every Queue. Exactly the same code in the real solution's template create seven SNS Topic subscriptions per SQS Queue, weird...

1개 답변
0

I launched your template (copied from your post) and couldn't reproduce the issue I'm afraid. If you are on an AWS support plan (i.e. Developer or higher) I'd suggest opening a support ticket as the support team can then investigate internally to see what the services are doing.

profile pictureAWS
전문가
James_S
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠