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(servicecatalog): initial implementation of the Product construct #15185

Merged
merged 10 commits into from
Jun 28, 2021

Conversation

wanjacki
Copy link
Contributor

This is the first minimal release of an L2 construct for a service catalog product. In a future PR,
functionality to associate with a Portfolio and add constraints will be added.

Testing done

  • yarn build && yarn test
  • yarn integ

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

Co-authored-by: Aidan Crank arcrank@gmail.com
Co-authored-by: Dillon Ponzo dponzo18@gmail.com

This is the first minimal release of an L2 construct for a service catalog product. In a future PR,
functionality to associate with a Portfolio and add constraints will be added.
Testing done
------------------
* `yarn build && yarn test`
* `yarn integ`
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

Co-authored-by: Aidan Crank <arcrank@gmail.com>
Co-authored-by: Dillon Ponzo <dponzo18@gmail.com>
@gitpod-io
Copy link

gitpod-io bot commented Jun 17, 2021

@peterwoodworth peterwoodworth added the @aws-cdk/aws-servicecatalog Related to AWS Service Catalog label Jun 17, 2021
Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

Thanks for submitting @wanjacki!

Before I review, I have some questions about the provisioningArtifacts property.

Can you explain what is it used for? How do customers use the many versions of a given Product?

Also, I think we should discuss how is that CloudFormation template that is pointed to by the templateUrl supposed to be created. I think it will be a very interesting area of defining how a Product works in the CDK.

Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

In general, I'm not a huge fan of this PR as it stands today. The L2 that is presented here is basically identical to the CfnCloudFormationProduct class that is in the CDK today. We look to improve things in our L2 by raising the level of abstraction. This doesn't do that.

I think the key here will be templateUrl property of ProvisioningArtifactProperties. We need to think about how to model the CloudFormation template of a Product in the CDK.

I think step 1 is learning about the Asset concept in the CDK: https://docs.aws.amazon.com/cdk/latest/guide/assets.html. I would encourage you to take a look at how Lambda Code is modeled in the CDK (https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.Code.html), as it has a very similar challenge to what we're facing here.

Also, if you could reply to my question in #15185 (review), I would appreciate it!

Thanks for your contribution!
Adam

packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/package.json Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
@skinny85 skinny85 added effort/small Small work item – less than a day of effort p1 labels Jun 22, 2021
@mergify mergify bot dismissed skinny85’s stale review June 23, 2021 18:42

Pull request has been modified.

Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

Looks great! I love the Asset-based template.

A few minor comments before we merge this in.

packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/template.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/template.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/template.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/template.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
@mergify mergify bot dismissed skinny85’s stale review June 24, 2021 22:36

Pull request has been modified.

@pgarbe
Copy link
Contributor

pgarbe commented Jun 25, 2021

Would love to see support for AssetTemplate.fromStack(myStack). But it's tricky as described in #11896

@skinny85
Copy link
Contributor

Would love to see support for AssetTemplate.fromStack(myStack). But it's tricky as described in #11896

We'll get there, don't worry 😉. We actually have a plan on how to make it even better than that issue talks about!

That will be a separate PR though 🙂.

@wanjacki
Copy link
Contributor Author

@skinny85 Hey Adam, I addressed all the comments, please let me know if there's anything that needs to be changed.

@skinny85
Copy link
Contributor

@skinny85 Hey Adam, I addressed all the comments, please let me know if there's anything that needs to be changed.

Apologies for missing this. Will do. In the future, if you re-request my revision after pushing your changes (there's a button in the top-right of the PR page, next to my avatar), there's a smaller chance this will slip through the cracks.

Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

Looks great @wanjacki! A few last polishes, and this will be ready to be merged in.

packages/@aws-cdk/aws-servicecatalog/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/template.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/template.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/template.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
@mergify mergify bot dismissed skinny85’s stale review June 28, 2021 19:13

Pull request has been modified.

@wanjacki wanjacki requested a review from skinny85 June 28, 2021 19:13
Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

We're almost there! One tiny comment about naming.

packages/@aws-cdk/aws-servicecatalog/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/lib/product.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-servicecatalog/test/integ.product.ts Outdated Show resolved Hide resolved
@wanjacki wanjacki requested a review from skinny85 June 28, 2021 20:42
@mergify mergify bot dismissed skinny85’s stale review June 28, 2021 20:42

Pull request has been modified.

Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

One last thing!

/**
* Properties of product version (also known as a provisioning artifact).
*/
export interface ProductVersions {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I think there's been some misunderstanding.

The name of this interface should be CloudFormationProductVersion.

The name of the property is a different discussion.

Copy link
Contributor Author

@wanjacki wanjacki Jun 28, 2021

Choose a reason for hiding this comment

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

ok I think i fixed it Adam, is this what you mean?

readonly productVersions: CloudFormationProductVersion[];

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes.

@mergify mergify bot dismissed skinny85’s stale review June 28, 2021 21:02

Pull request has been modified.

Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

Thanks for the patience and incorporating all of my comments @wanjacki - this is great!

@mergify
Copy link
Contributor

mergify bot commented Jun 28, 2021

Thank you for contributing! Your pull request will be updated from master 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: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 4510222
  • 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 fe3e0f2 into aws:master Jun 28, 2021
@mergify
Copy link
Contributor

mergify bot commented Jun 28, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
…aws#15185)

This is the first minimal release of an L2 construct for a service catalog product. In a future PR,
functionality to associate with a Portfolio and add constraints will be added.

Testing done
------------------
* `yarn build && yarn test`
* `yarn integ`
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

Co-authored-by: Aidan Crank <arcrank@gmail.com>
Co-authored-by: Dillon Ponzo <dponzo18@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-servicecatalog Related to AWS Service Catalog effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants