I wanted to destroy the DEV
environment from my Kubernetes hosted on AWS EKS. There are two parts to the resources; the infrastructure part and the application part. I use Terraform
/Terragrunt
to deploy/destroy the infra and helm
to deploy/destroy the applications. There are multiple pods running and I could destroy the releases by running helm uninstall <release-name>
. However, when it came to destroying the infra, I ran into error.
Here is what I did:
To destroy the infra, I ran: ENV=DEV make destroy
. To this command, it returns this:
cd infra/DEV && terragrunt destroy
Remote state S3 bucket aib-iac-tf-state does not exist or you don't have permissions to access it. Would you like Terragrunt to create it? (y/n)
To this, I tried with both y
and n
but it returns this error:
make: *** [Makefile:30: destroy] Error 1
Assuming that my access was altered by the root user to create/delete resources inside S3 Bucket
, I found it was not. The S3 Bucket
aib-iac-tf-state
does exist in the storage.
Then I went to check inside *Makefile*
, line 30 as per the error. This is what is in line 29 and 30:
destroy:
cd ${INFRA_DIR}/${ENV} && terragrunt destroy ${TF_VARS}
I am still not able to destroy the resources. Any help would be appreciated.