Skip to content

Instantly share code, notes, and snippets.

View HenrikFricke's full-sized avatar

Henrik Fricke HenrikFricke

View GitHub Profile
@tillkahlbrock
tillkahlbrock / cdk-diff
Last active January 27, 2021 13:23
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 $@
}