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

feat(sns): topic name with .fifo suffix generated automatically #22375

Merged
merged 4 commits into from
Oct 11, 2022
Merged

feat(sns): topic name with .fifo suffix generated automatically #22375

merged 4 commits into from
Oct 11, 2022

Conversation

dreamorosi
Copy link
Contributor

@dreamorosi dreamorosi commented Oct 5, 2022

This PR adds logic for automatic generation of FIFO topics.

When customers don't pass a topicName during creation, the construct now generates an unique name that respects the maximum length allowed by the CloudFormation resource (256) and that ends with the .fifo suffix.

The previous behavior was to throw an error when the topic was of type FIFO and no name was passed.

Fixes ##18740


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Sorry, something went wrong.

@gitpod-io
Copy link

gitpod-io bot commented Oct 5, 2022

@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Oct 5, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team October 5, 2022 21:45
@github-actions github-actions bot added the p2 label Oct 5, 2022
@dreamorosi dreamorosi changed the title (sns): added suffix generation for FIFO topics feat(sns): adds suffix generation for FIFO topics Oct 5, 2022
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

@dreamorosi dreamorosi changed the title feat(sns): adds suffix generation for FIFO topics feat(sns): topic name with .fifo suffix generated automatically Oct 5, 2022
@dreamorosi
Copy link
Contributor Author

The pull request linter fails with the following errors:

❌ Features must contain a change to a README file.

PRs must pass status checks before we can provide a meaningful review.

In this specific case the PR addresses an implementation detail inside the construct which in turns compensates a roadmap item from CloudFormation.

I'm not sure it needs a README change, if it does I'd appreciate some guidance as for where/what to change.

Copy link
Contributor

@corymhall corymhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it needs a README change, if it does I'd appreciate some guidance as for where/what to change.

Can you update the section of the readme that talks about fifo topics? Update the example to not pass a name and note that one will be generated for you.

Add a FIFO SNS topic with content-based de-duplication to your stack:
```ts
const topic = new sns.Topic(this, 'Topic', {
contentBasedDeduplication: true,
displayName: 'Customer subscription topic',
fifo: true,
topicName: 'customerTopic',
});
```
Note that FIFO topics require a topic name to be provided. The required `.fifo` suffix will be automatically added to the topic name if it is not explicitly provided.

@dreamorosi dreamorosi requested a review from corymhall October 10, 2022 21:33
@aws-cdk-automation aws-cdk-automation dismissed their stale review October 10, 2022 21:34

✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.

@dreamorosi
Copy link
Contributor Author

Can you update the section of the readme that talks about fifo topics? Update the example to not pass a name and note that one will be generated for you.

Done in the latest commit

@dreamorosi dreamorosi requested review from aws-cdk-automation and corymhall and removed request for corymhall and aws-cdk-automation October 10, 2022 22:38
Copy link
Contributor

@corymhall corymhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dreamorosi!

@mergify
Copy link
Contributor

mergify bot commented Oct 11, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 81b0eb4
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit ba201cf into aws:main Oct 11, 2022
@mergify
Copy link
Contributor

mergify bot commented Oct 11, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@dreamorosi dreamorosi deleted the feat/sns/fifo_suffix branch October 11, 2022 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants