Reputation: 11081
I am running this command aws ec2 terminate-instances --instance-ids $(ec2metadata --instance-id)
in Ubuntu via Ansible as root.
And I'm getting this error:
"stderr": "Service ec2 not available in region aws-east-1"
What does this mean? Does it mean that I can't terminate instances in the region aws-east-1?
But, when I run that command manually in the cmd, it terminates well! How do I solve this?
Upvotes: 1
Views: 209
Reputation: 46869
In the credentials/config file on your ubuntu instance, do you have the region set to aws-east-1 instead of us-east-1? aws-east-1 is not a valid region.
Upvotes: 3