From 045dff1c7cbc3c204cc0946d8b5588d4784792ae Mon Sep 17 00:00:00 2001 From: Jessie Brami Date: Tue, 7 Jun 2016 17:12:55 +0300 Subject: [PATCH] CFY-5387 added elb region/endpoint to the blueprint --- aws-ec2-manager-blueprint.yaml | 5 +++++ components/manager/scripts/aws-ec2/configure.py | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/aws-ec2-manager-blueprint.yaml b/aws-ec2-manager-blueprint.yaml index 7ab8d6f26..2bbb503fc 100644 --- a/aws-ec2-manager-blueprint.yaml +++ b/aws-ec2-manager-blueprint.yaml @@ -24,6 +24,10 @@ inputs: type: string default: 'us-east-1' + elb_region_name: + type: string + default: 'us-east-1' + use_existing_manager_keypair: type: boolean default: false @@ -526,6 +530,7 @@ dsl_definitions: aws_access_key_id: { get_input: aws_access_key_id } aws_secret_access_key: { get_input: aws_secret_access_key } ec2_region_name: { get_input: ec2_region_name } + elb_region_name: { get_input: elb_region_name } node_templates: diff --git a/components/manager/scripts/aws-ec2/configure.py b/components/manager/scripts/aws-ec2/configure.py index 7ab7e052b..c97f19166 100644 --- a/components/manager/scripts/aws-ec2/configure.py +++ b/components/manager/scripts/aws-ec2/configure.py @@ -56,6 +56,15 @@ def _upload_credentials(aws_config, manager_config_path): credentials.set('Boto', 'ec2_region_endpoint', region.endpoint) + if aws_config.get('elb_region_name'): + region = get_region(aws_config['elb_region_name']) + if not credentials.has_section('Boto'): + credentials.add_section('Boto') + credentials.set('Boto', 'elb_region_name', + aws_config['elb_region_name']) + credentials.set('Boto', 'elb_region_endpoint', + region.endpoint) + with open(temp_config, 'w') as temp_config_file: credentials.write(temp_config_file)