AWS CDK synth and deploy from JAR file

Viewed 194

I order to treat my Infrastructure as code I would like to create a pipeline where my app code (let's say some lambda functions) are compiled, packaged and uploaded/deployed with a respective version to my Artifacts repo (CodeArtifact) INCLUDING my CDK app.

Then, In a following step in the pipeline I would like to download the JARs from the Artifacts repo, and run a 'cdk synth/deploy' from the previously generated JAR.

Is it possible to execute cdk synth/deploy passing a jar reference/path instead of from code?

1 Answers

As simple as executeting the generated shadow file.

java -jar path/your-app-all.jar

This can be place in the cdk.json file, then execute cdk synth or cdk deploy as always.

{
  "app": "java -jar ./build/libs/infrastructure-all.jar"
}
Related