I am following this tutorial from the official GCP repo on how to deploy terraform from a cloud build:
cloudbuils.yaml
steps:
- id: 'branch name'
name: 'alpine'
entrypoint: 'sh'
args:
- '-c'
- |
echo "***********************"
echo "$BRANCH_NAME"
echo "***********************"
- id: 'tf init'
name: 'hashicorp/terraform:1.0.0'
entrypoint: 'sh'
args:
- '-c'
- |
if [ -d "environments/$BRANCH_NAME/" ]; then
cd environments/$BRANCH_NAME
terraform init
else
for dir in environments/*/
do
cd ${dir}
env=${dir%*/}
env=${env#*/}
echo ""
echo "*************** TERRAFORM INIT ******************"
echo "******* At environment: ${env} ********"
echo "*************************************************"
terraform init || exit 1
cd ../../
done
fi
and I am having the following pattern in the log:
2022-02-21 07:13:13.094 CETStep #3 - "tf apply": [32m+[0m [0m[1m[0munique_id[0m[0m = (known after apply)
2022-02-21 07:13:13.094 CETStep #3 - "tf apply": }
2022-02-21 07:13:13.094 CETStep #3 - "tf apply":
2022-02-21 07:13:13.094 CETStep #3 - "tf apply": [0m[1mPlan:[0m 7 to add, 0 to change, 0 to destroy.
Which makes the debug a lot more painful that it needs to be, I am sure it is a simple formatting issue, but I could not find its origin.