forked from aws/aws-cdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
awsecspatterns.go
8531 lines (7684 loc) · 260 KB
/
awsecspatterns.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package awsecspatterns
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/jsii"
_jsii_ "github.com/aws/jsii-runtime-go"
"github.com/aws/aws-cdk-go/awscdk"
"github.com/aws/aws-cdk-go/awscdk/awsapplicationautoscaling"
"github.com/aws/aws-cdk-go/awscdk/awscertificatemanager"
"github.com/aws/aws-cdk-go/awscdk/awsec2"
"github.com/aws/aws-cdk-go/awscdk/awsecs"
"github.com/aws/aws-cdk-go/awscdk/awsecspatterns/internal"
"github.com/aws/aws-cdk-go/awscdk/awselasticloadbalancingv2"
"github.com/aws/aws-cdk-go/awscdk/awsevents"
"github.com/aws/aws-cdk-go/awscdk/awseventstargets"
"github.com/aws/aws-cdk-go/awscdk/awsiam"
"github.com/aws/aws-cdk-go/awscdk/awsroute53"
"github.com/aws/aws-cdk-go/awscdk/awssqs"
"github.com/aws/constructs-go/constructs/v3"
)
// Properties to define an application listener.
// Experimental.
type ApplicationListenerProps struct {
// Name of the listener.
// Experimental.
Name *string `json:"name"`
// Certificate Manager certificate to associate with the load balancer.
//
// Setting this option will set the load balancer protocol to HTTPS.
// Experimental.
Certificate awscertificatemanager.ICertificate `json:"certificate"`
// The port on which the listener listens for requests.
// Experimental.
Port *float64 `json:"port"`
// The protocol for connections from clients to the load balancer.
//
// The load balancer port is determined from the protocol (port 80 for
// HTTP, port 443 for HTTPS). A domain name and zone must be also be
// specified if using HTTPS.
// Experimental.
Protocol awselasticloadbalancingv2.ApplicationProtocol `json:"protocol"`
}
// An EC2 service running on an ECS cluster fronted by an application load balancer.
// Experimental.
type ApplicationLoadBalancedEc2Service interface {
ApplicationLoadBalancedServiceBase
Certificate() awscertificatemanager.ICertificate
Cluster() awsecs.ICluster
DesiredCount() *float64
InternalDesiredCount() *float64
Listener() awselasticloadbalancingv2.ApplicationListener
LoadBalancer() awselasticloadbalancingv2.ApplicationLoadBalancer
Node() awscdk.ConstructNode
RedirectListener() awselasticloadbalancingv2.ApplicationListener
Service() awsecs.Ec2Service
TargetGroup() awselasticloadbalancingv2.ApplicationTargetGroup
TaskDefinition() awsecs.Ec2TaskDefinition
AddServiceAsTarget(service awsecs.BaseService)
CreateAWSLogDriver(prefix *string) awsecs.AwsLogDriver
GetDefaultCluster(scope awscdk.Construct, vpc awsec2.IVpc) awsecs.Cluster
OnPrepare()
OnSynthesize(session constructs.ISynthesisSession)
OnValidate() *[]*string
Prepare()
Synthesize(session awscdk.ISynthesisSession)
ToString() *string
Validate() *[]*string
}
// The jsii proxy struct for ApplicationLoadBalancedEc2Service
type jsiiProxy_ApplicationLoadBalancedEc2Service struct {
jsiiProxy_ApplicationLoadBalancedServiceBase
}
func (j *jsiiProxy_ApplicationLoadBalancedEc2Service) Certificate() awscertificatemanager.ICertificate {
var returns awscertificatemanager.ICertificate
_jsii_.Get(
j,
"certificate",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedEc2Service) Cluster() awsecs.ICluster {
var returns awsecs.ICluster
_jsii_.Get(
j,
"cluster",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedEc2Service) DesiredCount() *float64 {
var returns *float64
_jsii_.Get(
j,
"desiredCount",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedEc2Service) InternalDesiredCount() *float64 {
var returns *float64
_jsii_.Get(
j,
"internalDesiredCount",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedEc2Service) Listener() awselasticloadbalancingv2.ApplicationListener {
var returns awselasticloadbalancingv2.ApplicationListener
_jsii_.Get(
j,
"listener",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedEc2Service) LoadBalancer() awselasticloadbalancingv2.ApplicationLoadBalancer {
var returns awselasticloadbalancingv2.ApplicationLoadBalancer
_jsii_.Get(
j,
"loadBalancer",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedEc2Service) Node() awscdk.ConstructNode {
var returns awscdk.ConstructNode
_jsii_.Get(
j,
"node",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedEc2Service) RedirectListener() awselasticloadbalancingv2.ApplicationListener {
var returns awselasticloadbalancingv2.ApplicationListener
_jsii_.Get(
j,
"redirectListener",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedEc2Service) Service() awsecs.Ec2Service {
var returns awsecs.Ec2Service
_jsii_.Get(
j,
"service",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedEc2Service) TargetGroup() awselasticloadbalancingv2.ApplicationTargetGroup {
var returns awselasticloadbalancingv2.ApplicationTargetGroup
_jsii_.Get(
j,
"targetGroup",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedEc2Service) TaskDefinition() awsecs.Ec2TaskDefinition {
var returns awsecs.Ec2TaskDefinition
_jsii_.Get(
j,
"taskDefinition",
&returns,
)
return returns
}
// Constructs a new instance of the ApplicationLoadBalancedEc2Service class.
// Experimental.
func NewApplicationLoadBalancedEc2Service(scope constructs.Construct, id *string, props *ApplicationLoadBalancedEc2ServiceProps) ApplicationLoadBalancedEc2Service {
_init_.Initialize()
j := jsiiProxy_ApplicationLoadBalancedEc2Service{}
_jsii_.Create(
"monocdk.aws_ecs_patterns.ApplicationLoadBalancedEc2Service",
[]interface{}{scope, id, props},
&j,
)
return &j
}
// Constructs a new instance of the ApplicationLoadBalancedEc2Service class.
// Experimental.
func NewApplicationLoadBalancedEc2Service_Override(a ApplicationLoadBalancedEc2Service, scope constructs.Construct, id *string, props *ApplicationLoadBalancedEc2ServiceProps) {
_init_.Initialize()
_jsii_.Create(
"monocdk.aws_ecs_patterns.ApplicationLoadBalancedEc2Service",
[]interface{}{scope, id, props},
a,
)
}
// Return whether the given object is a Construct.
// Experimental.
func ApplicationLoadBalancedEc2Service_IsConstruct(x interface{}) *bool {
_init_.Initialize()
var returns *bool
_jsii_.StaticInvoke(
"monocdk.aws_ecs_patterns.ApplicationLoadBalancedEc2Service",
"isConstruct",
[]interface{}{x},
&returns,
)
return returns
}
// Adds service as a target of the target group.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedEc2Service) AddServiceAsTarget(service awsecs.BaseService) {
_jsii_.InvokeVoid(
a,
"addServiceAsTarget",
[]interface{}{service},
)
}
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedEc2Service) CreateAWSLogDriver(prefix *string) awsecs.AwsLogDriver {
var returns awsecs.AwsLogDriver
_jsii_.Invoke(
a,
"createAWSLogDriver",
[]interface{}{prefix},
&returns,
)
return returns
}
// Returns the default cluster.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedEc2Service) GetDefaultCluster(scope awscdk.Construct, vpc awsec2.IVpc) awsecs.Cluster {
var returns awsecs.Cluster
_jsii_.Invoke(
a,
"getDefaultCluster",
[]interface{}{scope, vpc},
&returns,
)
return returns
}
// Perform final modifications before synthesis.
//
// This method can be implemented by derived constructs in order to perform
// final changes before synthesis. prepare() will be called after child
// constructs have been prepared.
//
// This is an advanced framework feature. Only use this if you
// understand the implications.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedEc2Service) OnPrepare() {
_jsii_.InvokeVoid(
a,
"onPrepare",
nil, // no parameters
)
}
// Allows this construct to emit artifacts into the cloud assembly during synthesis.
//
// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
// as they participate in synthesizing the cloud assembly.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedEc2Service) OnSynthesize(session constructs.ISynthesisSession) {
_jsii_.InvokeVoid(
a,
"onSynthesize",
[]interface{}{session},
)
}
// Validate the current construct.
//
// This method can be implemented by derived constructs in order to perform
// validation logic. It is called on all constructs before synthesis.
//
// Returns: An array of validation error messages, or an empty array if the construct is valid.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedEc2Service) OnValidate() *[]*string {
var returns *[]*string
_jsii_.Invoke(
a,
"onValidate",
nil, // no parameters
&returns,
)
return returns
}
// Perform final modifications before synthesis.
//
// This method can be implemented by derived constructs in order to perform
// final changes before synthesis. prepare() will be called after child
// constructs have been prepared.
//
// This is an advanced framework feature. Only use this if you
// understand the implications.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedEc2Service) Prepare() {
_jsii_.InvokeVoid(
a,
"prepare",
nil, // no parameters
)
}
// Allows this construct to emit artifacts into the cloud assembly during synthesis.
//
// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
// as they participate in synthesizing the cloud assembly.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedEc2Service) Synthesize(session awscdk.ISynthesisSession) {
_jsii_.InvokeVoid(
a,
"synthesize",
[]interface{}{session},
)
}
// Returns a string representation of this construct.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedEc2Service) ToString() *string {
var returns *string
_jsii_.Invoke(
a,
"toString",
nil, // no parameters
&returns,
)
return returns
}
// Validate the current construct.
//
// This method can be implemented by derived constructs in order to perform
// validation logic. It is called on all constructs before synthesis.
//
// Returns: An array of validation error messages, or an empty array if the construct is valid.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedEc2Service) Validate() *[]*string {
var returns *[]*string
_jsii_.Invoke(
a,
"validate",
nil, // no parameters
&returns,
)
return returns
}
// The properties for the ApplicationLoadBalancedEc2Service service.
// Experimental.
type ApplicationLoadBalancedEc2ServiceProps struct {
// Certificate Manager certificate to associate with the load balancer.
//
// Setting this option will set the load balancer protocol to HTTPS.
// Experimental.
Certificate awscertificatemanager.ICertificate `json:"certificate"`
// Whether to enable the deployment circuit breaker.
//
// If this property is defined, circuit breaker will be implicitly
// enabled.
// Experimental.
CircuitBreaker *awsecs.DeploymentCircuitBreaker `json:"circuitBreaker"`
// The options for configuring an Amazon ECS service to use service discovery.
// Experimental.
CloudMapOptions *awsecs.CloudMapOptions `json:"cloudMapOptions"`
// The name of the cluster that hosts the service.
//
// If a cluster is specified, the vpc construct should be omitted. Alternatively, you can omit both cluster and vpc.
// Experimental.
Cluster awsecs.ICluster `json:"cluster"`
// Specifies which deployment controller to use for the service.
//
// For more information, see
// [Amazon ECS Deployment Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html)
// Experimental.
DeploymentController *awsecs.DeploymentController `json:"deploymentController"`
// The desired number of instantiations of the task definition to keep running on the service.
//
// The minimum value is 1
// Experimental.
DesiredCount *float64 `json:"desiredCount"`
// The domain name for the service, e.g. "api.example.com.".
// Experimental.
DomainName *string `json:"domainName"`
// The Route53 hosted zone for the domain, e.g. "example.com.".
// Experimental.
DomainZone awsroute53.IHostedZone `json:"domainZone"`
// Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
//
// For more information, see
// [Tagging Your Amazon ECS Resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html)
// Experimental.
EnableECSManagedTags *bool `json:"enableECSManagedTags"`
// The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.
// Experimental.
HealthCheckGracePeriod awscdk.Duration `json:"healthCheckGracePeriod"`
// Listener port of the application load balancer that will serve traffic to the service.
// Experimental.
ListenerPort *float64 `json:"listenerPort"`
// The application load balancer that will serve traffic to the service.
//
// The VPC attribute of a load balancer must be specified for it to be used
// to create a new service with this pattern.
//
// [disable-awslint:ref-via-interface]
// Experimental.
LoadBalancer awselasticloadbalancingv2.IApplicationLoadBalancer `json:"loadBalancer"`
// The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.
// Experimental.
MaxHealthyPercent *float64 `json:"maxHealthyPercent"`
// The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment.
// Experimental.
MinHealthyPercent *float64 `json:"minHealthyPercent"`
// Determines whether or not the Security Group for the Load Balancer's Listener will be open to all traffic by default.
// Experimental.
OpenListener *bool `json:"openListener"`
// Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.
//
// Tags can only be propagated to the tasks within the service during service creation.
// Experimental.
PropagateTags awsecs.PropagatedTagSource `json:"propagateTags"`
// The protocol for connections from clients to the load balancer.
//
// The load balancer port is determined from the protocol (port 80 for
// HTTP, port 443 for HTTPS). A domain name and zone must be also be
// specified if using HTTPS.
// Experimental.
Protocol awselasticloadbalancingv2.ApplicationProtocol `json:"protocol"`
// Determines whether the Load Balancer will be internet-facing.
// Experimental.
PublicLoadBalancer *bool `json:"publicLoadBalancer"`
// Specifies whether the Route53 record should be a CNAME, an A record using the Alias feature or no record at all.
//
// This is useful if you need to work with DNS systems that do not support alias records.
// Experimental.
RecordType ApplicationLoadBalancedServiceRecordType `json:"recordType"`
// Specifies whether the load balancer should redirect traffic on port 80 to port 443 to support HTTP->HTTPS redirects This is only valid if the protocol of the ALB is HTTPS.
// Experimental.
RedirectHTTP *bool `json:"redirectHTTP"`
// The name of the service.
// Experimental.
ServiceName *string `json:"serviceName"`
// The protocol for connections from the load balancer to the ECS tasks.
//
// The default target port is determined from the protocol (port 80 for
// HTTP, port 443 for HTTPS).
// Experimental.
TargetProtocol awselasticloadbalancingv2.ApplicationProtocol `json:"targetProtocol"`
// The properties required to create a new task definition.
//
// TaskDefinition or TaskImageOptions must be specified, but not both.
// Experimental.
TaskImageOptions *ApplicationLoadBalancedTaskImageOptions `json:"taskImageOptions"`
// The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.
//
// If a vpc is specified, the cluster construct should be omitted. Alternatively, you can omit both vpc and cluster.
// Experimental.
Vpc awsec2.IVpc `json:"vpc"`
// The number of cpu units used by the task.
//
// Valid values, which determines your range of valid values for the memory parameter:
//
// 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB
//
// 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB
//
// 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB
//
// 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments
//
// 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments
//
// This default is set in the underlying FargateTaskDefinition construct.
// Experimental.
Cpu *float64 `json:"cpu"`
// The hard limit (in MiB) of memory to present to the container.
//
// If your container attempts to exceed the allocated memory, the container
// is terminated.
//
// At least one of memoryLimitMiB and memoryReservationMiB is required.
// Experimental.
MemoryLimitMiB *float64 `json:"memoryLimitMiB"`
// The soft limit (in MiB) of memory to reserve for the container.
//
// When system memory is under contention, Docker attempts to keep the
// container memory within the limit. If the container requires more memory,
// it can consume up to the value specified by the Memory property or all of
// the available memory on the container instance—whichever comes first.
//
// At least one of memoryLimitMiB and memoryReservationMiB is required.
// Experimental.
MemoryReservationMiB *float64 `json:"memoryReservationMiB"`
// The task definition to use for tasks in the service. TaskDefinition or TaskImageOptions must be specified, but not both..
//
// [disable-awslint:ref-via-interface]
// Experimental.
TaskDefinition awsecs.Ec2TaskDefinition `json:"taskDefinition"`
}
// A Fargate service running on an ECS cluster fronted by an application load balancer.
// Experimental.
type ApplicationLoadBalancedFargateService interface {
ApplicationLoadBalancedServiceBase
AssignPublicIp() *bool
Certificate() awscertificatemanager.ICertificate
Cluster() awsecs.ICluster
DesiredCount() *float64
InternalDesiredCount() *float64
Listener() awselasticloadbalancingv2.ApplicationListener
LoadBalancer() awselasticloadbalancingv2.ApplicationLoadBalancer
Node() awscdk.ConstructNode
RedirectListener() awselasticloadbalancingv2.ApplicationListener
Service() awsecs.FargateService
TargetGroup() awselasticloadbalancingv2.ApplicationTargetGroup
TaskDefinition() awsecs.FargateTaskDefinition
AddServiceAsTarget(service awsecs.BaseService)
CreateAWSLogDriver(prefix *string) awsecs.AwsLogDriver
GetDefaultCluster(scope awscdk.Construct, vpc awsec2.IVpc) awsecs.Cluster
OnPrepare()
OnSynthesize(session constructs.ISynthesisSession)
OnValidate() *[]*string
Prepare()
Synthesize(session awscdk.ISynthesisSession)
ToString() *string
Validate() *[]*string
}
// The jsii proxy struct for ApplicationLoadBalancedFargateService
type jsiiProxy_ApplicationLoadBalancedFargateService struct {
jsiiProxy_ApplicationLoadBalancedServiceBase
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) AssignPublicIp() *bool {
var returns *bool
_jsii_.Get(
j,
"assignPublicIp",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) Certificate() awscertificatemanager.ICertificate {
var returns awscertificatemanager.ICertificate
_jsii_.Get(
j,
"certificate",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) Cluster() awsecs.ICluster {
var returns awsecs.ICluster
_jsii_.Get(
j,
"cluster",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) DesiredCount() *float64 {
var returns *float64
_jsii_.Get(
j,
"desiredCount",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) InternalDesiredCount() *float64 {
var returns *float64
_jsii_.Get(
j,
"internalDesiredCount",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) Listener() awselasticloadbalancingv2.ApplicationListener {
var returns awselasticloadbalancingv2.ApplicationListener
_jsii_.Get(
j,
"listener",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) LoadBalancer() awselasticloadbalancingv2.ApplicationLoadBalancer {
var returns awselasticloadbalancingv2.ApplicationLoadBalancer
_jsii_.Get(
j,
"loadBalancer",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) Node() awscdk.ConstructNode {
var returns awscdk.ConstructNode
_jsii_.Get(
j,
"node",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) RedirectListener() awselasticloadbalancingv2.ApplicationListener {
var returns awselasticloadbalancingv2.ApplicationListener
_jsii_.Get(
j,
"redirectListener",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) Service() awsecs.FargateService {
var returns awsecs.FargateService
_jsii_.Get(
j,
"service",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) TargetGroup() awselasticloadbalancingv2.ApplicationTargetGroup {
var returns awselasticloadbalancingv2.ApplicationTargetGroup
_jsii_.Get(
j,
"targetGroup",
&returns,
)
return returns
}
func (j *jsiiProxy_ApplicationLoadBalancedFargateService) TaskDefinition() awsecs.FargateTaskDefinition {
var returns awsecs.FargateTaskDefinition
_jsii_.Get(
j,
"taskDefinition",
&returns,
)
return returns
}
// Constructs a new instance of the ApplicationLoadBalancedFargateService class.
// Experimental.
func NewApplicationLoadBalancedFargateService(scope constructs.Construct, id *string, props *ApplicationLoadBalancedFargateServiceProps) ApplicationLoadBalancedFargateService {
_init_.Initialize()
j := jsiiProxy_ApplicationLoadBalancedFargateService{}
_jsii_.Create(
"monocdk.aws_ecs_patterns.ApplicationLoadBalancedFargateService",
[]interface{}{scope, id, props},
&j,
)
return &j
}
// Constructs a new instance of the ApplicationLoadBalancedFargateService class.
// Experimental.
func NewApplicationLoadBalancedFargateService_Override(a ApplicationLoadBalancedFargateService, scope constructs.Construct, id *string, props *ApplicationLoadBalancedFargateServiceProps) {
_init_.Initialize()
_jsii_.Create(
"monocdk.aws_ecs_patterns.ApplicationLoadBalancedFargateService",
[]interface{}{scope, id, props},
a,
)
}
// Return whether the given object is a Construct.
// Experimental.
func ApplicationLoadBalancedFargateService_IsConstruct(x interface{}) *bool {
_init_.Initialize()
var returns *bool
_jsii_.StaticInvoke(
"monocdk.aws_ecs_patterns.ApplicationLoadBalancedFargateService",
"isConstruct",
[]interface{}{x},
&returns,
)
return returns
}
// Adds service as a target of the target group.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedFargateService) AddServiceAsTarget(service awsecs.BaseService) {
_jsii_.InvokeVoid(
a,
"addServiceAsTarget",
[]interface{}{service},
)
}
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedFargateService) CreateAWSLogDriver(prefix *string) awsecs.AwsLogDriver {
var returns awsecs.AwsLogDriver
_jsii_.Invoke(
a,
"createAWSLogDriver",
[]interface{}{prefix},
&returns,
)
return returns
}
// Returns the default cluster.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedFargateService) GetDefaultCluster(scope awscdk.Construct, vpc awsec2.IVpc) awsecs.Cluster {
var returns awsecs.Cluster
_jsii_.Invoke(
a,
"getDefaultCluster",
[]interface{}{scope, vpc},
&returns,
)
return returns
}
// Perform final modifications before synthesis.
//
// This method can be implemented by derived constructs in order to perform
// final changes before synthesis. prepare() will be called after child
// constructs have been prepared.
//
// This is an advanced framework feature. Only use this if you
// understand the implications.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedFargateService) OnPrepare() {
_jsii_.InvokeVoid(
a,
"onPrepare",
nil, // no parameters
)
}
// Allows this construct to emit artifacts into the cloud assembly during synthesis.
//
// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
// as they participate in synthesizing the cloud assembly.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedFargateService) OnSynthesize(session constructs.ISynthesisSession) {
_jsii_.InvokeVoid(
a,
"onSynthesize",
[]interface{}{session},
)
}
// Validate the current construct.
//
// This method can be implemented by derived constructs in order to perform
// validation logic. It is called on all constructs before synthesis.
//
// Returns: An array of validation error messages, or an empty array if the construct is valid.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedFargateService) OnValidate() *[]*string {
var returns *[]*string
_jsii_.Invoke(
a,
"onValidate",
nil, // no parameters
&returns,
)
return returns
}
// Perform final modifications before synthesis.
//
// This method can be implemented by derived constructs in order to perform
// final changes before synthesis. prepare() will be called after child
// constructs have been prepared.
//
// This is an advanced framework feature. Only use this if you
// understand the implications.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedFargateService) Prepare() {
_jsii_.InvokeVoid(
a,
"prepare",
nil, // no parameters
)
}
// Allows this construct to emit artifacts into the cloud assembly during synthesis.
//
// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
// as they participate in synthesizing the cloud assembly.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedFargateService) Synthesize(session awscdk.ISynthesisSession) {
_jsii_.InvokeVoid(
a,
"synthesize",
[]interface{}{session},
)
}
// Returns a string representation of this construct.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedFargateService) ToString() *string {
var returns *string
_jsii_.Invoke(
a,
"toString",
nil, // no parameters
&returns,
)
return returns
}
// Validate the current construct.
//
// This method can be implemented by derived constructs in order to perform
// validation logic. It is called on all constructs before synthesis.
//
// Returns: An array of validation error messages, or an empty array if the construct is valid.
// Experimental.
func (a *jsiiProxy_ApplicationLoadBalancedFargateService) Validate() *[]*string {
var returns *[]*string
_jsii_.Invoke(
a,
"validate",
nil, // no parameters
&returns,
)
return returns
}
// The properties for the ApplicationLoadBalancedFargateService service.
// Experimental.
type ApplicationLoadBalancedFargateServiceProps struct {
// Certificate Manager certificate to associate with the load balancer.
//
// Setting this option will set the load balancer protocol to HTTPS.
// Experimental.
Certificate awscertificatemanager.ICertificate `json:"certificate"`
// Whether to enable the deployment circuit breaker.
//
// If this property is defined, circuit breaker will be implicitly
// enabled.
// Experimental.
CircuitBreaker *awsecs.DeploymentCircuitBreaker `json:"circuitBreaker"`
// The options for configuring an Amazon ECS service to use service discovery.
// Experimental.
CloudMapOptions *awsecs.CloudMapOptions `json:"cloudMapOptions"`
// The name of the cluster that hosts the service.
//
// If a cluster is specified, the vpc construct should be omitted. Alternatively, you can omit both cluster and vpc.
// Experimental.
Cluster awsecs.ICluster `json:"cluster"`
// Specifies which deployment controller to use for the service.
//
// For more information, see
// [Amazon ECS Deployment Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html)
// Experimental.
DeploymentController *awsecs.DeploymentController `json:"deploymentController"`
// The desired number of instantiations of the task definition to keep running on the service.
//
// The minimum value is 1
// Experimental.
DesiredCount *float64 `json:"desiredCount"`
// The domain name for the service, e.g. "api.example.com.".
// Experimental.
DomainName *string `json:"domainName"`
// The Route53 hosted zone for the domain, e.g. "example.com.".
// Experimental.
DomainZone awsroute53.IHostedZone `json:"domainZone"`
// Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
//
// For more information, see
// [Tagging Your Amazon ECS Resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html)
// Experimental.
EnableECSManagedTags *bool `json:"enableECSManagedTags"`
// The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.
// Experimental.
HealthCheckGracePeriod awscdk.Duration `json:"healthCheckGracePeriod"`
// Listener port of the application load balancer that will serve traffic to the service.
// Experimental.
ListenerPort *float64 `json:"listenerPort"`
// The application load balancer that will serve traffic to the service.
//
// The VPC attribute of a load balancer must be specified for it to be used
// to create a new service with this pattern.
//
// [disable-awslint:ref-via-interface]
// Experimental.
LoadBalancer awselasticloadbalancingv2.IApplicationLoadBalancer `json:"loadBalancer"`
// The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.
// Experimental.
MaxHealthyPercent *float64 `json:"maxHealthyPercent"`
// The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment.
// Experimental.
MinHealthyPercent *float64 `json:"minHealthyPercent"`
// Determines whether or not the Security Group for the Load Balancer's Listener will be open to all traffic by default.
// Experimental.
OpenListener *bool `json:"openListener"`
// Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.
//
// Tags can only be propagated to the tasks within the service during service creation.
// Experimental.
PropagateTags awsecs.PropagatedTagSource `json:"propagateTags"`
// The protocol for connections from clients to the load balancer.
//
// The load balancer port is determined from the protocol (port 80 for
// HTTP, port 443 for HTTPS). A domain name and zone must be also be
// specified if using HTTPS.
// Experimental.
Protocol awselasticloadbalancingv2.ApplicationProtocol `json:"protocol"`
// Determines whether the Load Balancer will be internet-facing.
// Experimental.
PublicLoadBalancer *bool `json:"publicLoadBalancer"`
// Specifies whether the Route53 record should be a CNAME, an A record using the Alias feature or no record at all.
//
// This is useful if you need to work with DNS systems that do not support alias records.
// Experimental.
RecordType ApplicationLoadBalancedServiceRecordType `json:"recordType"`
// Specifies whether the load balancer should redirect traffic on port 80 to port 443 to support HTTP->HTTPS redirects This is only valid if the protocol of the ALB is HTTPS.
// Experimental.
RedirectHTTP *bool `json:"redirectHTTP"`
// The name of the service.
// Experimental.
ServiceName *string `json:"serviceName"`
// The protocol for connections from the load balancer to the ECS tasks.
//
// The default target port is determined from the protocol (port 80 for
// HTTP, port 443 for HTTPS).
// Experimental.
TargetProtocol awselasticloadbalancingv2.ApplicationProtocol `json:"targetProtocol"`
// The properties required to create a new task definition.
//
// TaskDefinition or TaskImageOptions must be specified, but not both.
// Experimental.
TaskImageOptions *ApplicationLoadBalancedTaskImageOptions `json:"taskImageOptions"`
// The VPC where the container instances will be launched or the elastic network interfaces (ENIs) will be deployed.
//
// If a vpc is specified, the cluster construct should be omitted. Alternatively, you can omit both vpc and cluster.
// Experimental.