I like using GO, so I use AWS CDK in the new GO flavour also.
See AWS Docu.
The GO part is missing ...
cdk ls on a GO CDK app will get you:
cdk ls This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version. (Cloud assembly schema version mismatch: Maximum schema version supported is 9.0.0, but found 10.0.0)
Here is the fix:
import ( - "github.com/aws/aws-cdk-go/awscdk" + "github.com/aws/aws-cdk-go/awscdk/v2" )
import ( - "github.com/aws/aws-cdk-go/awscdk" - "github.com/aws/aws-cdk-go/awscdk/awsssm" + "github.com/aws/aws-cdk-go/awscdk/v2" + "github.com/aws/aws-cdk-go/awscdk/v2/awsssm" )
import ( - "github.com/aws/constructs-go/constructs/v3" + "github.com/aws/constructs-go/constructs/v10" )
E.g. if you get
panic: "Unsupported feature flag '@aws-cdk/core:enableStackNameDuplicates'. This flag existed on CDKv1 but has been removed in CDKv2. CDK will now behave as the same as when the flag is enabled."
Delete the line in
go mod tidy
Instead of installing cdk globally (
npm i cdk -g) you may use a specific version of the cdk with
npx firstname.lastname@example.org ls
Without prior installation.
cluster := ecs.NewCluster(stack, jsii.String("ALBFargoECSCluster"),...
cluster := ecs.NewCluster(stack, aws.String("ALBFargoECSCluster"), ...
With the import of
That fixed it for me!
Hope this will help you.
For a chat - contact me on twitter @megaproaktiv