mapbox / mapbox/cloudfriend

Modify Queue shortcut SNS behavior

Open
#125 4 comments 0 reactions 1 assignee View on GitHub

@rclark is already working on this.

Since Apr 12, 2021.

Dominant language
JavaScript
Stars
74
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Currently, the **Queue** shortcut will also create a SNS topic that the created queue is subscribed to, unless one of two conditions are met:
1. The queue is a FIFO queue
2. An `ExistingTopicArn` property is specified, in which case the queue will be subscribed to _that_ topic instead

There are two things that could be improved about this behavior:

1. In some cases you may not want to send messages via an intermediate SNS topic - it may be fine to just directly send messages to SQS. In that case, it might be nice to skip creation of the SNS topic. This is mostly to prevent unnecessary infrastructure from being created - there's really no cost benefit to this, as you're only charged for message processing with SNS.
2. With the recent addition of [SNS FIFO topics](https://aws.amazon.com/about-aws/whats-new/2020/10/amazon-sns-introduces-fifo-topics-with-strict-ordering-and-deduplication-of-messages/), you now _can_ subscribe a FIFO queue to an SNS topic, as long as it's a FIFO topic. I'm already aware of one internal use case where this'd be a nice feature to support.

What I'd propose is adding a new property `CreateSnsTopic` with a default value of `true` (to prevent a breaking change). If it was set to `false`, we'd skip creation of the SNS topic. Then instead of ignoring `TopicName` or `ExistingTopicArn` if `FifoQueue: true`, we should accept an existing topic ARN (and let CloudFormation validate that it's a FIFO topic), or create a FIFO Topic if it's not and `CreateSnsTopic` is not `false`.

## Priority
Not super high, as there are workarounds to both of these, and as I said, even if you don't use the Topic that's created, it doesn't really cost you anything.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.