From a4693cca6235de0486c997b55d23d9d257deacfc Mon Sep 17 00:00:00 2001 From: Giuseppe Di Piazza Date: Tue, 15 Nov 2022 15:10:57 +0000 Subject: [PATCH 1/2] [FEATURE] Make ec2 module working in all the regions --- EXAMPLE/cluster_defs/aws/cluster_vars__cloud.yml | 5 +++++ create/tasks/create_aws.yml | 1 + 2 files changed, 6 insertions(+) diff --git a/EXAMPLE/cluster_defs/aws/cluster_vars__cloud.yml b/EXAMPLE/cluster_defs/aws/cluster_vars__cloud.yml index 7ba00412..e3bb00ac 100644 --- a/EXAMPLE/cluster_defs/aws/cluster_vars__cloud.yml +++ b/EXAMPLE/cluster_defs/aws/cluster_vars__cloud.yml @@ -24,3 +24,8 @@ cluster_vars: # ports: ["{{ prometheus_node_exporter_port | default(9100) }}"] # group_name: ["{{buildenv}}-private-sg"] # rule_desc: "Prometheus instances attached to {{buildenv}}-private-sg can access the exporter port(s)." + + +# Some of the regions are not available for aws module boto.ec2. If the region definitely exists, you may need to upgrade boto or extend with endpoints_path +# Adding the below to ec2 invocation fixes the issue +aws_endpoint_url: https://ec2.{{region}}.amazonaws.com \ No newline at end of file diff --git a/create/tasks/create_aws.yml b/create/tasks/create_aws.yml index f4ad3ad0..b4f1d026 100644 --- a/create/tasks/create_aws.yml +++ b/create/tasks/create_aws.yml @@ -56,6 +56,7 @@ volumes: "{{ item.auto_volumes | selectattr('src', 'undefined') | list | default([]) }}" count_tag: { Name: "{{item.hostname}}" } exact_count: 1 + ec2_url: "{{ aws_endpoint_url | default(omit) }}" vars: _instance_tags: Name: "{{item.hostname}}" From 7e6715301960f5aa89ac059d98ba8b774438d97b Mon Sep 17 00:00:00 2001 From: Giuseppe Di Piazza Date: Tue, 15 Nov 2022 16:21:52 +0000 Subject: [PATCH 2/2] Move aws_endpoint_url under the cluster_vars heirarchy --- EXAMPLE/cluster_defs/aws/cluster_vars__cloud.yml | 2 +- create/tasks/create_aws.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EXAMPLE/cluster_defs/aws/cluster_vars__cloud.yml b/EXAMPLE/cluster_defs/aws/cluster_vars__cloud.yml index e3bb00ac..d11e3954 100644 --- a/EXAMPLE/cluster_defs/aws/cluster_vars__cloud.yml +++ b/EXAMPLE/cluster_defs/aws/cluster_vars__cloud.yml @@ -28,4 +28,4 @@ cluster_vars: # Some of the regions are not available for aws module boto.ec2. If the region definitely exists, you may need to upgrade boto or extend with endpoints_path # Adding the below to ec2 invocation fixes the issue -aws_endpoint_url: https://ec2.{{region}}.amazonaws.com \ No newline at end of file + aws_endpoint_url: https://ec2.{{region}}.amazonaws.com \ No newline at end of file diff --git a/create/tasks/create_aws.yml b/create/tasks/create_aws.yml index b4f1d026..1275f694 100644 --- a/create/tasks/create_aws.yml +++ b/create/tasks/create_aws.yml @@ -56,7 +56,7 @@ volumes: "{{ item.auto_volumes | selectattr('src', 'undefined') | list | default([]) }}" count_tag: { Name: "{{item.hostname}}" } exact_count: 1 - ec2_url: "{{ aws_endpoint_url | default(omit) }}" + ec2_url: "{{ cluster_vars.aws_endpoint_url | default(omit) }}" vars: _instance_tags: Name: "{{item.hostname}}"