backend-and-orchestration-t.../cdk/ts/MSK_example/lib/Vpc.ts
Mia von Steinkirch 4a5d6f56a6 🧆 update readme:
2020-01-21 15:59:50 -08:00

19 lines
572 B
TypeScript

import cdk = require('@aws-cdk/core');
import ec2 = require("@aws-cdk/aws-ec2");
export class VPCStack extends cdk.Stack {
readonly Vpc: ec2.IVpc;
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const current_env = this.node.tryGetContext("env.type");
const vpc_cidr = this.node.tryGetContext("vpc.cidr");
const vpc_maxAzs = this.node.tryGetContext("vpc.maxAzs");
const vpc = new ec2.Vpc(this, current_env+"Vpc", {
cidr: vpc_cidr,
maxAzs: vpc_maxAzs
});
this.Vpc = vpc;
}
}