Skip to content

Commit

Permalink
fix: use terraform CLI over shell
Browse files Browse the repository at this point in the history
  • Loading branch information
wrussell1999 authored Dec 16, 2024
1 parent 082aca9 commit a256b96
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions git-terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,22 @@ tasks:
branch: main

- id: terraform
type: io.kestra.plugin.scripts.shell.Commands
containerImage: hashicorp/terraform
taskRunner:
type: io.kestra.plugin.scripts.runner.docker.Docker
entryPoint:
- ""
type: io.kestra.plugin.terraform.cli.TerraformCLI
beforeCommands:
- terraform init
inputFiles:
terraform.tfvars: |
username = "cicd"
password = "{{ secret('CI_CD_PASSWORD') }}"
hostname = "https://demo.kestra.io"
beforeCommands:
- terraform init
outputFiles:
- "*.txt"
commands:
- terraform apply -auto-approve
- terraform plan 2>&1 | tee plan_output.txt
- terraform apply -auto-approve 2>&1 | tee apply_output.txt
env:
AWS_ACCESS_KEY_ID: "{{ secret('AWS_ACCESS_KEY_ID') }}"
AWS_SECRET_ACCESS_KEY: "{{ secret('AWS_SECRET_ACCESS_KEY') }}"
AWS_SECRET_KEY_ID: "{{ secret('AWS_SECRET_KEY_ID') }}"
AWS_DEFAULT_REGION: "{{ secret('AWS_DEFAULT_REGION') }}"

extend:
Expand Down

0 comments on commit a256b96

Please sign in to comment.