Update 7 files

- /scripts/terraform-fmt.sh
- /scripts/terraform-init.sh
- /scripts/terraform-plan.sh
- /scripts/terraform-validate.sh
- /scripts/terraform-apply.sh
- /scripts/terraform-destroy.sh
- /templates/terraform.tpl.yml
This commit is contained in:
2023-07-29 13:00:58 +00:00
parent db02cfc50d
commit 3648086d32
7 changed files with 85 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#%%MULTILINE_YAML_START
#Terraform plan
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)}'"
terraform plan -out=$PLAN $ARGUMENTS
terraform show --json $PLAN | convert_report > $JSON_PLAN_FILE