-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(servicecatalogappregistry): default stack name is not meaningful and causes conflict when multiple stacks deployed to the same account-region #23823
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3ef244f
fix(servicecatalogappregistry): fix L2 ApplicationAssociator construc…
jungle-amazon c002d55
Fix trailing space and add integ test
jungle-amazon ac84048
Merge branch 'main' into l2_fixes
jungle-amazon bf41d5a
Keep ApplicationAssociatorStack as default stack id, but use app name…
jungle-amazon 3b8514c
Merge branch 'main' into l2_fixes
jungle-amazon aa800e5
Deprecate stackID and recommend `stackName` use in TargetApplication …
jungle-amazon d39f9bb
Removed the extra text from Deprecated tag
jungle-amazon 5e7f04b
Merge branch 'main' into l2_fixes
jungle-amazon e6fd324
Merge branch 'main' into l2_fixes
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After thinking about it a little, I think this is the wrong way to go about it. A
Stack
has two identifiers:id
, used as an ID in the construct tree (needs to be unique within the scope in the construct tree)stackName
, the name of the CloudFormation Stack being deployed (needs to be unique within the account+region it is deployed to, defaults toid
if not supplied).I think what is happening here is that you are trying to change
stackName
by changingid
, is that right?If that is the case, doesn't it make more sense to leave
id
where it is, and explicitly setstackName
to the value you're trying to achieve?Also,
CreateXxx
is not a great name for a resource (Create is a Verb, but a resource is a Noun). Maybe make it somethingApplication-MyGreatApplication-Stack
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are correct, we are trying to change
stackName
by changing theid
. Your proposed approach of setting thestackName
makes more sense and I have updated the commit with this change instead.I also updated the stackName format as per your suggestion.
For your first concern about "renaming" the stack, it is true that if the user wants to continue to rely on the default stack name and keep the same application name, the user will see a conflict because the new stack with the updated name will attempt to create an app that already exists.
I think a workaround for the user would be to specify the previous default stack name
ApplicationAssociatorStack
as astackName
option property to keep using the old stack name.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Sounds good.
The next question is: how will users that get affected by this know that they have to do that?
Here is my suggestion: they will probably read the change log and find this PR. Please edit the description of this PR and add a section that says "if you run into the following error (...error message here...) make sure to set stackName to the name of your stack. For example:
"
Something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes a lot of sense, I've added this section in the PR description.