#!/usr/bin/env python3 from aws_cdk import core from cdk.vpc_stack import VpcStack from cdk.ecs_stack import EcsStack app = core.App() # Params and stage info stage = app.node.try_get_context('stage') props = app.node.try_get_context(stage) service = app.node.try_get_context('serviceName') app_id = app.node.try_get_context('appId') cost_centre = app.node.try_get_context('costCentre') dcl = app.node.try_get_context('dcl') region = app.node.try_get_context(stage)['region'] account = app.node.try_get_context(stage)['account'] # Build out stack VpcStack(app, "{0}-{1}".format(service, stage), props=props, env={'region': region, 'account': account}) # Tagging core.Tag.add(app, 't_environment', stage.upper()) core.Tag.add(app, 't_AppID', app_id) core.Tag.add(app, 't_cost_centre', cost_centre) core.Tag.add(app, 't_dcl', dcl) core.Tag.add(app, 'Application', service) # Synth the CF template app.synth()