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): modify application manager url to string #24209

Closed
wants to merge 2 commits into from

Conversation

zorrofox
Copy link
Contributor

@zorrofox zorrofox commented Feb 17, 2023

Done

Closes #23779.


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

@gitpod-io
Copy link

gitpod-io bot commented Feb 17, 2023

@aws-cdk-automation aws-cdk-automation requested a review from a team February 17, 2023 10:03
@github-actions github-actions bot added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK labels Feb 17, 2023
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 February 17, 2023 10:13

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

@zorrofox zorrofox marked this pull request as ready for review February 17, 2023 10:49
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Comment on lines -259 to +258
Name: 'RAMShare5bb637032063',
Name: 'RAMSharee6e0e560e6f8',
Copy link
Contributor

Choose a reason for hiding this comment

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

Why has this been changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know why the unique ID is changed in this unit test. And it seems all the unique IDs are changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is because the hash is calculated from the application object. If the application object structure changes, the hash will change.

Comment on lines -278 to +279
this.applicationManagerUrl = new cdk.CfnOutput(this, 'ApplicationManagerUrl', {
value: `https://${this.env.region}.console.aws.amazon.com/systems-manager/appmanager/application/AWS_AppRegistry_Application-${this.applicationName}`,
description: 'Application manager url for the application created.',
});
this.applicationManagerUrl =
`https://${this.env.region}.console.aws.amazon.com/systems-manager/appmanager/application/AWS_AppRegistry_Application-${this.applicationName}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

@santanugho what do you think of this change? Why did you originally propose this to be a CfnOutput?

Copy link
Contributor

@liwewang-amazon liwewang-amazon Mar 1, 2023

Choose a reason for hiding this comment

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

This defeats the purpose of providing easier access to the application URL when the application is created through TargetApplication.createApplicationStack. Since the application creation is implicit in TargetApplication constructs instead of new Application().

A new pull request #24386 was create to expose this URL as CFN output on the stack defined by TargetApplication.createApplicationStack construct, where the application is created later for stack/stage association. That got closed as duplicate.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like this original design choice was not really the right choice here. Sure, it's easier for certain use cases to make this a CfnOutput, but it seems that there are use cases to do otherwise as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

TargetApplication & ApplicationAssociator are intended to be included into default cdk template through cdk init, therefore all the cdk users can easily use the feature: all the stacks deployed by the cdk package can be contained in one application .

TargetApplication.createApplicationStack creates a new stack, defined by aws-servicecatalogappregistry, in customers account where an application is created.

For the customers who are onboard with ApplicationAssociator construct, the service team wants to provide an easier console access to the application created implicitly through TargetApplication.createApplicationStack. Therefore customers can view the application and its associated stacks without further cdk code change. Therefore the service team chose to expose the URL as CFN output in the stack, so that the console access to the application can be easily obtained. Since the CFN output stays in the stack fully managed by the aws-servicecatalogappregistry constructs, it was considered to be minimal customer impacting.

Is there any other suggestion to expose the URL while having minimal customer intervention?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a middle ground we can take:

  • Make Application construct having applicationManagerUrl as string type so that customers can use it to create CFN Output as needed.
  • In TargetApplication construct, createApplicationStack will use applicationManagerUrl property to create the CFN Output in the Stack created by the CDK construct.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any other suggestion to expose the URL while having minimal customer intervention?

You can always make a boolean option: emitConsoleUrlAsOutput?: boolean.

Copy link
Contributor

@rix0rrr rix0rrr Mar 3, 2023

Choose a reason for hiding this comment

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

Your proposal seems like a good middle ground.

But you will always have to contend with customer opinion, which means making it configurable. I don't mind the default being true, as long as it can be switched off for those who care.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for your comments, new PR is published: #24483

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

public readonly applicationManagerUrl?: cdk.CfnOutput;
public readonly applicationManagerUrl?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is good, should have always been the case.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

4 similar comments
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@TheRealAmazonKendra
Copy link
Contributor

Looks like this update has now been made in a separate PR. Closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. 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.

servicecatalogappregistry: Application Manager URL as string property
6 participants