Skip to content

Terraform destroy fails with missing credential error #43

@JamieJQuinn

Description

@JamieJQuinn

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:

  • Manually terminate mgmt instance in AWS console
  • Manually run terraform -chdir=aws apply -destroy

Metadata

Metadata

Assignees

No one assigned

    Labels

    AWSbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions