Answer the question
In order to leave comments, you need to log in
How to delete created resources using terraform via gitlab?
through the terminal it is deleted and created perfectly if you are in a directory with files, and if you use gitlab, it always writes that it deletes 0 resources, but it creates normally. Here is a yaml file. Problems only in the last stage destroy
stages:
- validate
- plan
- apply
- destroy
before_script:
- rm -rf .terraform
- export AWS_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY
- terraform init
validate:
stage: validate
script:
- terraform validate
tags:
- shell-runner
plan:
stage: plan
script:
- terraform plan -out "planfile"
dependencies:
- validate
artifacts:
paths:
- "planfile"
tags:
- shell-runner
apply:
stage: apply
script:
- terraform apply -input=false -auto-approve
dependencies:
- plan
tags:
- shell-runner
when: manual
destroy:
stage: destroy
script:
- terraform destroy -auto-approve
tags:
- shell-runner
when: manual
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question