Skip to content

Instantly share code, notes, and snippets.

@eladb
Created May 1, 2019 13:25
Show Gist options
  • Save eladb/9ab70f1de83c49e890e400b4b07fc57e to your computer and use it in GitHub Desktop.
Save eladb/9ab70f1de83c49e890e400b4b07fc57e to your computer and use it in GitHub Desktop.
import cdk = require('@aws-cdk/cdk');
import ec2 = require('@aws-cdk/aws-ec2');
import { Fn } from '@aws-cdk/cdk';
export class MyStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
this.node.setContext(`availability-zones:account=${this.env.account}:region=${this.env.region}`, [
Fn.select(0, Fn.getAZs()),
Fn.select(1, Fn.getAZs()),
Fn.select(2, Fn.getAZs())
]);
new ec2.VpcNetwork(this, 'vpc');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment