Home > OS >  Deploy -> update -> deploy routine in cdk
Deploy -> update -> deploy routine in cdk

Time:02-19

For example I have these two lambda in CdkStBaseStack

It can be deployed by cdk deploy at first.

Hoever later,when I updated the code in resizer-sam/resizer.

So, I want to deploy new version of ResizerLambda

Is there any method to deploy the update version?

Or I need to prepare some tools besides cdk?

const resizerLambda = new lambda.DockerImageFunction(this, "ResizerLambda", {
  code: lambda.DockerImageCode.fromImageAsset("resizer-sam/resizer"),
  functionName: `cdk-st-${targetEnv}-resizer-lm`
});
const mybaseLambda = new lambda.DockerImageFunction(this, "MyBaseLambda", {
  code: lambda.DockerImageCode.fromImageAsset("mybase-sam/mybase"),
  functionName: `cdk-st-${targetEnv}-mybase-lm`
});

CodePudding user response:

Assuming I understood the question correctly, doing a simple cdk deploy would bundle the new code and update your function accordingly.

  • Related