@nona-creative/aws-cdk-vpc
v1.0.2
Published
AWS VPC package with CDK
Downloads
5
Readme
AWS VPC (CDK)
Installation
npm i -S @nona-creative/aws-cdk-vpc
Usage
Create the VPC Stack
this.vpcStack = new VPCStack(this.scope, `${this.id}-vpc-${this.stage}`, { stage: this.stage })
This will also create a private and public Subnet and NAT Gateway, but no security groups.
Create Security Groups as needed eg.
this.vpcStack.createSecurityGroup({ name: LAMBDA_VPC_SECURITY_GROUP_NAME, description: 'Lambda Security Group for app VPC', }) this.vpcStack.createSecurityGroup({ name: RDS_VPC_SECURITY_GROUP_NAME, description: 'RDS Security Group for app VPC', allowAllOutbound: false, })
Create Ingress Rules as needed, eg.
this.vpcStack.addSecurityGroupIngressRule({ targetSecurityGroupName: RDS_VPC_SECURITY_GROUP_NAME, sourceSecurityGroupName: LAMBDA_VPC_SECURITY_GROUP_NAME, port: RDS_PORT, })