You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With CDK I'd like to express: "when there is no local code asset, don't deploy a new code asset and don't create a new Lambda version".
// This is some hypothetical API that signals asset reuse.letcodeAsset=lambda.Code.previousAsset();if(fs.existsSync(codePath)){codeAsset=lambda.Code.asset(codePath);}// Everything else from here on out is typical Lambda use todayconstlambdaFunction=newlambda.Function(this,'Resource',{code: codeAsset,// ...});constalias=newlambda.Alias(this,'LiveAlias',{aliasName: 'Live',description: 'Live alias used to shift traffic during deployments.',version: lambdaFunction.addVersion(codeAsset.sourceHash,codeAsset.bundleHash),});
PreviousAsset would both mark the asset to be reused (i.e. keep previous deployment parameters) and expose the previous hashes for versioning.
Does this seems possible? Am I missing the boat and there is a better way to accomplish this workflow?
The text was updated successfully, but these errors were encountered:
There are 2 new CDK features that seem to nearly address a use case I have.
First we have the ability to
--build-exclude
an asset, letting us reuse the previously uploaded asset for a Lambda. Secondly a feature exposing an asset fingerprint and asset sha256 hash is in progress.With CDK I'd like to express: "when there is no local code asset, don't deploy a new code asset and don't create a new Lambda version".
PreviousAsset
would both mark the asset to be reused (i.e. keep previous deployment parameters) and expose the previous hashes for versioning.Does this seems possible? Am I missing the boat and there is a better way to accomplish this workflow?
The text was updated successfully, but these errors were encountered: