@@ -16,13 +16,14 @@ def create_egress(url, description):
1616def 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
5556with 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-
6059if 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