Skip to content

Commit c20d82a

Browse files
authored
xuy-UID2-5201-Update-CFT-tests (#171)
1 parent 3c9d870 commit c20d82a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/aws/create_cloudformation_stack.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ def create_egress(url, description):
1616
def get_port(url):
1717
return url.split(":")[2]
1818

19-
def create_cloudformation_stack(client, stack_name, cft_content, api_token, dc_cfg, ip_address, env):
19+
def create_cloudformation_stack(client, stack_name, cft_content, api_token, dc_cfg, ip_address, env, image_id):
2020
result = client.create_stack(
2121
StackName=stack_name,
2222
TemplateBody=cft_content,
2323
Capabilities=['CAPABILITY_IAM'],
2424
Parameters=[
2525
{ 'ParameterKey': 'APIToken', 'ParameterValue': api_token },
26+
{ 'ParameterKey': 'ImageId', 'ParameterValue': image_id },
2627
{ 'ParameterKey': 'DeployToEnvironment', 'ParameterValue': "prod" if env == "prod" else "integ" }, # Mock env also uses integ
2728
{ 'ParameterKey': 'VpcId', 'ParameterValue': dc_cfg['VpcId'] },
2829
{ 'ParameterKey': 'VpcSubnet1', 'ParameterValue': dc_cfg['VpcSubnet1'] },
@@ -55,8 +56,6 @@ def create_cloudformation_stack(client, stack_name, cft_content, api_token, dc_c
5556
with open('{}/{}_CloudFormation.template.yml'.format(args.cftemplate_fp, args.scope), 'r') as f:
5657
cft = load_yaml(f)
5758

58-
cft['Mappings']['RegionMap'][args.region]['AMI'] = args.ami
59-
6059
if args.env == "mock":
6160
egress = cft['Resources']['SecurityGroup']['Properties']['SecurityGroupEgress']
6261
egress.append(create_egress(args.core_url, 'E2E - Core'))
@@ -84,6 +83,7 @@ def create_cloudformation_stack(client, stack_name, cft_content, api_token, dc_c
8483
stack_name=args.stack,
8584
cft_content=dump_yaml(cft),
8685
api_token=args.operator_key,
86+
image_id=args.ami,
8787
dc_cfg=dc_cfg,
8888
ip_address=ip,
8989
env=args.env)

0 commit comments

Comments
 (0)