Last active
February 9, 2021 17:01
-
-
Save mjaromi/39e3ac3ca4bccb8ce0012baeac326b91 to your computer and use it in GitHub Desktop.
Show diff between current and new task_definition
This file contains 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
terragrunt plan | egrep '(new resource required)|container_definitions' | sed -n '$!N;s/\x1b\[[0-9;]*m//g;s/\n/;/;s/.*aws_ecs_task_definition.//g;s/ *(new resource required)//g;s/ *container_definitions: *"//gp;;s/" *(forces new resource)//g' | while read task_definition; do | |
echo -e "\nDIFF for: \033[0;31m$(echo $task_definition | cut -d';' -f1)\033[0m\n$(diff <(echo $task_definition | cut -d';' -f2- | sed 's/\\"/"/g;s/^ //g;s/ => /\n/g;s/"\[/\[/g;s/\]"/\]/g;s/ *(forces new resource)//g' | head -1 | jq) <(echo $task_definition | cut -d';' -f2- | sed 's/\\"/"/g;s/^ //g;s/ => /\n/g;s/"\[/\[/g;s/\]"/\]/g;s/ *(forces new resource)//g' | tail -1 | jq))" | egrep -v '\+\+\+|\-\-\-' | egrep '^(\+|\-|DIFF for)' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍