cloudcomponents / cdk-constructs

A collection of higher-level reusable cdk constructs
MIT License
624 stars 104 forks source link

Unable to use cloudcomponents for cdk version 2 #168

Open ramesh82 opened 2 years ago

ramesh82 commented 2 years ago

Hi,

I am getting type errors when using @cloudcomponents/cdk-codepipeline-slack for cdk version 2. Is there any feature request or work in progress for cdk version 2 support?

stephenwiebe commented 2 years ago

@hupe1980 Any word on this? We're getting this error with version 2.1.0 with CDK 2:

/home/kralljir/shopvox/cdk-shopvox-app-compute/node_modules/constructs/src/construct.ts:362
        throw new Error(`the construct "${this.path}" has a "${method}()" method which is no longer supported. Use "construct.node.addValidation()" to add validations to a construct`);
              ^
Error: the construct "CdkShopvoxComputePipeline/ShopvoxStaging/Staging/PipelineBuild/SlackNotifier" has a "validate()" method which is no longer supported. Use "construct.node.addValidation()" to add validations to a construct
    at Node.validate (/home/kralljir/shopvox/cdk-shopvox-app-compute/node_modules/constructs/src/construct.ts:362:15)
    at /home/kralljir/shopvox/cdk-shopvox-app-compute/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:1:2940
    at visit (/home/kralljir/shopvox/cdk-shopvox-app-compute/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:3:64)
    at visit (/home/kralljir/shopvox/cdk-shopvox-app-compute/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:3:141)
    at visit (/home/kralljir/shopvox/cdk-shopvox-app-compute/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:3:141)
    at visit (/home/kralljir/shopvox/cdk-shopvox-app-compute/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:3:141)
    at validateTree (/home/kralljir/shopvox/cdk-shopvox-app-compute/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:1:2875)
    at Object.synthesize (/home/kralljir/shopvox/cdk-shopvox-app-compute/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:1:598)
    at ShopvoxStagingComputeStage.synth (/home/kralljir/shopvox/cdk-shopvox-app-compute/node_modules/aws-cdk-lib/core/lib/stage.js:1:1866)
    at Object.pipelineSynth (/home/kralljir/shopvox/cdk-shopvox-app-compute/node_modules/aws-cdk-lib/pipelines/lib/private/construct-internals.js:1:705)

when instantiating a SlackNotifier:

new SlackNotifier(this, 'SlackNotifier', {
      pipeline: this.pipeline,
      slackBotToken: props.slackBotToken,
      slackSigningSecret: props.slackSigningSecret,
      slackChannel: props.slackChannel
    });

The problem seems to be the deprecated validate() method here.

jctan commented 1 year ago

have anyone figure out the cloudcomponents module for cdk2 for python? I'm getting ModuleNotFoundError: No module named 'cloudcomponents'