This is an automated email from the ASF dual-hosted git repository.
mykolabodnar pushed a commit to branch DATALAB-2409
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/DATALAB-2409 by this push:
new 2859b78 [DATALAB-2409] - [AWS] SSN prepare refactored
2859b78 is described below
commit 2859b7887482510adf8e2455860bfdecf45fba14
Author: bodnarmykola <[email protected]>
AuthorDate: Tue Jul 27 12:45:52 2021 +0300
[DATALAB-2409] - [AWS] SSN prepare refactored
---
infrastructure-provisioning/src/general/lib/aws/actions_lib.py | 1 +
infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
index b3810c2..57d1236 100644
--- a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
@@ -1168,6 +1168,7 @@ def remove_sgroups(tag_value):
ec2 = boto3.resource('ec2')
client = boto3.client('ec2')
tag_name = os.environ['conf_service_base_name']
+ print('removing sg with tag key {} and tag value {}'.format(tag_name,
tag_value))
sgs = ec2.security_groups.filter(
Filters=[{'Name': 'tag:{}'.format(tag_name), 'Values':
[tag_value]}])
if sgs:
diff --git a/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py
b/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py
index 6af3c59..9ca4e12 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/ssn_prepare.py
@@ -136,7 +136,7 @@ if __name__ == "__main__":
if os.environ['conf_duo_vpc_enable'] == 'true' and 'aws_vpc2_id' in
os.environ \
and os.environ['aws_vpc2_id'] != '':
ssn_conf['aws_vpc2_id'] = os.environ['aws_vpc2_id']
- else:
+ elif os.environ['conf_duo_vpc_enable'] == 'true':
logging.info('[CREATE SECONDARY VPC AND ROUTE TABLE]')
params = "--vpc {} --region {} --infra_tag_name {}
--infra_tag_value {} --secondary" \
" --vpc_name {}".format(ssn_conf['vpc2_cidr'],
ssn_conf['region'], ssn_conf['tag2_name'],
@@ -254,7 +254,7 @@ if __name__ == "__main__":
except:
traceback.print_exc()
raise Exception
- ssn_conf['aws_security_groups_ids'] =
get_security_group_by_name(ssn_conf['sg_name'])
+ ssn_conf['aws_security_groups_ids'] =
datalab.meta_lib.get_security_group_by_name(ssn_conf['sg_name'])
except Exception as err:
logging.error('Error: {0}'.format(err))
datalab.fab.append_result("Failed to create security group for SSN",
str(err))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]