Last active
January 27, 2021 13:23
-
-
Save tillkahlbrock/3827abd55ce72ae4b5ad00a98bbe36cd to your computer and use it in GitHub Desktop.
zsh function for using "cdk diff" with CDK Pipelines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 $@ | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's definitely a missing feature for CDK Pipelines. Thank you so much ❤️