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

fix(servicecatalogappregistry): applicationName can not be changed after deployment #24409

Merged
merged 8 commits into from
Mar 2, 2023

Conversation

santanugho
Copy link
Contributor

Background:

  • Customers wish to control or modify the stack id of the Application stack to follow their project conventions within CDK.
  • In previous fix, we had deprecated the stack id to push users towards using stack name as the main mechanism for stack identification.
  • Default stack name as per this fix has Application Name embedded in it. If customers wants to update the application name, then a new stack name as well as new stack id will be generated, which will eventually create a new Application in a new stack.

Problem:

  • Application associator associates all stacks in scope to an application.
  • With ApplicationName in stack name, we will create an application within a stack. When customers attempt to update the name of the application, we will create a new stack and eventually create a new application, which is the first problem.
  • In this new application within the new stack, we will try to associate all stacks within the app scope, which is already associated to the original application in the original stack and hence cannot be further associated to the new application which will make the deployment of the stack with updated name fail.

Fix:

  • We will continue to honor customer provided stack Name.
  • If no stack name is provided, then we will default it to ApplicationAssociator-${hashValues(scope.node.addr)}-Stack, which doesnt contain Application Name.

Related Links:


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

@github-actions github-actions bot added p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK labels Mar 2, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team March 2, 2023 05:47
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.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@aws-cdk-automation aws-cdk-automation dismissed their stale review March 2, 2023 06:31

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

@rix0rrr rix0rrr changed the title fix(servicecatalogappregistry): Generate default stack name if not supplied by users fix(servicecatalogappregistry): applicationName can not be changed after deployment Mar 2, 2023
@mergify
Copy link
Contributor

mergify bot commented Mar 2, 2023

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).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: d0b14fa
  • 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 6aa763f into aws:main Mar 2, 2023
@mergify
Copy link
Contributor

mergify bot commented Mar 2, 2023

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).

homakk pushed a commit to homakk/aws-cdk that referenced this pull request Mar 28, 2023
…ter deployment (aws#24409)

Background:
* Customers wish to control or modify the stack id of the Application stack to follow their project conventions within CDK.
* In previous [fix](aws#24171), we had deprecated the stack id to push users towards using stack name as the main mechanism for stack identification.
* Default stack name as per this [fix](aws#24171) has `Application Name` embedded in it. If customers wants to **update the application name**, then a new stack name as well as new stack id will be generated, which will eventually create a new Application in a new stack.

Problem:
* Application associator associates all stacks in scope to an application.
* With `ApplicationName` in stack name, we will create an application within a stack. When customers attempt to update the name of the application, we will create a new stack and eventually create a new application, which is the first problem.
* In this new application within the new stack, we will try to associate all stacks within the `app` scope, which is already associated to the original application in the original stack and hence cannot be further associated to the new application which will make the deployment of the stack with updated name fail.

Fix:
* We will continue to honor customer provided stack Name.
* If no stack name is provided, then we will default it to `ApplicationAssociator-${hashValues(scope.node.addr)}-Stack`, which doesnt contain `Application Name`.

Related Links:
* Previous PR which introduced this bug: aws#24171

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants