image: name: hashicorp/terraform:light entrypoint: [""] stages: - tf-validate - tf-plan - tf-apply - tf-destroy tf-validate: stage: tf-validate script: - terraform init - terraform validate tf-plan: stage: tf-plan script: - terraform init - terraform plan -out plan.tfplan artifacts: paths: - plan.tfplan tf-apply: stage: tf-apply image: name: hashicorp/terraform entrypoint: [""] before_script: - apk add ansible - ansible-galaxy collection install community.docker script: - terraform init - terraform apply plan.tfplan dependencies: - tf-plan when: manual only: - master tf-destroy: stage: tf-destroy image: name: hashicorp/terraform entrypoint: [""] before_script: - apk add ansible script: - terraform init - terraform destroy plan.tfplan dependencies: - tf-plan when: manual only: - master