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!: make GuDistributionBucketParameter a singleton #341

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

akash1810
Copy link
Member

What does this change?

Following #337 and part of a bigger bit of work in #332, this makes GuDistributionBucketParameter a singleton as we only ever want one of them in a stack.

BREAKING CHANGE:

  • The removal of the static parameterName field means GuDistributionBucketParameter.parameterName becomes GuDistributionBucketParameter.getInstance(stack).id

Does this change require changes to existing projects or CDK CLI?

Yes. The Prism stack will need to be updated to the new format.

How to test

See existing tests?

How can we measure success?

A much simpler API and ground work for supporting multiple apps (for example a backend api and frontend web app microservice) within a single stack.

Have we considered potential risks?

n/a

@akash1810 akash1810 requested a review from a team March 19, 2021 17:59
@akash1810 akash1810 merged commit 1260ce2 into main Mar 24, 2021
@akash1810 akash1810 deleted the aa-dist-bucket-singleton branch March 24, 2021 10:31
@github-actions
Copy link
Contributor

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

akash1810 added a commit that referenced this pull request Mar 24, 2021
A `GuInstanceRole` provides the basic permissions needed by EC2, it grants access to:
* SSM
* Describing tags
* Writing to kinesis for log shipping

#326 started the work to support the declaration of multiple apps in a stack, where an app is a collection of ASG, LB etc. However, when actually attempting to use the updated constructs in reality, the synth step failed due to multiple constructs using the same ID.

This change follows #341 and #337 and converts `GuSSMRunCommandPolicy` and `GuDescribeEC2Policy` to singletons. This means these policies will only get created once regardless of how many roles use them - there will be one policy with multiple roles attached to it. This helps keep the stack DRY and also reduces the chance of reaching the max file size limits of cloudformation.

The commits have been crafted to be standalone, reviewing them one by one might make the overall review easier.

Requires #341.

BREAKING CHANGE:
* `GuSSMRunCommandPolicy` and `GuDescribeEC2Policy` can no longer be directly instantiated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants