@@ -19,11 +19,9 @@ constructor(scope: Construct, id: string, props: cdk.StackProps
19
19
& { OSHostSecretName : string } ) {
20
20
super ( scope , id , props ) ;
21
21
22
- // 选择所有的 isolated 和 private with egress 子网
23
22
// const isolatedSubnets = this._vpc.selectSubnets({ subnetType: ec2.SubnetType.PRIVATE_ISOLATED }).subnets;
24
23
// const privateSubnets = this._vpc.selectSubnets({ subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }).subnets;
25
24
26
- // 合并所有非公共子网
27
25
// const nonPublicSubnets = [...isolatedSubnets, ...privateSubnets];
28
26
// const subnets = this._vpc.selectSubnets().subnets;
29
27
@@ -34,14 +32,6 @@ constructor(scope: Construct, id: string, props: cdk.StackProps
34
32
{ name : 'genbi-frontend' , dockerfile : 'Dockerfile' , port : 80 , dockerfileDirectory : path . join ( __dirname , '../../../../report-front-end' ) } ,
35
33
] ;
36
34
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
-
45
35
const GenBiStreamlitDockerImageAsset = { 'dockerImageAsset' : new DockerImageAsset ( this , 'GenBiStreamlitDockerImage' , {
46
36
directory : services [ 0 ] . dockerfileDirectory ,
47
37
file : services [ 0 ] . dockerfile ,
@@ -186,7 +176,7 @@ constructor(scope: Construct, id: string, props: cdk.StackProps
186
176
taskDefinition : taskDefinitionStreamlit ,
187
177
publicLoadBalancer : true ,
188
178
taskSubnets : { subnets : props . subnets } ,
189
- assignPublicIp : false
179
+ assignPublicIp : true
190
180
} ) ;
191
181
192
182
// ======= 2. API Service =======
@@ -226,7 +216,7 @@ constructor(scope: Construct, id: string, props: cdk.StackProps
226
216
taskDefinition : taskDefinitionAPI ,
227
217
publicLoadBalancer : true ,
228
218
taskSubnets : { subnets : props . subnets } ,
229
- assignPublicIp : false
219
+ assignPublicIp : true
230
220
} ) ;
231
221
232
222
// ======= 3. Frontend Service =======
@@ -273,7 +263,7 @@ constructor(scope: Construct, id: string, props: cdk.StackProps
273
263
publicLoadBalancer : true ,
274
264
// taskSubnets: { subnetType: ec2.SubnetType.PUBLIC },
275
265
taskSubnets : { subnets : props . subnets } ,
276
- assignPublicIp : false
266
+ assignPublicIp : true
277
267
} ) ;
278
268
279
269
this . streamlitEndpoint = fargateServiceStreamlit . loadBalancer . loadBalancerDnsName ;
0 commit comments