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(servicecatalogappregistry): application-associator L2 Construct #22024

Merged
merged 5 commits into from
Sep 30, 2022

Conversation

rohitagg0807
Copy link
Contributor

@rohitagg0807 rohitagg0807 commented Sep 13, 2022

new application-associator L2 Construct : This construct is responsible for following:

  • Create a new AppRegistry Application
  • Associate all stacks inside a cdk app scope
  • share an app registry application upon determining cross account stack. [ This only works for non environment agnostic stack]

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

Co-authored by: Santanu Ghosh

…ssociate allStacks inside a cdk App via new construct Automatic Application.
@gitpod-io
Copy link

gitpod-io bot commented Sep 13, 2022

@aws-cdk-automation aws-cdk-automation requested a review from a team September 13, 2022 20:53
@github-actions github-actions bot added the p2 label Sep 13, 2022
};

const app = new App();
const autoApp = new appreg.AutomaticApplication(app, 'AutoApplication', {
Copy link
Contributor

Choose a reason for hiding this comment

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

Per what I see in the code, AutomaticApplication is a Construct. Construct's scope should be a Stack, not App. I think it makes more sense to have AppRegistry application to be part of the component's toolchain. The toolchain contains anything related to software development life cycle of the component. Some examples: 1/ pull request validation in trunk-based development model 2/ tenant provisioning logical unit in multi-tenant SaaS applications using silo deployment model. Here is an example of a toolchain containing continuous deployment and pull request validation logical units: https://github.com/alexpulver/usermanagement-backend/blob/main/toolchain.py

Copy link
Contributor

Choose a reason for hiding this comment

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

An approach similar to this AWS AppConfig blog post which is aligned with AWS mutli-account recommendations.

Copy link
Contributor

Choose a reason for hiding this comment

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

Construct's scope should be a Stack, not App.

I don't agree with this necessarily. A construct's scope can be any other construct, including an App. Yes, CFN resources ultimately need to be created in the (transitive) scope of a Stack, but this thing can be an exception.

Having said that, I think you actually mean something else. I think you mean something along the lines of:

In the case of a Pipeline deployment, the Application should be created in the scope of the Pipeline Stack/Toolchain stack, not at the top level.

I tend to agree that's what most people would probably want. But wouldn't that just mean you don't use AutomaticApplication, but use a plain old Application instead?

const autoApp = new appreg.AutomaticApplication(app, 'AutoApplication', {
applicationName: 'MyAutoApplication',
description: 'Testing auto application',
const registeredApp = new appreg.RegisterApplication(app, 'RegisterApplication', {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, I am sure the team thought deeply about a name of this class. Still, I think having a class name expressing an action instead of an object looks unintuitive. Perhaps that should be a factory method on the application class? Something like appreg.Application.registerStacks(app)?

Related topics in AWS Construct Library Design Guidelines:

  • Construct class - "The name of resource constructs must be identical to the name of the resource in the AWS API, which should be consistent with the resource name in the AWS CloudFormation spec"
  • Factories

P.S.: Another reference can be cdk-nag project.

@rix0rrr rix0rrr self-assigned this Sep 28, 2022
};

const app = new App();
const registeredApp = new appreg.RegisterApplication(app, 'RegisterApplication', {
Copy link
Contributor

@rix0rrr rix0rrr Sep 28, 2022

Choose a reason for hiding this comment

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

I also don't particularly like this new name. It should be a noun.

ApplicationRegisterer then, if you want to use that word. Though I kinda don't like that either.

Copy link
Contributor

Choose a reason for hiding this comment

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

RegistryApplication ?

@mergify mergify bot dismissed rix0rrr’s stale review September 29, 2022 16:30

Pull request has been modified.

@rohitagg0807 rohitagg0807 changed the title feat(servicecatalogappregistry): automatic-application L2 Construct feat(servicecatalogappregistry): application-associator L2 Construct Sep 29, 2022
@rix0rrr
Copy link
Contributor

rix0rrr commented Sep 30, 2022

I will merge it to get the testing going. This is going into an alpha module so we can still change the API.

Before we stabilize I would like to see the pipeline usage validated with users.

@mergify
Copy link
Contributor

mergify bot commented Sep 30, 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).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 2d89062
  • 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 a2b7a46 into aws:main Sep 30, 2022
@mergify
Copy link
Contributor

mergify bot commented Sep 30, 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).

arewa pushed a commit to arewa/aws-cdk that referenced this pull request Oct 8, 2022
…ws#22024)

new application-associator L2 Construct : This construct is responsible for following:

* Create a new AppRegistry Application
* Associate all stacks inside a cdk app scope
* share an app registry application upon determining cross account stack. [ This only works for non environment agnostic stack]

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] 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*

Co-authored by: Santanu Ghosh
homakk pushed a commit to homakk/aws-cdk that referenced this pull request Dec 1, 2022
…ws#22024)

new application-associator L2 Construct : This construct is responsible for following:

* Create a new AppRegistry Application
* Associate all stacks inside a cdk app scope
* share an app registry application upon determining cross account stack. [ This only works for non environment agnostic stack]

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] 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*

Co-authored by: Santanu Ghosh
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.

4 participants