I would like to run an EC2 in another region without having to change aws configuration. This is a script that should run for other users as well.
I know that it is possible to create an SG in another region just by passing the argument --region us-east-2 .. but doesn't work for Runinstances api.
Another solution would be a script that runs aws configure and change ONLY the region, without any input from the user. any idea on how to implement any of these 2 ?
--regionworks for all aws cli commands. It is a top-level parameter documented here. If that isn't working for you, you should show the details of that in your question.Also,
aws configureonly sets the default region. You can override the current region at any time by setting theAWS_REGIONenvironment variable. You could do this inside your script before calling aws cli commands.See the aws cli environment variable documentation.