From 55b3f9e4e5a17cd303688684ba7284f1e57e8741 Mon Sep 17 00:00:00 2001 From: Shayne Clausson Date: Fri, 9 Oct 2015 10:25:38 +0200 Subject: [PATCH] Use AWS_DEFAULT_REGION env var if none specified --- lib/ansible/module_utils/ec2.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/ec2.py b/lib/ansible/module_utils/ec2.py index 14a8676b598..ac799772c2c 100644 --- a/lib/ansible/module_utils/ec2.py +++ b/lib/ansible/module_utils/ec2.py @@ -124,6 +124,8 @@ def get_aws_connection_info(module, boto3=False): if not region: if 'AWS_REGION' in os.environ: region = os.environ['AWS_REGION'] + elif 'AWS_DEFAULT_REGION' in os.environ: + region = os.environ['AWS_DEFAULT_REGION'] elif 'EC2_REGION' in os.environ: region = os.environ['EC2_REGION'] else: