Files
Xiyuan Chen 731d835977 Fix/cdk update (#4)
* fix: wrong instruction order

* fix: add explanation for destroy

* add support for opensearch; add config for public rds

* fix: naming typo

* fix: naming

---------

Co-authored-by: GareArc <chen4851@purude.edu>
2024-08-27 17:20:25 +08:00

32 lines
817 B
TypeScript

import * as cdk from 'aws-cdk-lib';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
export class VPCStack extends cdk.Stack {
public readonly vpc: ec2.IVpc
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
this.vpc = new ec2.Vpc(this, id + "VPC", {
ipAddresses: ec2.IpAddresses.cidr('10.0.0.0/16'),
maxAzs: 3,
natGateways: 1
});
this.vpc.addGatewayEndpoint(id + "s3Endpoint", {
service: ec2.GatewayVpcEndpointAwsService.S3,
})
}
}
export class ImportedVPCStack extends cdk.Stack {
public readonly vpc: ec2.IVpc
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
this.vpc = ec2.Vpc.fromLookup(this, id + "VPC", {
vpcId: process.env.DEPLOY_VPC_ID || '',
});
}
}