mirror of
https://github.com/langgenius/aws-cdk-for-dify.git
synced 2026-07-01 20:14:06 -04:00
731d835977
* 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>
32 lines
817 B
TypeScript
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 || '',
|
|
});
|
|
}
|
|
} |