Skip to content

Instantly share code, notes, and snippets.

@tillkahlbrock
Last active January 27, 2021 13:23
Show Gist options
  • Save tillkahlbrock/3827abd55ce72ae4b5ad00a98bbe36cd to your computer and use it in GitHub Desktop.
Save tillkahlbrock/3827abd55ce72ae4b5ad00a98bbe36cd to your computer and use it in GitHub Desktop.
zsh function for using "cdk diff" with CDK Pipelines
function cdk-diff() {
if ! [ -d "cdk.out" ]; then
echo "no 'cdk.out' dir fount. Go to your apps root dir and run 'cdk synth'."
return
fi
stage=$(ls cdk.out | grep 'assembly-' | fzf)
stack=$(ls cdk.out/$stage/*.template.json | sed -E "s|cdk\.out\/${stage}\/(.+)\.template\.json|\1|" | fzf)
echo "npx cdk diff -a cdk.out/${stage} $stack $@"
npx cdk diff -a cdk.out/${stage} $stack $@
}
@HenrikFricke
Copy link

That's definitely a missing feature for CDK Pipelines. Thank you so much ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment