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

aws-cdk-lib hardcoded to a specific version #944

Open
DeveloperC286 opened this issue Mar 8, 2024 · 8 comments
Open

aws-cdk-lib hardcoded to a specific version #944

DeveloperC286 opened this issue Mar 8, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@DeveloperC286
Copy link

Describe the bug

The version of the dependency aws-cdk-lib in cdk-eks-blueprints is hardcoded to a specific version. Therefore, if there is a mismatch with the version of aws-cdk-lib of your project you encounter a TypeScript complication error.

Expected Behavior

That I am able to upgrade the version of aws-cdk-lib in my package.json and I do not get a complication error.

Current Behavior

If I change aws-cdk-lib in my package.json to a version not matching what cdk-eks-blueprints wants I get a complication error.

Reproduction Steps

Use "@aws-quickstart/eks-blueprints": "^1.13.1 with "aws-cdk-lib": "2.97.0" defined in your package.json.

Possible Solution

Additional Information/Context

No response

CDK CLI Version

N/A

EKS Blueprints Version

No response

Node.js Version

N/A

Environment details (OS name and version, etc.)

N/A

Other information

Related

@DeveloperC286 DeveloperC286 added the bug Something isn't working label Mar 8, 2024
@DeveloperC286
Copy link
Author

Thinking more about this, you actually do not even need to touch your package.json manually to get this complication errors. Your usage/installation commands will install @aws-quickstart/eks-blueprints with a caret(^) so it is not pinned. So if I do an npm update I could start getting complication errors.

@DeveloperC286
Copy link
Author

Not pinning the aws-cdk-lib version is something @aws-cdk/lambda-layer-kubectl-v* does e.g. https://github.com/cdklabs/awscdk-asset-kubectl/blob/kubectl-v29/main/package.json#L72

@DeveloperC286
Copy link
Author

I think an important thing to note about CDK users is that they may not come from a development background. Even with my development background, prior experience with CDK and basic Node/NPM knowledge this was still an hour of debugging for me to resolve it.

@shapirov103
Copy link
Collaborator

@DeveloperC286 thank you for your feedback.

You can upgrade the version of CDK to any version without issues if you use the override functionality as shown here. We should document it better for sure.

However, your feedback is spot-on. Many users don't have dev background or background in node/npm and it created more issues than we expected.

The pinned version was a conscious choice, as we observed cases when upgrading CDK version broke blueprints functionality. It is probably time to reevaluate this as it was more common in the past.

@DeveloperC286
Copy link
Author

You can upgrade the version of CDK to any version without issues if you use the override functionality as shown here. We should document it better for sure.

Thank you for the link, I had found that solution from yourself in your replys to prior issues. Once I knew what the problem was it was simple to fix, but getting from a typescript error to the problem was the challenging part.

However, your feedback is spot-on. Many users don't have dev background or background in node/npm and it created more issues than we expected.

I was asked by someone without a development background for help, someone who is very proficient with AWS and CloudFormation and without my help this would have been a roadblocker for adopting cdk-eks-blueprints.

The pinned version was a conscious choice, as we observed cases when upgrading CDK version broke blueprints functionality. It is probably time to reevaluate this as it was more common in the past.

A combination to tackle both problems of making sure people do not use untested CDK versions and removing this dependency issue could be to use a version range e.g. accept 2.80 -> 2.110(or what ever versions you have tested).

elamaran11 pushed a commit that referenced this issue Mar 12, 2024
* upgraded CDK to 2.132 and added peer dependency

* Fix for  #944, CDK dependency is set as peer and docs updated

* updating md link

* Fix for karpenter failure or delete, k8s moved to 1.29 for e2e and removed flux example as it was failing to compile

* fixed typo
@shapirov103
Copy link
Collaborator

@DeveloperC286 1.14.0 release is out and should have the fix to address this issue.
CDK depedency is moved to peerDependencies. You can read more on the behavior here.

This approach eliminates the situation when CDK version mismatch is causing a compile issue. It also makes it easier to change the version of CDK to the latest (with warning).

Please let me know if you have any feedback.

@DeveloperC286
Copy link
Author

@DeveloperC286 1.14.0 release is out and should have the fix to address this issue. CDK depedency is moved to peerDependencies. You can read more on the behavior here.

This approach eliminates the situation when CDK version mismatch is causing a compile issue. It also makes it easier to change the version of CDK to the latest (with warning).

Please let me know if you have any feedback.

Thank you, this is far easier now to know about the missing/mismatched CDK version rather than a mysterious complication error 🎉

My only comment would be it would be great if the version wasn't pinned to a specific version. Even a range of versions it has been tested against would be better.

@shapirov103
Copy link
Collaborator

Atm, the pipeline is only testing against the version specified in the release. It seems that the peer dependency solution is a good indication of the version we tested against, but also allows setting any other CDK version if you need to.
I can relax the pinned version to a range, but atm the team is only equipped to accept issues against the tested version as testing gets more and more complex with the proliferation of options and addons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants