cloud-nuke icon indicating copy to clipboard operation
cloud-nuke copied to clipboard

ERROR: could not find any enabled regions

Open fintaro123 opened this issue 3 years ago • 2 comments

Hi Guys!

I made a free account last year and I was planning to use cloud-nuke (via my Windows terminal) to delete all my resources but I got the following message:

ERROR: could not find any enabled regions

after I enter the command: cloud-nuke aws

I am a completely newbie and I just want to close my free account but it seems so hard..

PS: I made a new user in IAM and added AdministratorAccess.

Could someone help me?

fintaro123 avatar Mar 09 '22 13:03 fintaro123

Hello, based on error, cloud-nuke failed to describe available AWS regions, it may be an issue with passed credentials

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html

https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html

denis256 avatar Mar 09 '22 20:03 denis256

It did not work for me on Windows, no matter how I've tried to pass the credentials. It did work on Linux though with a simple aws configure.

OvidiuMihalcea avatar Apr 06 '22 19:04 OvidiuMihalcea

I have had the same experience. running from Windows 10 and 11 in pwsh and cmd. Cloud-nuke would not detect the login credential variables and would just fail to connect and discover regions. running on ubuntu or mac and I've had no issues.

TheJenious0917 avatar Oct 19 '22 22:10 TheJenious0917

Add aws_region = ap-south-1 (or whatever region) on my aws credential config file works for me

vi ~/.aws/credentials

[user1]
aws_access_key_id = my_access_key_id
aws_secret_access_key = my_secret_access_key
aws_region = ap-south-1

Deletion of multiple regions resources works anyway even if you have only one region on credential config file

cloud-nuke aws --region ap-south-1 eu-central-1 eu-north-1

and you can scan and delete resources on all regions too

cloud-nuke aws

robbuh avatar Jul 22 '23 12:07 robbuh

For me the solution for this was to only have an ~/.aws/credentials file. Whenever the env vars are set it is in conflict with the creds file. Maybe a flag to choose precedence would be nice?

Y0RI0 avatar Sep 11 '23 13:09 Y0RI0

Thanks for providing the answer to the original questions. Will close this issue now.

james03160927 avatar Oct 31 '23 22:10 james03160927