What is the command to switch the region on aws cli. I want to switch to another region where my lambdas are present
I have tried these commands but they doesn’t work
aws --region <region_name>
aws set region <region_name>
aws configure region <region_name>
aws lambda .... --region <region_name>
2
Answers
As far as I can tell
--region <region>
should do the job. In most of the cases I use theregion
parameter as a part of my profile. If it doesn’t work in your case, check the environment variable.Reference: Command line options – AWS Command Line Interface
You can set the
AWS_REGION
environment variable so that the AWS CLI would use it in the subsequent calls:Then if you use
command it would be executed in that region.
Alternatively, if you want this change to be persisted, you can change you
~/.aws/credentials
file and set the region there.