clusterinthecloud / support

If you need help with Cluster in the Cloud, this is the right place
2 stars 0 forks source link

Terraform destroy fails with missing credential error #43

Open JamieJQuinn opened 2 years ago

JamieJQuinn commented 2 years ago

Expected result:

Cluster is destroyed when running python destroy-citc.py aws <ip> citc-terraform-<cluster-id>/citc-key

Actual result:

Terraform fails with error:

aws_instance.mgmt: Destroying... [id=i-020833380f8efa17c]
aws_instance.mgmt: Provisioning with 'local-exec'...
aws_instance.mgmt (local-exec): Executing: ["/bin/sh" "-c" "files/cleanup.sh"]
aws_instance.mgmt (local-exec): Terminating any remaining compute nodes

aws_instance.mgmt (local-exec): Unable to locate credentials. You can configure credentials by running "aws configure".
aws_instance.mgmt (local-exec): Node termination request completed
aws_instance.mgmt (local-exec): Wiping DNS entries for hanging nodes

aws_instance.mgmt (local-exec): Unable to locate credentials. You can configure credentials by running "aws configure".
╷
│ Error: local-exec provisioner error
│ 
│   with aws_instance.mgmt,
│   on compute.tf line 69, in resource "aws_instance" "mgmt":
│   69:   provisioner "local-exec" {
│ 
│ Error running command 'files/cleanup.sh': exit status 253. Output: Terminating any remaining
│ compute nodes
│ 
│ Unable to locate credentials. You can configure credentials by running "aws configure".
│ Node termination request completed
│ Wiping DNS entries for hanging nodes
│ 
│ Unable to locate credentials. You can configure credentials by running "aws configure".
│ 
╵
Terraform destroy failed. Try again with:
  cd citc-terraform-nearby-vervet
  ./terraform -chdir=aws apply -destroy 
You may need to manually clean up any remaining running instances or DNS entries

aws-cli is configured with SSO, not sure if that's a factor

Workaround: