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

[Question] aws-cdk version of blueprints causes codebuild failed

Open vumdao opened this issue 3 years ago • 2 comments

Describe the feature

aws-cdk version of blueprints (v2.43.0) does not match with the latest one v.2.45.0 which caused codebuild failed

+ [email protected]
30 | added 1 package from 1 contributor in 3.48s
31 |  
32 | [Container] 2022/10/09 02:48:57 Phase complete: INSTALL State: SUCCEEDED
33 | [Container] 2022/10/09 02:48:57 Phase context status code:  Message:
34 | [Container] 2022/10/09 02:48:57 Entering phase PRE_BUILD
35 | [Container] 2022/10/09 02:48:57 Phase complete: PRE_BUILD State: SUCCEEDED
36 | [Container] 2022/10/09 02:48:57 Phase context status code:  Message:
37 | [Container] 2022/10/09 02:48:57 Entering phase BUILD
38 | [Container] 2022/10/09 02:48:57 Running command yarn install --frozen-lockfile
39 | yarn install v1.22.19
40 | [1/4] Resolving packages...
41 | [2/4] Fetching packages...
42 | [3/4] Linking dependencies...
43 | [4/4] Building fresh packages...
44 | Done in 40.46s.
45 |  
46 | [Container] 2022/10/09 02:49:39 Running command npx projen build
47 | 👾 build » default \| ts-node --project tsconfig.dev.json .projenrc.ts
48 | yarn install v1.22.19
49 | [1/4] Resolving packages...
50 | [2/4] Fetching packages...
51 | [3/4] Linking dependencies...
52 | [4/4] Building fresh packages...
53 | success Saved lockfile.
54 | Done in 13.73s.
55 | 👾 build » post-compile » synth:silent \| cdk synth -q
56 | ⨯ Unable to compile TypeScript:
57 | src/eks-blueprints/builder.ts(31,13): error TS2345: Argument of type 'Cluster' is not assignable to parameter of type 'Cluster \| PromiseLike<Cluster>'.
58 | Type 'import("/codebuild/output/src259311067/src/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/aws-eks/lib/cluster").Cluster' is not assignable to type 'import("/codebuild/output/src259311067/src/node_modules/aws-cdk-lib/aws-eks/lib/cluster").Cluster'.
59 | The types of 'vpc.publicSubnets' are incompatible between these types.
60 | Type 'import("/codebuild/output/src259311067/src/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/aws-ec2/lib/vpc").ISubnet[]' is not assignable to type 'import("/codebuild/output/src259311067/src/node_modules/aws-cdk-lib/aws-ec2/lib/vpc").ISubnet[]'.
61 | Type 'import("/codebuild/output/src259311067/src/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/aws-ec2/lib/vpc").ISubnet' is not assignable to type 'import("/codebuild/output/src259311067/src/node_modules/aws-cdk-lib/aws-ec2/lib/vpc").ISubnet'.
62 | Types of property 'associateNetworkAcl' are incompatible.
63 | Type '(id: string, acl: import("/codebuild/output/src259311067/src/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/aws-ec2/lib/network-acl").INetworkAcl) => void' is not assignable to type '(id: string, acl: import("/codebuild/output/src259311067/src/node_modules/aws-cdk-lib/aws-ec2/lib/network-acl").INetworkAcl) => void'.
64 | Types of parameters 'acl' and 'acl' are incompatible.
65 | Type 'import("/codebuild/output/src259311067/src/node_modules/aws-cdk-lib/aws-ec2/lib/network-acl").INetworkAcl' is not assignable to type 'import("/codebuild/output/src259311067/src/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/aws-ec2/lib/network-acl").INetworkAcl'.
66 | The types of 'addEntry(...).stack.tags' are incompatible between these types.
67 | Type 'import("/codebuild/output/src259311067/src/node_modules/aws-cdk-lib/core/lib/tag-manager").TagManager' is not assignable to type 'import("/codebuild/output/src259311067/src/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/core/lib/tag-manager").TagManager'.
68 | Types have separate declarations of a private property 'tags'.
69 |  
70 |  
71 | Subprocess exited with error 1
72 | 👾 Task "build » post-compile » synth:silent" failed when executing "cdk synth -q" (cwd: /codebuild/output/src259311067/src)
73

<br class="Apple-interchange-newline">

Use Case

Is there anyway to override aws-cdk-lib of blueprints in codebuild to overcome this issue instead of downgrading cdk version of my project?

Proposed Solution

No response

Other Information

No response

Acknowledgements

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

CDK version used

2.45.0

EKS Blueprints Version

1.3.0

Node.js Version

v18.7.0

Environment details (OS name and version, etc.)

Ubuntu 22.04.1

vumdao avatar Oct 09 '22 03:10 vumdao

You may use https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides or https://yarnpkg.com/cli/set/resolution


Additional in the package.json should be a version constraint like "aws-cdk-lib": "^2.43.0", it should be almost save to do so. To assist this approach one needs to decide which package manager and add a lock file and a dep upgrade job...

pflorek avatar Oct 09 '22 07:10 pflorek

@vumdao as far as I remember we discussed it in #423 and the solution with overrides seemed to work for you. The version set to a specific CDK version is done on purpose to get more deterministic results. We don't test against other versions for the release, and we discovered that behavior may be different. Here is the solution that I provided, please let me know if it doesn't work.

@pflorek ^^

shapirov103 avatar Oct 11 '22 04:10 shapirov103

This issue has been automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] avatar Sep 19 '23 00:09 github-actions[bot]

Issue closed due to inactivity.

github-actions[bot] avatar Nov 18 '23 00:11 github-actions[bot]