@@ -16,13 +16,14 @@ def create_egress(url, description):
16
16
def get_port (url ):
17
17
return url .split (":" )[2 ]
18
18
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 ):
20
20
result = client .create_stack (
21
21
StackName = stack_name ,
22
22
TemplateBody = cft_content ,
23
23
Capabilities = ['CAPABILITY_IAM' ],
24
24
Parameters = [
25
25
{ 'ParameterKey' : 'APIToken' , 'ParameterValue' : api_token },
26
+ { 'ParameterKey' : 'ImageId' , 'ParameterValue' : image_id },
26
27
{ 'ParameterKey' : 'DeployToEnvironment' , 'ParameterValue' : "prod" if env == "prod" else "integ" }, # Mock env also uses integ
27
28
{ 'ParameterKey' : 'VpcId' , 'ParameterValue' : dc_cfg ['VpcId' ] },
28
29
{ 'ParameterKey' : 'VpcSubnet1' , 'ParameterValue' : dc_cfg ['VpcSubnet1' ] },
@@ -55,8 +56,6 @@ def create_cloudformation_stack(client, stack_name, cft_content, api_token, dc_c
55
56
with open ('{}/{}_CloudFormation.template.yml' .format (args .cftemplate_fp , args .scope ), 'r' ) as f :
56
57
cft = load_yaml (f )
57
58
58
- cft ['Mappings' ]['RegionMap' ][args .region ]['AMI' ] = args .ami
59
-
60
59
if args .env == "mock" :
61
60
egress = cft ['Resources' ]['SecurityGroup' ]['Properties' ]['SecurityGroupEgress' ]
62
61
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
84
83
stack_name = args .stack ,
85
84
cft_content = dump_yaml (cft ),
86
85
api_token = args .operator_key ,
86
+ image_id = args .ami ,
87
87
dc_cfg = dc_cfg ,
88
88
ip_address = ip ,
89
89
env = args .env )
0 commit comments