Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/aws/create_cloudformation_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ def create_egress(url, description):
def get_port(url):
return url.split(":")[2]

def create_cloudformation_stack(client, stack_name, cft_content, api_token, dc_cfg, ip_address, env):
def create_cloudformation_stack(client, stack_name, cft_content, api_token, dc_cfg, ip_address, env, image_id):
result = client.create_stack(
StackName=stack_name,
TemplateBody=cft_content,
Capabilities=['CAPABILITY_IAM'],
Parameters=[
{ 'ParameterKey': 'APIToken', 'ParameterValue': api_token },
{ 'ParameterKey': 'ImageId', 'ParameterValue': image_id },
{ 'ParameterKey': 'DeployToEnvironment', 'ParameterValue': "prod" if env == "prod" else "integ" }, # Mock env also uses integ
{ 'ParameterKey': 'VpcId', 'ParameterValue': dc_cfg['VpcId'] },
{ 'ParameterKey': 'VpcSubnet1', 'ParameterValue': dc_cfg['VpcSubnet1'] },
Expand Down Expand Up @@ -55,8 +56,6 @@ def create_cloudformation_stack(client, stack_name, cft_content, api_token, dc_c
with open('{}/{}_CloudFormation.template.yml'.format(args.cftemplate_fp, args.scope), 'r') as f:
cft = load_yaml(f)

cft['Mappings']['RegionMap'][args.region]['AMI'] = args.ami

if args.env == "mock":
egress = cft['Resources']['SecurityGroup']['Properties']['SecurityGroupEgress']
egress.append(create_egress(args.core_url, 'E2E - Core'))
Expand Down Expand Up @@ -84,6 +83,7 @@ def create_cloudformation_stack(client, stack_name, cft_content, api_token, dc_c
stack_name=args.stack,
cft_content=dump_yaml(cft),
api_token=args.operator_key,
image_id=args.ami,
dc_cfg=dc_cfg,
ip_address=ip,
env=args.env)