2

Python terminal below

In [3]: os.environ['AWS_DEFAULT_REGION']
Out[3]: 'us-west-2'

In [4]: import boto

In [5]: boto.connect_ec2()
Out[5]: EC2Connection:ec2.ap-southeast-1.amazonaws.com

AWS Default region is not getting set even after using AWS_DEFAULT_REGION as env variable. Please suggest !

0

1 Answer 1

6

Solution:

AWS_DEFAULT_REGION works only with boto3. I was using boto2. Environment variables for region is not supported in boto2.

Updating the boto.cfg fixed the problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.