cdk-eks-blueprints icon indicating copy to clipboard operation
cdk-eks-blueprints copied to clipboard

EKS-Blueprint as Service Catalog Product

Open thpham opened this issue 1 year ago • 9 comments

Describe the feature

I'm investigating how to use this cdk-eks-blueprints stack builder with AWS Service Catalog.

Use Case

Allow my organization to provision on-demand EKS product from a catalog portfolio, based on a standardized EKS blueprint.

Proposed Solution

No response

Other Information

Any example or hints would be very much appreciated !

Acknowledgements

  • [ ] I may be able to implement this feature request

CDK version used

2.133

EKS Blueprints Version

1.14.1

Node.js Version

v20.12.0

Environment details (OS name and version, etc.)

macos 14.4.1

thpham avatar Apr 06 '24 07:04 thpham

Hello @elamaran11 or @shapirov103 ! Any hints how to resolve or implement the feature request based on current status ? I might be able to help given your recommendations !

I'm checking internally with my company if I can share access to the code of my PoC to highlight a bit more the challenge I'm facing.

But roughly, I'm able to use the synthesized stack to deploy an EKS cluster, as normal. But I'm not able to used the synthesized deployment assets to be associated with a service catalog product. So that it could be used later on to provision the product from the portfolio.

image

thpham avatar Apr 08 '24 22:04 thpham

btw, an other challenge I'm facing is the various orphan left over resources when I'm destroying this EKS cloudformation stack (.ie ACK created resources, alb/nlb+their security groups, volumes...) => which makes the cdk destroy fails and requires manual cleanup. Any hints how to have potential custom cdk destroy hooks instruction (through a lambda?) to remove them as well ?

thpham avatar Apr 08 '24 22:04 thpham

@thpham we can potentially look into creating service catalog product/portfolio automatically from CDK. E.g. https://catalog.us-east-1.prod.workshops.aws/workshops/d40750d7-a330-49be-9945-cde864610de9/en-US/4-builders-devs/sc-cdk

shapirov103 avatar Apr 08 '24 22:04 shapirov103

Thank you. I already reached that point and tried the integration with a service catalog product. Sorry, I'm pretty new with CDK, my interpretation might be stupid, but as far I understood, the blueprints.EksBlueprint.builder()...build(...) creates a CFN stack, instead, with another function, would it be possible to just return an higher order Construct to be instantiated then in a extended ProductStack class ?

thpham avatar Apr 08 '24 23:04 thpham

would it be possible to just return an higher order Construct to be instantiated then in a extended ProductStack class ?

Yes,it is possible and requires refactoring of the existing codebase. That means

  1. Moving existing functionality of the EKSBlueprint stack to a common class (generic).
  2. Existing EKSBlueprint class extends the new common class.
  3. We create a new EKSBlueprintProduct class that extends ProductStack.
  4. We create a builder or add a function to the existing builder like buildProductStack that returns the product stack.

Probably easier said than done. I can take a stab on a branch and we can use it as a feature dev branch.

shapirov103 avatar Apr 08 '24 23:04 shapirov103

Probably easier said than done. I can take a stab on a branch and we can use it as a feature dev branch.

OK, that would be very much appreciated, even a small draft with the classes, and then I could try to integrate, continue further and test.

thpham avatar Apr 09 '24 11:04 thpham

I made good progress, but I had to re-implement the eks-blueprint-stack.ts like this: https://gist.github.com/thpham/49fbc437f3e08de6702acf473320ef00

thpham avatar Jun 03 '24 17:06 thpham

The following PR #1018 has introduced the possibility to used with ProducStack

thpham avatar Jun 27 '24 11:06 thpham

@thpham we had a similar request internally, hence introduced a construct, however adding the ProductStack support directly into the blueprint is still beneficial. We have the main stack with EKSBlueprint, we can introduce one for the product stack. I am interested in implementation of parameterization - I suppose customers will want to pass certain things as CFN params when launching the service catalog product.

shapirov103 avatar Jun 27 '24 14:06 shapirov103