From 4ec91491e269b1f615382de1f652e278cb704b3b Mon Sep 17 00:00:00 2001 From: Stepan Stipl Date: Fri, 15 Sep 2017 04:54:29 +0100 Subject: [PATCH] Pass region and ec2_url to boto3 connection (#30370) fixes ansible/ansible#30368 --- lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py index a84ad4df606..f30f0703310 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py @@ -236,7 +236,7 @@ def main(): region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True) try: - connection = boto3_conn(module, conn_type='client', resource='ec2', **aws_connect_params) + connection = boto3_conn(module, conn_type='client', resource='ec2', region=region, endpoint=ec2_url, **aws_connect_params) except (botocore.exceptions.NoCredentialsError, botocore.exceptions.ProfileNotFound) as e: module.fail_json(msg=e.message, exception=traceback.format_exc(), **camel_dict_to_snake_dict(e.response))