@@ -20,14 +20,10 @@ export interface EcsServiceStackProps extends StackProps {
20
20
vpc : string ;
21
21
subnets : string [ ] ;
22
22
23
- // domain
24
23
domainName : string ;
25
- // domainZone: string;
26
- // certificate: string;
27
24
28
25
// default resources
29
26
desiredCount : number ;
30
-
31
27
priority : number ;
32
28
33
29
// task definition
@@ -74,7 +70,6 @@ export class EcsServiceStack extends Stack {
74
70
constructor ( scope : Construct , id : string , props : EcsServiceStackProps ) {
75
71
super ( scope , id , props ) ;
76
72
const { desiredCount } = props ;
77
- console . log ( props ) ;
78
73
79
74
const vpc = ec2 . Vpc . fromLookup ( this , "ecs-service-vpc" , { vpcName : props . vpc } ) ;
80
75
// const subnets = props.subnets.map((subnet) => ec2.Subnet.fromSubnetId(this, `ecs-service-subnet-${subnet}`, subnet));
@@ -88,29 +83,6 @@ export class EcsServiceStack extends Stack {
88
83
} ,
89
84
} ) ;
90
85
91
- // cluster,
92
- // // domainName: props.domainName,
93
- // // domainZone: route53.HostedZone.fromLookup(this, "ecs-service-hosted-zone", { domainName: props.domainZone }),
94
- // // publicLoadBalancer: false,
95
- // enableExecuteCommand: true,
96
- // // protocol: elbv2.ApplicationProtocol.HTTPS,
97
- // // loadBalancer: elbv2.ApplicationLoadBalancer.fromLookup(this, "ecs-service-load-balancer", { loadBalancerTags: { Name: tier } }),
98
- // loadBalancer: elbv2.ApplicationLoadBalancer.fromLookup(this, "ecs-service-load-balancer", { loadBalancerTags: { Name: tier } }),
99
- // // targetProtocol: elbv2.ApplicationProtocol.HTTPS,
100
- // // listenerPort: 443,
101
- // // certificate: cm.Certificate.fromCertificateArn(this, "ecs-service-certificate", props.certificate),
102
- // // loadBalancerName: prefix,
103
- // // openListener: true,
104
- // // openListener: !Boolean(props.allowedIngress),
105
- // serviceName: id,
106
- // // redirectHTTP: true,
107
- // desiredCount: props.desiredCount,
108
- // recordType: ApplicationLoadBalancedServiceRecordType.NONE,
109
- // // taskDefinition,
110
- // taskImageOptions: {
111
- // image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
112
- // },
113
-
114
86
const executionRole = new iam . Role ( this , "ecs-task-execution-role" , {
115
87
assumedBy : new iam . ServicePrincipal ( "ecs-tasks.amazonaws.com" ) ,
116
88
roleName : `power-user-${ prefix } -task-execution-role` . slice ( 0 , 64 ) ,
@@ -183,15 +155,6 @@ export class EcsServiceStack extends Stack {
183
155
}
184
156
}
185
157
186
- // // Add Apache container
187
- // const container = taskDefinition.addContainer("ecs-container-0", {
188
- // image: ecs.ContainerImage.fromRegistry("httpd"),
189
- // portMappings: [{ containerPort: 80 }],
190
- // logging: ecs.LogDrivers.awsLogs({
191
- // streamPrefix: "apache-service",
192
- // }),
193
- // });
194
-
195
158
const service = new ecs . FargateService ( this , "ecs-service" , {
196
159
cluster,
197
160
desiredCount,
@@ -239,40 +202,5 @@ export class EcsServiceStack extends Stack {
239
202
} ) ;
240
203
241
204
242
- // const loadBalancer = new elbv2.ApplicationLoadBalancer(this, "ecs-service-load-balancer", {
243
- // vpc,
244
- // vpcSubnets: { subnetFilters: [ec2.SubnetFilter.onePerAz()] },
245
- // internetFacing: false,
246
- // loadBalancerName: prefix,
247
- // idleTimeout: Duration.seconds(60),
248
- // });
249
-
250
- // console.log({ loadBalancerTags: { Name: tier }})
251
- // const service = new ApplicationLoadBalancedFargateService(this, "ecs-service", {
252
- // cluster,
253
- // // domainName: props.domainName,
254
- // // domainZone: route53.HostedZone.fromLookup(this, "ecs-service-hosted-zone", { domainName: props.domainZone }),
255
- // // publicLoadBalancer: false,
256
- // enableExecuteCommand: true,
257
- // // protocol: elbv2.ApplicationProtocol.HTTPS,
258
- // // loadBalancer: elbv2.ApplicationLoadBalancer.fromLookup(this, "ecs-service-load-balancer", { loadBalancerTags: { Name: tier } }),
259
- // loadBalancer: elbv2.ApplicationLoadBalancer.fromLookup(this, "ecs-service-load-balancer", { loadBalancerTags: { Name: tier } }),
260
- // // targetProtocol: elbv2.ApplicationProtocol.HTTPS,
261
- // // listenerPort: 443,
262
- // // certificate: cm.Certificate.fromCertificateArn(this, "ecs-service-certificate", props.certificate),
263
- // // loadBalancerName: prefix,
264
- // // openListener: true,
265
- // // openListener: !Boolean(props.allowedIngress),
266
- // serviceName: id,
267
- // // redirectHTTP: true,
268
- // desiredCount: props.desiredCount,
269
- // recordType: ApplicationLoadBalancedServiceRecordType.NONE,
270
- // // taskDefinition,
271
- // taskImageOptions: {
272
- // image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
273
- // },
274
- // });
275
-
276
-
277
205
}
278
206
}
0 commit comments