aws-quickstart / cdk-eks-blueprints

AWS Quick Start Team
Apache License 2.0
447 stars 198 forks source link

cdk-eks-blueprints: typescript cdk codepipeline bug. #476

Closed gh4dp closed 1 year ago

gh4dp commented 2 years ago

Describe the bug

Execution on creating pipeline fails.

If I change the last line from : .build(scope, id+'-stack', props);
to : .build(scope, id+'-stack');

code complies and gives "cdk list": cluster-stack pipeline-stack

as expected.

Expected Behavior

It should have compiled as cdk.StackProps is most likely available.

Other behavior may be due to incompatible classes. I am totally new to Typescript and need someone's help to diagnose, my sole intention is of eks-blueprint.

Current Behavior

errors with.. ERROR [main printFatalErrorUponExit] TSError: ⨯ Unable to compile TypeScript: lib/pipeline.ts:27:34 - error TS2345: Argument of type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack").StackProps | undefined' is not assignable to parameter of type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack").StackProps | undefined'. Type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack").StackProps' is not assignable to type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack").StackProps'. Types of property 'synthesizer' are incompatible. Type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack-synthesizers/types").IStackSynthesizer | undefined' is not assignable to type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack-synthesizers/types").IStackSynthesizer | undefined'. Type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack-synthesizers/types").IStackSynthesizer' is not assignable to type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack-synthesizers/types").IStackSynthesizer'. Types of property 'bind' are incompatible. Type '(stack: import("/home/ec2-user/environment/my-eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack").Stack) => void' is not assignable to type '(stack: import("/home/ec2-user/environment/my-eks-blueprints/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack").Stack) => void'. Types of parameters 'stack' and 'stack' are incompatible. Type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack").Stack' is not assignable to type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/aws-cdk-lib/core/lib/stack").Stack'. Types of property 'tags' are incompatible. Type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/core/lib/tag-manager").TagManager' is not assignable to type 'import("/home/ec2-user/environment/my-eks-blueprints/node_modules/aws-cdk-lib/core/lib/tag-manager").TagManager'. Types have separate declarations of a private property 'tags'.

Reproduction Steps

Following exact same steps will lead to this error.

Possible Solution

The code compiles and returns expected result if :

If I change the last line from : .build(scope, id+'-stack', props);
to : .build(scope, id+'-stack');

Additional Information/Context

aws cloud9

CDK CLI Version

2.37.1 (build f15dee0)

EKS Blueprints Version

1.2.0

Node.js Version

v16.16.0

Environment details (OS name and version, etc.)

amazon ec2 os

Other information

No response

shapirov103 commented 2 years ago

@gh4dp thank you for letting us know. The workshop will be retested with version 1.2 and we will update the docs. There may be a chance that you have a mismatch between the CDK version used by the blueprints and the CDK version used elsewhere in the project. Please make sure that you package.json contains only references to cdk 2.37.1. e,g. "aws-cdk": "2.37.1".

youngjeong46 commented 2 years ago

@gh4dp We have updated the doc on instruction to run cdk 2.37.1, along with the latest npm release (1.2.0). The workshop runs as intended. Please verify and let us know here if you see otherwise.

youngjeong46 commented 1 year ago

Closing this issue, but please re-open if issues persist.