terraform/terraform wrapper

Renamed the wrapper because all the usages of ./terraform/deploy were
invoking terraform. I also fixed an escaping issue that I encountered
when running `./terraform import 'some.resource["xxx"]' ID`
This commit is contained in:
zimbatm 2023-01-23 14:59:06 +01:00
parent 0563ab6ba7
commit d788b2f349
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7
2 changed files with 6 additions and 6 deletions
.github/workflows
terraform

View file

@ -31,16 +31,16 @@ jobs:
accept-flake-config = true
- name: init
if: steps.changes.outputs.terraform == 'true'
run: nix develop -c ./terraform/deploy terraform init -input=false
run: nix develop -c ./terraform/terraform init -input=false
- name: validate
if: steps.changes.outputs.terraform == 'true'
run: nix develop -c ./terraform/deploy terraform validate
run: nix develop -c ./terraform/terraform validate
- name: fmt
if: steps.changes.outputs.terraform == 'true'
run: nix develop -c ./terraform/deploy terraform fmt -check
run: nix develop -c ./terraform/terraform fmt -check
- name: plan
if: steps.changes.outputs.terraform == 'true' && github.ref == 'refs/heads/trying'
run: nix develop -c ./terraform/deploy terraform plan -input=false
run: nix develop -c ./terraform/terraform plan -input=false
- name: apply
if: steps.changes.outputs.terraform == 'true' && github.ref == 'refs/heads/staging'
run: nix develop -c ./terraform/deploy terraform apply -auto-approve -input=false
run: nix develop -c ./terraform/terraform apply -auto-approve -input=false

View file

@ -4,6 +4,6 @@ set -euo pipefail
pushd "$(dirname "$0")" >/dev/null
# terraform cloud without the remote execution part
TF_FORCE_LOCAL_BACKEND="1" sops exec-env secrets.yaml "${*@Q}"
TF_FORCE_LOCAL_BACKEND="1" sops exec-env secrets.yaml "terraform ${*@Q}"
popd >/dev/null