Closed daveschmidt86 closed 2 years ago
I am observing that the parameter types referenced in the error message are identical: basically the error message states that IVpc
is not assignable to IVpc
. As you can see they are pointing to different CDK instances. Such issues can happen if the version of the CDK used in your project is different from the version leveraged for the blueprints.
We have turned off version range on CDK dependency in the blueprints, since we ran into breaking changes. So if you leverage CDK version 2.20.0 the issue should be fixed.
You can either reinstall CDK globally at that version, or you can override the version of CDK for the project using overrides (provided your NPM version is 8.4 or above). You can find the example of overrides here.
@shapirov103 I checked, I am running 2.20.0 already. So given the reference of IVpc is different, should I reference the Blueprint one over the standard cdk interface?
Update: figured out my issue, forgot to update aws-cdk-lib to version 2.200 as well. Project is synthesizing now, will update if any further issues.
I have two stacks in my project, InfraStack and EksStack. My VPC is created in the InfraStack and my goal is to reference that VPC in the EKS Stack as a DirectVpcProvider. I am receiving the follow error when doing so (code included below).
Error: "Argument of type 'import("/Users//Desktop/k8s/eks_blueprint_cdk_testing/node_modules/aws-cdk-lib/aws-ec2/lib/vpc").IVpc' is not assignable to parameter of type 'import("/Users//Desktop/k8s/eks_blueprint_cdk_testing/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/aws-ec2/lib/vpc").IVpc'. Types of property 'publicSubnets' are incompatible. Type 'import("/Users//Desktop/k8s/eks_blueprint_cdk_testing/node_modules/aws-cdk-lib/aws-ec2/lib/vpc").ISubnet[]' is not assignable to type 'import("/Users//Desktop/k8s/eks_blueprint_cdk_testing/node_modules/@aws-quickstart/eks-blueprints/node_modules/aws-cdk-lib/aws-ec2/lib/vpc").ISubnet[]'. Type 'import("/Users//Desktop/k8s/eks_blueprint_cdk_testing/node_modules/aws-cdk-lib/aws-ec2/lib/vpc").ISubnet' is not assignable to type"
InfraStack:
EksStack:
CDK Main File: