/
service.go
845 lines (770 loc) · 55.8 KB
/
service.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
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package ecs
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// > **Note:** To prevent a race condition during service deletion, make sure to set `dependsOn` to the related `iam.RolePolicy`; otherwise, the policy may be destroyed too soon and the ECS service will then get stuck in the `DRAINING` state.
//
// Provides an ECS service - effectively a task that is expected to run until an error occurs or a user terminates it (typically a webserver or a database).
//
// See [ECS Services section in AWS developer guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html).
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecs"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ecs.NewService(ctx, "mongo", &ecs.ServiceArgs{
// Name: pulumi.String("mongodb"),
// Cluster: pulumi.Any(fooAwsEcsCluster.Id),
// TaskDefinition: pulumi.Any(mongoAwsEcsTaskDefinition.Arn),
// DesiredCount: pulumi.Int(3),
// IamRole: pulumi.Any(fooAwsIamRole.Arn),
// OrderedPlacementStrategies: ecs.ServiceOrderedPlacementStrategyArray{
// &ecs.ServiceOrderedPlacementStrategyArgs{
// Type: pulumi.String("binpack"),
// Field: pulumi.String("cpu"),
// },
// },
// LoadBalancers: ecs.ServiceLoadBalancerArray{
// &ecs.ServiceLoadBalancerArgs{
// TargetGroupArn: pulumi.Any(fooAwsLbTargetGroup.Arn),
// ContainerName: pulumi.String("mongo"),
// ContainerPort: pulumi.Int(8080),
// },
// },
// PlacementConstraints: ecs.ServicePlacementConstraintArray{
// &ecs.ServicePlacementConstraintArgs{
// Type: pulumi.String("memberOf"),
// Expression: pulumi.String("attribute:ecs.availability-zone in [us-west-2a, us-west-2b]"),
// },
// },
// }, pulumi.DependsOn([]pulumi.Resource{
// foo,
// }))
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Ignoring Changes to Desired Count
//
// You can use [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) to create an ECS service with an initial count of running instances, then ignore any changes to that count caused externally (e.g. Application Autoscaling).
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecs"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ecs.NewService(ctx, "example", &ecs.ServiceArgs{
// DesiredCount: pulumi.Int(2),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Daemon Scheduling Strategy
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecs"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ecs.NewService(ctx, "bar", &ecs.ServiceArgs{
// Name: pulumi.String("bar"),
// Cluster: pulumi.Any(foo.Id),
// TaskDefinition: pulumi.Any(barAwsEcsTaskDefinition.Arn),
// SchedulingStrategy: pulumi.String("DAEMON"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### CloudWatch Deployment Alarms
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecs"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ecs.NewService(ctx, "example", &ecs.ServiceArgs{
// Name: pulumi.String("example"),
// Cluster: pulumi.Any(exampleAwsEcsCluster.Id),
// Alarms: &ecs.ServiceAlarmsArgs{
// Enable: pulumi.Bool(true),
// Rollback: pulumi.Bool(true),
// AlarmNames: pulumi.StringArray{
// exampleAwsCloudwatchMetricAlarm.AlarmName,
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### External Deployment Controller
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecs"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ecs.NewService(ctx, "example", &ecs.ServiceArgs{
// Name: pulumi.String("example"),
// Cluster: pulumi.Any(exampleAwsEcsCluster.Id),
// DeploymentController: &ecs.ServiceDeploymentControllerArgs{
// Type: pulumi.String("EXTERNAL"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import ECS services using the `name` together with ecs cluster `name`. For example:
//
// ```sh
// $ pulumi import aws:ecs/service:Service imported cluster-name/service-name
// ```
type Service struct {
pulumi.CustomResourceState
// Information about the CloudWatch alarms. See below.
Alarms ServiceAlarmsPtrOutput `pulumi:"alarms"`
// Capacity provider strategies to use for the service. Can be one or more. These can be updated without destroying and recreating the service only if `forceNewDeployment = true` and not changing from 0 `capacityProviderStrategy` blocks to greater than 0, or vice versa. See below. Conflicts with `launchType`.
CapacityProviderStrategies ServiceCapacityProviderStrategyArrayOutput `pulumi:"capacityProviderStrategies"`
// ARN of an ECS cluster.
Cluster pulumi.StringOutput `pulumi:"cluster"`
// Configuration block for deployment circuit breaker. See below.
DeploymentCircuitBreaker ServiceDeploymentCircuitBreakerPtrOutput `pulumi:"deploymentCircuitBreaker"`
// Configuration block for deployment controller configuration. See below.
DeploymentController ServiceDeploymentControllerPtrOutput `pulumi:"deploymentController"`
// Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the `DAEMON` scheduling strategy.
DeploymentMaximumPercent pulumi.IntPtrOutput `pulumi:"deploymentMaximumPercent"`
// Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment.
DeploymentMinimumHealthyPercent pulumi.IntPtrOutput `pulumi:"deploymentMinimumHealthyPercent"`
// Number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy.
DesiredCount pulumi.IntPtrOutput `pulumi:"desiredCount"`
// Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
EnableEcsManagedTags pulumi.BoolPtrOutput `pulumi:"enableEcsManagedTags"`
// Specifies whether to enable Amazon ECS Exec for the tasks within the service.
EnableExecuteCommand pulumi.BoolPtrOutput `pulumi:"enableExecuteCommand"`
// Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `orderedPlacementStrategy` and `placementConstraints` updates.
ForceNewDeployment pulumi.BoolPtrOutput `pulumi:"forceNewDeployment"`
// Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers.
HealthCheckGracePeriodSeconds pulumi.IntPtrOutput `pulumi:"healthCheckGracePeriodSeconds"`
// ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is required if you are using a load balancer with your service, but only if your task definition does not use the `awsvpc` network mode. If using `awsvpc` network mode, do not specify this role. If your account has already created the Amazon ECS service-linked role, that role is used by default for your service unless you specify a role here.
IamRole pulumi.StringOutput `pulumi:"iamRole"`
// Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`. Conflicts with `capacityProviderStrategy`.
LaunchType pulumi.StringOutput `pulumi:"launchType"`
// Configuration block for load balancers. See below.
LoadBalancers ServiceLoadBalancerArrayOutput `pulumi:"loadBalancers"`
// Name of the service (up to 255 letters, numbers, hyphens, and underscores)
//
// The following arguments are optional:
Name pulumi.StringOutput `pulumi:"name"`
// Network configuration for the service. This parameter is required for task definitions that use the `awsvpc` network mode to receive their own Elastic Network Interface, and it is not supported for other network modes. See below.
NetworkConfiguration ServiceNetworkConfigurationPtrOutput `pulumi:"networkConfiguration"`
// Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. The maximum number of `orderedPlacementStrategy` blocks is `5`. See below.
OrderedPlacementStrategies ServiceOrderedPlacementStrategyArrayOutput `pulumi:"orderedPlacementStrategies"`
// Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. Maximum number of `placementConstraints` is `10`. See below.
PlacementConstraints ServicePlacementConstraintArrayOutput `pulumi:"placementConstraints"`
// Platform version on which to run your service. Only applicable for `launchType` set to `FARGATE`. Defaults to `LATEST`. More information about Fargate platform versions can be found in the [AWS ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
PlatformVersion pulumi.StringOutput `pulumi:"platformVersion"`
// Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`.
PropagateTags pulumi.StringPtrOutput `pulumi:"propagateTags"`
// Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html).
SchedulingStrategy pulumi.StringPtrOutput `pulumi:"schedulingStrategy"`
// The ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. See below.
ServiceConnectConfiguration ServiceServiceConnectConfigurationPtrOutput `pulumi:"serviceConnectConfiguration"`
// Service discovery registries for the service. The maximum number of `serviceRegistries` blocks is `1`. See below.
ServiceRegistries ServiceServiceRegistriesPtrOutput `pulumi:"serviceRegistries"`
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// Family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used.
TaskDefinition pulumi.StringPtrOutput `pulumi:"taskDefinition"`
// Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `plantimestamp()`. See example above.
Triggers pulumi.StringMapOutput `pulumi:"triggers"`
// If `true`, this provider will wait for the service to reach a steady state (like [`aws ecs wait services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html)) before continuing. Default `false`.
WaitForSteadyState pulumi.BoolPtrOutput `pulumi:"waitForSteadyState"`
}
// NewService registers a new resource with the given unique name, arguments, and options.
func NewService(ctx *pulumi.Context,
name string, args *ServiceArgs, opts ...pulumi.ResourceOption) (*Service, error) {
if args == nil {
args = &ServiceArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Service
err := ctx.RegisterResource("aws:ecs/service:Service", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetService gets an existing Service resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetService(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ServiceState, opts ...pulumi.ResourceOption) (*Service, error) {
var resource Service
err := ctx.ReadResource("aws:ecs/service:Service", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Service resources.
type serviceState struct {
// Information about the CloudWatch alarms. See below.
Alarms *ServiceAlarms `pulumi:"alarms"`
// Capacity provider strategies to use for the service. Can be one or more. These can be updated without destroying and recreating the service only if `forceNewDeployment = true` and not changing from 0 `capacityProviderStrategy` blocks to greater than 0, or vice versa. See below. Conflicts with `launchType`.
CapacityProviderStrategies []ServiceCapacityProviderStrategy `pulumi:"capacityProviderStrategies"`
// ARN of an ECS cluster.
Cluster *string `pulumi:"cluster"`
// Configuration block for deployment circuit breaker. See below.
DeploymentCircuitBreaker *ServiceDeploymentCircuitBreaker `pulumi:"deploymentCircuitBreaker"`
// Configuration block for deployment controller configuration. See below.
DeploymentController *ServiceDeploymentController `pulumi:"deploymentController"`
// Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the `DAEMON` scheduling strategy.
DeploymentMaximumPercent *int `pulumi:"deploymentMaximumPercent"`
// Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment.
DeploymentMinimumHealthyPercent *int `pulumi:"deploymentMinimumHealthyPercent"`
// Number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy.
DesiredCount *int `pulumi:"desiredCount"`
// Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
EnableEcsManagedTags *bool `pulumi:"enableEcsManagedTags"`
// Specifies whether to enable Amazon ECS Exec for the tasks within the service.
EnableExecuteCommand *bool `pulumi:"enableExecuteCommand"`
// Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `orderedPlacementStrategy` and `placementConstraints` updates.
ForceNewDeployment *bool `pulumi:"forceNewDeployment"`
// Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers.
HealthCheckGracePeriodSeconds *int `pulumi:"healthCheckGracePeriodSeconds"`
// ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is required if you are using a load balancer with your service, but only if your task definition does not use the `awsvpc` network mode. If using `awsvpc` network mode, do not specify this role. If your account has already created the Amazon ECS service-linked role, that role is used by default for your service unless you specify a role here.
IamRole *string `pulumi:"iamRole"`
// Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`. Conflicts with `capacityProviderStrategy`.
LaunchType *string `pulumi:"launchType"`
// Configuration block for load balancers. See below.
LoadBalancers []ServiceLoadBalancer `pulumi:"loadBalancers"`
// Name of the service (up to 255 letters, numbers, hyphens, and underscores)
//
// The following arguments are optional:
Name *string `pulumi:"name"`
// Network configuration for the service. This parameter is required for task definitions that use the `awsvpc` network mode to receive their own Elastic Network Interface, and it is not supported for other network modes. See below.
NetworkConfiguration *ServiceNetworkConfiguration `pulumi:"networkConfiguration"`
// Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. The maximum number of `orderedPlacementStrategy` blocks is `5`. See below.
OrderedPlacementStrategies []ServiceOrderedPlacementStrategy `pulumi:"orderedPlacementStrategies"`
// Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. Maximum number of `placementConstraints` is `10`. See below.
PlacementConstraints []ServicePlacementConstraint `pulumi:"placementConstraints"`
// Platform version on which to run your service. Only applicable for `launchType` set to `FARGATE`. Defaults to `LATEST`. More information about Fargate platform versions can be found in the [AWS ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
PlatformVersion *string `pulumi:"platformVersion"`
// Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`.
PropagateTags *string `pulumi:"propagateTags"`
// Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html).
SchedulingStrategy *string `pulumi:"schedulingStrategy"`
// The ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. See below.
ServiceConnectConfiguration *ServiceServiceConnectConfiguration `pulumi:"serviceConnectConfiguration"`
// Service discovery registries for the service. The maximum number of `serviceRegistries` blocks is `1`. See below.
ServiceRegistries *ServiceServiceRegistries `pulumi:"serviceRegistries"`
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll map[string]string `pulumi:"tagsAll"`
// Family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used.
TaskDefinition *string `pulumi:"taskDefinition"`
// Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `plantimestamp()`. See example above.
Triggers map[string]string `pulumi:"triggers"`
// If `true`, this provider will wait for the service to reach a steady state (like [`aws ecs wait services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html)) before continuing. Default `false`.
WaitForSteadyState *bool `pulumi:"waitForSteadyState"`
}
type ServiceState struct {
// Information about the CloudWatch alarms. See below.
Alarms ServiceAlarmsPtrInput
// Capacity provider strategies to use for the service. Can be one or more. These can be updated without destroying and recreating the service only if `forceNewDeployment = true` and not changing from 0 `capacityProviderStrategy` blocks to greater than 0, or vice versa. See below. Conflicts with `launchType`.
CapacityProviderStrategies ServiceCapacityProviderStrategyArrayInput
// ARN of an ECS cluster.
Cluster pulumi.StringPtrInput
// Configuration block for deployment circuit breaker. See below.
DeploymentCircuitBreaker ServiceDeploymentCircuitBreakerPtrInput
// Configuration block for deployment controller configuration. See below.
DeploymentController ServiceDeploymentControllerPtrInput
// Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the `DAEMON` scheduling strategy.
DeploymentMaximumPercent pulumi.IntPtrInput
// Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment.
DeploymentMinimumHealthyPercent pulumi.IntPtrInput
// Number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy.
DesiredCount pulumi.IntPtrInput
// Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
EnableEcsManagedTags pulumi.BoolPtrInput
// Specifies whether to enable Amazon ECS Exec for the tasks within the service.
EnableExecuteCommand pulumi.BoolPtrInput
// Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `orderedPlacementStrategy` and `placementConstraints` updates.
ForceNewDeployment pulumi.BoolPtrInput
// Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers.
HealthCheckGracePeriodSeconds pulumi.IntPtrInput
// ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is required if you are using a load balancer with your service, but only if your task definition does not use the `awsvpc` network mode. If using `awsvpc` network mode, do not specify this role. If your account has already created the Amazon ECS service-linked role, that role is used by default for your service unless you specify a role here.
IamRole pulumi.StringPtrInput
// Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`. Conflicts with `capacityProviderStrategy`.
LaunchType pulumi.StringPtrInput
// Configuration block for load balancers. See below.
LoadBalancers ServiceLoadBalancerArrayInput
// Name of the service (up to 255 letters, numbers, hyphens, and underscores)
//
// The following arguments are optional:
Name pulumi.StringPtrInput
// Network configuration for the service. This parameter is required for task definitions that use the `awsvpc` network mode to receive their own Elastic Network Interface, and it is not supported for other network modes. See below.
NetworkConfiguration ServiceNetworkConfigurationPtrInput
// Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. The maximum number of `orderedPlacementStrategy` blocks is `5`. See below.
OrderedPlacementStrategies ServiceOrderedPlacementStrategyArrayInput
// Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. Maximum number of `placementConstraints` is `10`. See below.
PlacementConstraints ServicePlacementConstraintArrayInput
// Platform version on which to run your service. Only applicable for `launchType` set to `FARGATE`. Defaults to `LATEST`. More information about Fargate platform versions can be found in the [AWS ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
PlatformVersion pulumi.StringPtrInput
// Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`.
PropagateTags pulumi.StringPtrInput
// Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html).
SchedulingStrategy pulumi.StringPtrInput
// The ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. See below.
ServiceConnectConfiguration ServiceServiceConnectConfigurationPtrInput
// Service discovery registries for the service. The maximum number of `serviceRegistries` blocks is `1`. See below.
ServiceRegistries ServiceServiceRegistriesPtrInput
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapInput
// Family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used.
TaskDefinition pulumi.StringPtrInput
// Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `plantimestamp()`. See example above.
Triggers pulumi.StringMapInput
// If `true`, this provider will wait for the service to reach a steady state (like [`aws ecs wait services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html)) before continuing. Default `false`.
WaitForSteadyState pulumi.BoolPtrInput
}
func (ServiceState) ElementType() reflect.Type {
return reflect.TypeOf((*serviceState)(nil)).Elem()
}
type serviceArgs struct {
// Information about the CloudWatch alarms. See below.
Alarms *ServiceAlarms `pulumi:"alarms"`
// Capacity provider strategies to use for the service. Can be one or more. These can be updated without destroying and recreating the service only if `forceNewDeployment = true` and not changing from 0 `capacityProviderStrategy` blocks to greater than 0, or vice versa. See below. Conflicts with `launchType`.
CapacityProviderStrategies []ServiceCapacityProviderStrategy `pulumi:"capacityProviderStrategies"`
// ARN of an ECS cluster.
Cluster *string `pulumi:"cluster"`
// Configuration block for deployment circuit breaker. See below.
DeploymentCircuitBreaker *ServiceDeploymentCircuitBreaker `pulumi:"deploymentCircuitBreaker"`
// Configuration block for deployment controller configuration. See below.
DeploymentController *ServiceDeploymentController `pulumi:"deploymentController"`
// Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the `DAEMON` scheduling strategy.
DeploymentMaximumPercent *int `pulumi:"deploymentMaximumPercent"`
// Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment.
DeploymentMinimumHealthyPercent *int `pulumi:"deploymentMinimumHealthyPercent"`
// Number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy.
DesiredCount *int `pulumi:"desiredCount"`
// Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
EnableEcsManagedTags *bool `pulumi:"enableEcsManagedTags"`
// Specifies whether to enable Amazon ECS Exec for the tasks within the service.
EnableExecuteCommand *bool `pulumi:"enableExecuteCommand"`
// Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `orderedPlacementStrategy` and `placementConstraints` updates.
ForceNewDeployment *bool `pulumi:"forceNewDeployment"`
// Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers.
HealthCheckGracePeriodSeconds *int `pulumi:"healthCheckGracePeriodSeconds"`
// ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is required if you are using a load balancer with your service, but only if your task definition does not use the `awsvpc` network mode. If using `awsvpc` network mode, do not specify this role. If your account has already created the Amazon ECS service-linked role, that role is used by default for your service unless you specify a role here.
IamRole *string `pulumi:"iamRole"`
// Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`. Conflicts with `capacityProviderStrategy`.
LaunchType *string `pulumi:"launchType"`
// Configuration block for load balancers. See below.
LoadBalancers []ServiceLoadBalancer `pulumi:"loadBalancers"`
// Name of the service (up to 255 letters, numbers, hyphens, and underscores)
//
// The following arguments are optional:
Name *string `pulumi:"name"`
// Network configuration for the service. This parameter is required for task definitions that use the `awsvpc` network mode to receive their own Elastic Network Interface, and it is not supported for other network modes. See below.
NetworkConfiguration *ServiceNetworkConfiguration `pulumi:"networkConfiguration"`
// Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. The maximum number of `orderedPlacementStrategy` blocks is `5`. See below.
OrderedPlacementStrategies []ServiceOrderedPlacementStrategy `pulumi:"orderedPlacementStrategies"`
// Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. Maximum number of `placementConstraints` is `10`. See below.
PlacementConstraints []ServicePlacementConstraint `pulumi:"placementConstraints"`
// Platform version on which to run your service. Only applicable for `launchType` set to `FARGATE`. Defaults to `LATEST`. More information about Fargate platform versions can be found in the [AWS ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
PlatformVersion *string `pulumi:"platformVersion"`
// Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`.
PropagateTags *string `pulumi:"propagateTags"`
// Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html).
SchedulingStrategy *string `pulumi:"schedulingStrategy"`
// The ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. See below.
ServiceConnectConfiguration *ServiceServiceConnectConfiguration `pulumi:"serviceConnectConfiguration"`
// Service discovery registries for the service. The maximum number of `serviceRegistries` blocks is `1`. See below.
ServiceRegistries *ServiceServiceRegistries `pulumi:"serviceRegistries"`
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// Family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used.
TaskDefinition *string `pulumi:"taskDefinition"`
// Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `plantimestamp()`. See example above.
Triggers map[string]string `pulumi:"triggers"`
// If `true`, this provider will wait for the service to reach a steady state (like [`aws ecs wait services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html)) before continuing. Default `false`.
WaitForSteadyState *bool `pulumi:"waitForSteadyState"`
}
// The set of arguments for constructing a Service resource.
type ServiceArgs struct {
// Information about the CloudWatch alarms. See below.
Alarms ServiceAlarmsPtrInput
// Capacity provider strategies to use for the service. Can be one or more. These can be updated without destroying and recreating the service only if `forceNewDeployment = true` and not changing from 0 `capacityProviderStrategy` blocks to greater than 0, or vice versa. See below. Conflicts with `launchType`.
CapacityProviderStrategies ServiceCapacityProviderStrategyArrayInput
// ARN of an ECS cluster.
Cluster pulumi.StringPtrInput
// Configuration block for deployment circuit breaker. See below.
DeploymentCircuitBreaker ServiceDeploymentCircuitBreakerPtrInput
// Configuration block for deployment controller configuration. See below.
DeploymentController ServiceDeploymentControllerPtrInput
// Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the `DAEMON` scheduling strategy.
DeploymentMaximumPercent pulumi.IntPtrInput
// Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment.
DeploymentMinimumHealthyPercent pulumi.IntPtrInput
// Number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy.
DesiredCount pulumi.IntPtrInput
// Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
EnableEcsManagedTags pulumi.BoolPtrInput
// Specifies whether to enable Amazon ECS Exec for the tasks within the service.
EnableExecuteCommand pulumi.BoolPtrInput
// Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `orderedPlacementStrategy` and `placementConstraints` updates.
ForceNewDeployment pulumi.BoolPtrInput
// Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers.
HealthCheckGracePeriodSeconds pulumi.IntPtrInput
// ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is required if you are using a load balancer with your service, but only if your task definition does not use the `awsvpc` network mode. If using `awsvpc` network mode, do not specify this role. If your account has already created the Amazon ECS service-linked role, that role is used by default for your service unless you specify a role here.
IamRole pulumi.StringPtrInput
// Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`. Conflicts with `capacityProviderStrategy`.
LaunchType pulumi.StringPtrInput
// Configuration block for load balancers. See below.
LoadBalancers ServiceLoadBalancerArrayInput
// Name of the service (up to 255 letters, numbers, hyphens, and underscores)
//
// The following arguments are optional:
Name pulumi.StringPtrInput
// Network configuration for the service. This parameter is required for task definitions that use the `awsvpc` network mode to receive their own Elastic Network Interface, and it is not supported for other network modes. See below.
NetworkConfiguration ServiceNetworkConfigurationPtrInput
// Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. The maximum number of `orderedPlacementStrategy` blocks is `5`. See below.
OrderedPlacementStrategies ServiceOrderedPlacementStrategyArrayInput
// Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. Maximum number of `placementConstraints` is `10`. See below.
PlacementConstraints ServicePlacementConstraintArrayInput
// Platform version on which to run your service. Only applicable for `launchType` set to `FARGATE`. Defaults to `LATEST`. More information about Fargate platform versions can be found in the [AWS ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
PlatformVersion pulumi.StringPtrInput
// Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`.
PropagateTags pulumi.StringPtrInput
// Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html).
SchedulingStrategy pulumi.StringPtrInput
// The ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. See below.
ServiceConnectConfiguration ServiceServiceConnectConfigurationPtrInput
// Service discovery registries for the service. The maximum number of `serviceRegistries` blocks is `1`. See below.
ServiceRegistries ServiceServiceRegistriesPtrInput
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// Family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used.
TaskDefinition pulumi.StringPtrInput
// Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `plantimestamp()`. See example above.
Triggers pulumi.StringMapInput
// If `true`, this provider will wait for the service to reach a steady state (like [`aws ecs wait services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html)) before continuing. Default `false`.
WaitForSteadyState pulumi.BoolPtrInput
}
func (ServiceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*serviceArgs)(nil)).Elem()
}
type ServiceInput interface {
pulumi.Input
ToServiceOutput() ServiceOutput
ToServiceOutputWithContext(ctx context.Context) ServiceOutput
}
func (*Service) ElementType() reflect.Type {
return reflect.TypeOf((**Service)(nil)).Elem()
}
func (i *Service) ToServiceOutput() ServiceOutput {
return i.ToServiceOutputWithContext(context.Background())
}
func (i *Service) ToServiceOutputWithContext(ctx context.Context) ServiceOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceOutput)
}
// ServiceArrayInput is an input type that accepts ServiceArray and ServiceArrayOutput values.
// You can construct a concrete instance of `ServiceArrayInput` via:
//
// ServiceArray{ ServiceArgs{...} }
type ServiceArrayInput interface {
pulumi.Input
ToServiceArrayOutput() ServiceArrayOutput
ToServiceArrayOutputWithContext(context.Context) ServiceArrayOutput
}
type ServiceArray []ServiceInput
func (ServiceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Service)(nil)).Elem()
}
func (i ServiceArray) ToServiceArrayOutput() ServiceArrayOutput {
return i.ToServiceArrayOutputWithContext(context.Background())
}
func (i ServiceArray) ToServiceArrayOutputWithContext(ctx context.Context) ServiceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceArrayOutput)
}
// ServiceMapInput is an input type that accepts ServiceMap and ServiceMapOutput values.
// You can construct a concrete instance of `ServiceMapInput` via:
//
// ServiceMap{ "key": ServiceArgs{...} }
type ServiceMapInput interface {
pulumi.Input
ToServiceMapOutput() ServiceMapOutput
ToServiceMapOutputWithContext(context.Context) ServiceMapOutput
}
type ServiceMap map[string]ServiceInput
func (ServiceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Service)(nil)).Elem()
}
func (i ServiceMap) ToServiceMapOutput() ServiceMapOutput {
return i.ToServiceMapOutputWithContext(context.Background())
}
func (i ServiceMap) ToServiceMapOutputWithContext(ctx context.Context) ServiceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceMapOutput)
}
type ServiceOutput struct{ *pulumi.OutputState }
func (ServiceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Service)(nil)).Elem()
}
func (o ServiceOutput) ToServiceOutput() ServiceOutput {
return o
}
func (o ServiceOutput) ToServiceOutputWithContext(ctx context.Context) ServiceOutput {
return o
}
// Information about the CloudWatch alarms. See below.
func (o ServiceOutput) Alarms() ServiceAlarmsPtrOutput {
return o.ApplyT(func(v *Service) ServiceAlarmsPtrOutput { return v.Alarms }).(ServiceAlarmsPtrOutput)
}
// Capacity provider strategies to use for the service. Can be one or more. These can be updated without destroying and recreating the service only if `forceNewDeployment = true` and not changing from 0 `capacityProviderStrategy` blocks to greater than 0, or vice versa. See below. Conflicts with `launchType`.
func (o ServiceOutput) CapacityProviderStrategies() ServiceCapacityProviderStrategyArrayOutput {
return o.ApplyT(func(v *Service) ServiceCapacityProviderStrategyArrayOutput { return v.CapacityProviderStrategies }).(ServiceCapacityProviderStrategyArrayOutput)
}
// ARN of an ECS cluster.
func (o ServiceOutput) Cluster() pulumi.StringOutput {
return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.Cluster }).(pulumi.StringOutput)
}
// Configuration block for deployment circuit breaker. See below.
func (o ServiceOutput) DeploymentCircuitBreaker() ServiceDeploymentCircuitBreakerPtrOutput {
return o.ApplyT(func(v *Service) ServiceDeploymentCircuitBreakerPtrOutput { return v.DeploymentCircuitBreaker }).(ServiceDeploymentCircuitBreakerPtrOutput)
}
// Configuration block for deployment controller configuration. See below.
func (o ServiceOutput) DeploymentController() ServiceDeploymentControllerPtrOutput {
return o.ApplyT(func(v *Service) ServiceDeploymentControllerPtrOutput { return v.DeploymentController }).(ServiceDeploymentControllerPtrOutput)
}
// Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the `DAEMON` scheduling strategy.
func (o ServiceOutput) DeploymentMaximumPercent() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Service) pulumi.IntPtrOutput { return v.DeploymentMaximumPercent }).(pulumi.IntPtrOutput)
}
// Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment.
func (o ServiceOutput) DeploymentMinimumHealthyPercent() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Service) pulumi.IntPtrOutput { return v.DeploymentMinimumHealthyPercent }).(pulumi.IntPtrOutput)
}
// Number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy.
func (o ServiceOutput) DesiredCount() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Service) pulumi.IntPtrOutput { return v.DesiredCount }).(pulumi.IntPtrOutput)
}
// Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
func (o ServiceOutput) EnableEcsManagedTags() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Service) pulumi.BoolPtrOutput { return v.EnableEcsManagedTags }).(pulumi.BoolPtrOutput)
}
// Specifies whether to enable Amazon ECS Exec for the tasks within the service.
func (o ServiceOutput) EnableExecuteCommand() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Service) pulumi.BoolPtrOutput { return v.EnableExecuteCommand }).(pulumi.BoolPtrOutput)
}
// Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `orderedPlacementStrategy` and `placementConstraints` updates.
func (o ServiceOutput) ForceNewDeployment() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Service) pulumi.BoolPtrOutput { return v.ForceNewDeployment }).(pulumi.BoolPtrOutput)
}
// Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers.
func (o ServiceOutput) HealthCheckGracePeriodSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Service) pulumi.IntPtrOutput { return v.HealthCheckGracePeriodSeconds }).(pulumi.IntPtrOutput)
}
// ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is required if you are using a load balancer with your service, but only if your task definition does not use the `awsvpc` network mode. If using `awsvpc` network mode, do not specify this role. If your account has already created the Amazon ECS service-linked role, that role is used by default for your service unless you specify a role here.
func (o ServiceOutput) IamRole() pulumi.StringOutput {
return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.IamRole }).(pulumi.StringOutput)
}
// Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`. Conflicts with `capacityProviderStrategy`.
func (o ServiceOutput) LaunchType() pulumi.StringOutput {
return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.LaunchType }).(pulumi.StringOutput)
}
// Configuration block for load balancers. See below.
func (o ServiceOutput) LoadBalancers() ServiceLoadBalancerArrayOutput {
return o.ApplyT(func(v *Service) ServiceLoadBalancerArrayOutput { return v.LoadBalancers }).(ServiceLoadBalancerArrayOutput)
}
// Name of the service (up to 255 letters, numbers, hyphens, and underscores)
//
// The following arguments are optional:
func (o ServiceOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Network configuration for the service. This parameter is required for task definitions that use the `awsvpc` network mode to receive their own Elastic Network Interface, and it is not supported for other network modes. See below.
func (o ServiceOutput) NetworkConfiguration() ServiceNetworkConfigurationPtrOutput {
return o.ApplyT(func(v *Service) ServiceNetworkConfigurationPtrOutput { return v.NetworkConfiguration }).(ServiceNetworkConfigurationPtrOutput)
}
// Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. The maximum number of `orderedPlacementStrategy` blocks is `5`. See below.
func (o ServiceOutput) OrderedPlacementStrategies() ServiceOrderedPlacementStrategyArrayOutput {
return o.ApplyT(func(v *Service) ServiceOrderedPlacementStrategyArrayOutput { return v.OrderedPlacementStrategies }).(ServiceOrderedPlacementStrategyArrayOutput)
}
// Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `forceNewDeployment` is enabled. Maximum number of `placementConstraints` is `10`. See below.
func (o ServiceOutput) PlacementConstraints() ServicePlacementConstraintArrayOutput {
return o.ApplyT(func(v *Service) ServicePlacementConstraintArrayOutput { return v.PlacementConstraints }).(ServicePlacementConstraintArrayOutput)
}
// Platform version on which to run your service. Only applicable for `launchType` set to `FARGATE`. Defaults to `LATEST`. More information about Fargate platform versions can be found in the [AWS ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
func (o ServiceOutput) PlatformVersion() pulumi.StringOutput {
return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.PlatformVersion }).(pulumi.StringOutput)
}
// Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`.
func (o ServiceOutput) PropagateTags() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Service) pulumi.StringPtrOutput { return v.PropagateTags }).(pulumi.StringPtrOutput)
}
// Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html).
func (o ServiceOutput) SchedulingStrategy() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Service) pulumi.StringPtrOutput { return v.SchedulingStrategy }).(pulumi.StringPtrOutput)
}
// The ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. See below.
func (o ServiceOutput) ServiceConnectConfiguration() ServiceServiceConnectConfigurationPtrOutput {
return o.ApplyT(func(v *Service) ServiceServiceConnectConfigurationPtrOutput { return v.ServiceConnectConfiguration }).(ServiceServiceConnectConfigurationPtrOutput)
}
// Service discovery registries for the service. The maximum number of `serviceRegistries` blocks is `1`. See below.
func (o ServiceOutput) ServiceRegistries() ServiceServiceRegistriesPtrOutput {
return o.ApplyT(func(v *Service) ServiceServiceRegistriesPtrOutput { return v.ServiceRegistries }).(ServiceServiceRegistriesPtrOutput)
}
// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
func (o ServiceOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Service) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
func (o ServiceOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *Service) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
// Family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used.
func (o ServiceOutput) TaskDefinition() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Service) pulumi.StringPtrOutput { return v.TaskDefinition }).(pulumi.StringPtrOutput)
}
// Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `plantimestamp()`. See example above.
func (o ServiceOutput) Triggers() pulumi.StringMapOutput {
return o.ApplyT(func(v *Service) pulumi.StringMapOutput { return v.Triggers }).(pulumi.StringMapOutput)
}
// If `true`, this provider will wait for the service to reach a steady state (like [`aws ecs wait services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html)) before continuing. Default `false`.
func (o ServiceOutput) WaitForSteadyState() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Service) pulumi.BoolPtrOutput { return v.WaitForSteadyState }).(pulumi.BoolPtrOutput)
}
type ServiceArrayOutput struct{ *pulumi.OutputState }
func (ServiceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Service)(nil)).Elem()
}
func (o ServiceArrayOutput) ToServiceArrayOutput() ServiceArrayOutput {
return o
}
func (o ServiceArrayOutput) ToServiceArrayOutputWithContext(ctx context.Context) ServiceArrayOutput {
return o
}
func (o ServiceArrayOutput) Index(i pulumi.IntInput) ServiceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Service {
return vs[0].([]*Service)[vs[1].(int)]
}).(ServiceOutput)
}
type ServiceMapOutput struct{ *pulumi.OutputState }
func (ServiceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Service)(nil)).Elem()
}
func (o ServiceMapOutput) ToServiceMapOutput() ServiceMapOutput {
return o
}
func (o ServiceMapOutput) ToServiceMapOutputWithContext(ctx context.Context) ServiceMapOutput {
return o
}
func (o ServiceMapOutput) MapIndex(k pulumi.StringInput) ServiceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Service {
return vs[0].(map[string]*Service)[vs[1].(string)]
}).(ServiceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ServiceInput)(nil)).Elem(), &Service{})
pulumi.RegisterInputType(reflect.TypeOf((*ServiceArrayInput)(nil)).Elem(), ServiceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ServiceMapInput)(nil)).Elem(), ServiceMap{})
pulumi.RegisterOutputType(ServiceOutput{})
pulumi.RegisterOutputType(ServiceArrayOutput{})
pulumi.RegisterOutputType(ServiceMapOutput{})
}