From 719018e0d6ac9207c49abe4b19f3d6bd07dcbdce Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Sat, 29 Jun 2024 09:00:38 -0500 Subject: [PATCH] update --- scripts/terraform/plan.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/terraform/plan.sh b/scripts/terraform/plan.sh index 489332b..6f63e08 100644 --- a/scripts/terraform/plan.sh +++ b/scripts/terraform/plan.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash #%%MULTILINE_YAML_START #Terraform plan -apk add --update curl jq +apk add --update curl jq alias convert_report="jq -r '([.resource_changes[].change.actions?]|flatten)|{\"create\":(map(select(.==\"create\"))|length),\"update\":(map(select(.==\"update\"))|length),\"delete\":(map(select(.==\"delete\"))|length)}'" tofu plan -out=$PLAN $ARGUMENTS -tofu show --json $PLAN | convert_report > $JSON_PLAN_FILE +tofu show --json $PLAN | jq -r '([.resource_changes[].change.actions?]|flatten)|{"create":(map(select(.=="create"))|length),"update":(map(select(.=="update"))|length),"delete":(map(select(.=="delete"))|length)}' > $JSON_PLAN_FILE