@@ -19,11 +19,9 @@ constructor(scope: Construct, id: string, props: cdk.StackProps
1919 & { OSHostSecretName : string } ) {
2020 super ( scope , id , props ) ;
2121
22- // 选择所有的 isolated 和 private with egress 子网
2322 // const isolatedSubnets = this._vpc.selectSubnets({ subnetType: ec2.SubnetType.PRIVATE_ISOLATED }).subnets;
2423 // const privateSubnets = this._vpc.selectSubnets({ subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }).subnets;
2524
26- // 合并所有非公共子网
2725 // const nonPublicSubnets = [...isolatedSubnets, ...privateSubnets];
2826 // const subnets = this._vpc.selectSubnets().subnets;
2927
@@ -34,14 +32,6 @@ constructor(scope: Construct, id: string, props: cdk.StackProps
3432 { name : 'genbi-frontend' , dockerfile : 'Dockerfile' , port : 80 , dockerfileDirectory : path . join ( __dirname , '../../../../report-front-end' ) } ,
3533 ] ;
3634
37- // const repositoriesAndImages = services.map(service => {
38- // const dockerImageAsset = new DockerImageAsset(this, `${service.name}DockerImage`, {
39- // directory: service.dockerfileDirectory, // Dockerfile location
40- // file: service.dockerfile, // Dockerfile filename
41- // });
42- // return { dockerImageAsset, port: service.port };
43- // });
44-
4535 const GenBiStreamlitDockerImageAsset = { 'dockerImageAsset' : new DockerImageAsset ( this , 'GenBiStreamlitDockerImage' , {
4636 directory : services [ 0 ] . dockerfileDirectory ,
4737 file : services [ 0 ] . dockerfile ,
@@ -186,7 +176,7 @@ constructor(scope: Construct, id: string, props: cdk.StackProps
186176 taskDefinition : taskDefinitionStreamlit ,
187177 publicLoadBalancer : true ,
188178 taskSubnets : { subnets : props . subnets } ,
189- assignPublicIp : false
179+ assignPublicIp : true
190180 } ) ;
191181
192182 // ======= 2. API Service =======
@@ -226,7 +216,7 @@ constructor(scope: Construct, id: string, props: cdk.StackProps
226216 taskDefinition : taskDefinitionAPI ,
227217 publicLoadBalancer : true ,
228218 taskSubnets : { subnets : props . subnets } ,
229- assignPublicIp : false
219+ assignPublicIp : true
230220 } ) ;
231221
232222 // ======= 3. Frontend Service =======
@@ -273,7 +263,7 @@ constructor(scope: Construct, id: string, props: cdk.StackProps
273263 publicLoadBalancer : true ,
274264 // taskSubnets: { subnetType: ec2.SubnetType.PUBLIC },
275265 taskSubnets : { subnets : props . subnets } ,
276- assignPublicIp : false
266+ assignPublicIp : true
277267 } ) ;
278268
279269 this . streamlitEndpoint = fargateServiceStreamlit . loadBalancer . loadBalancerDnsName ;
0 commit comments