Hello Folks,
I have setup terraform files in my config.yml file in .circleci directory to run terrafom plan command. When I make changes to the config.yml file, this is the error I am getting in the CircleCI UI:
*Error: can't find external program "ruby"*
*Error: cannot read Node n-6cb4cad460d656c1: unauthenticated: cannot find auth GUID*
*Error: cannot read Node n-4c16183860d9c9a8: unauthenticated: cannot find auth GUID*
Here is my config.yml file:
version: 2.1
jobs:
shellcheck:
docker:
- image: koalaman/shellcheck-alpine
steps:
- checkout
- run: .circleci/bin/shellcheck.sh
terraform:
docker:
- image: hashicorp/terraform:0.12.31
steps:
- checkout
- run:
name: Create a .valid directory and populate it with service account cred.
command: |
cd terraform/env/
mkdir .valid/
touch .valid/account.json
echo $ACCOUNT > .valid/account.json
- run:
name: Check Terraform formatting
command: |
if [[ -n "$(terraform fmt -write=false)" ]]; then echo "Need to run 'terraform fmt' to fix formatting"; exit 1; fi
- run:
name: Validate terraform for dev environment
command: |
cd terraform/env && terraform init -input=false -backend=true && (terraform validate -json=false && echo "√ passed") || exit 1
- run:
name: Plan terraform for dev environment
command: |
cd terraform/env && terraform plan -out=tfplan && echo "√ passed" || exit 1
workflows:
version: 2
build:
jobs:
- shellcheck
- terraform
The last step terraform plan -out=tfplan is what failed with the above mentioned error