aws-cdk-lib 2.174.0__py3-none-any.whl → 2.175.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of aws-cdk-lib might be problematic. Click here for more details.

Files changed (45) hide show
  1. aws_cdk/_jsii/__init__.py +1 -1
  2. aws_cdk/_jsii/{aws-cdk-lib@2.174.0.jsii.tgz → aws-cdk-lib@2.175.0.jsii.tgz} +0 -0
  3. aws_cdk/aws_amazonmq/__init__.py +18 -0
  4. aws_cdk/aws_apigateway/__init__.py +164 -0
  5. aws_cdk/aws_apigatewayv2/__init__.py +248 -0
  6. aws_cdk/aws_applicationautoscaling/__init__.py +6 -3
  7. aws_cdk/aws_autoscaling/__init__.py +8 -8
  8. aws_cdk/aws_batch/__init__.py +32 -458
  9. aws_cdk/aws_bedrock/__init__.py +7 -4
  10. aws_cdk/aws_certificatemanager/__init__.py +28 -0
  11. aws_cdk/aws_chatbot/__init__.py +28 -0
  12. aws_cdk/aws_cleanrooms/__init__.py +683 -2
  13. aws_cdk/aws_cloudfront/__init__.py +92 -0
  14. aws_cdk/aws_cloudfront/experimental/__init__.py +32 -0
  15. aws_cdk/aws_cloudwatch/__init__.py +146 -0
  16. aws_cdk/aws_codebuild/__init__.py +84 -0
  17. aws_cdk/aws_dms/__init__.py +49 -27
  18. aws_cdk/aws_docdb/__init__.py +134 -0
  19. aws_cdk/aws_dynamodb/__init__.py +300 -0
  20. aws_cdk/aws_ec2/__init__.py +97 -0
  21. aws_cdk/aws_ecs/__init__.py +351 -110
  22. aws_cdk/aws_ecs_patterns/__init__.py +77 -42
  23. aws_cdk/aws_elasticloadbalancing/__init__.py +3 -6
  24. aws_cdk/aws_elasticloadbalancingv2/__init__.py +732 -7
  25. aws_cdk/aws_elasticsearch/__init__.py +260 -0
  26. aws_cdk/aws_kinesis/__init__.py +324 -0
  27. aws_cdk/aws_kms/__init__.py +197 -0
  28. aws_cdk/aws_lambda/__init__.py +144 -0
  29. aws_cdk/aws_logs/__init__.py +58 -0
  30. aws_cdk/aws_mediaconvert/__init__.py +39 -0
  31. aws_cdk/aws_opensearchservice/__init__.py +260 -0
  32. aws_cdk/aws_quicksight/__init__.py +1422 -859
  33. aws_cdk/aws_rds/__init__.py +386 -7
  34. aws_cdk/aws_sagemaker/__init__.py +6 -6
  35. aws_cdk/aws_sns/__init__.py +164 -0
  36. aws_cdk/aws_sqs/__init__.py +164 -0
  37. aws_cdk/aws_stepfunctions/__init__.py +288 -0
  38. aws_cdk/aws_synthetics/__init__.py +18 -0
  39. aws_cdk/cx_api/__init__.py +42 -0
  40. {aws_cdk_lib-2.174.0.dist-info → aws_cdk_lib-2.175.0.dist-info}/METADATA +1 -1
  41. {aws_cdk_lib-2.174.0.dist-info → aws_cdk_lib-2.175.0.dist-info}/RECORD +45 -45
  42. {aws_cdk_lib-2.174.0.dist-info → aws_cdk_lib-2.175.0.dist-info}/LICENSE +0 -0
  43. {aws_cdk_lib-2.174.0.dist-info → aws_cdk_lib-2.175.0.dist-info}/NOTICE +0 -0
  44. {aws_cdk_lib-2.174.0.dist-info → aws_cdk_lib-2.175.0.dist-info}/WHEEL +0 -0
  45. {aws_cdk_lib-2.174.0.dist-info → aws_cdk_lib-2.175.0.dist-info}/top_level.txt +0 -0
@@ -35,7 +35,8 @@ task_definition.add_container("DefaultContainer",
35
35
  # Instantiate an Amazon ECS Service
36
36
  ecs_service = ecs.Ec2Service(self, "Service",
37
37
  cluster=cluster,
38
- task_definition=task_definition
38
+ task_definition=task_definition,
39
+ min_healthy_percent=100
39
40
  )
40
41
  ```
41
42
 
@@ -661,6 +662,23 @@ task_definition.add_container("container",
661
662
  )
662
663
  ```
663
664
 
665
+ ### Enable Fault Injection
666
+
667
+ You can utilize fault injection with Amazon ECS on both Amazon EC2 and Fargate to test how their application responds to certain impairment scenarios. These tests provide information you can use to optimize your application's performance and resiliency.
668
+
669
+ When fault injection is enabled, the Amazon ECS container agent allows tasks access to new fault injection endpoints.
670
+ Fault injection only works with tasks using the `AWS_VPC` or `HOST` network modes.
671
+
672
+ For more infomation, see [Use fault injection with your Amazon ECS and Fargate workloads](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fault-injection.html).
673
+
674
+ To enable Fault Injection for the task definiton, set `enableFaultInjection` to true.
675
+
676
+ ```python
677
+ ecs.Ec2TaskDefinition(self, "Ec2TaskDefinition",
678
+ enable_fault_injection=True
679
+ )
680
+ ```
681
+
664
682
  ## Docker labels
665
683
 
666
684
  You can add labels to the container with the `dockerLabels` property or with the `addDockerLabel` method:
@@ -779,7 +797,8 @@ Amazon ECS automatically restarts the task.
779
797
  service = ecs.FargateService(self, "Service",
780
798
  cluster=cluster,
781
799
  task_definition=task_definition,
782
- desired_count=5
800
+ desired_count=5,
801
+ min_healthy_percent=100
783
802
  )
784
803
  ```
785
804
 
@@ -793,7 +812,8 @@ ECS Anywhere service definition looks like:
793
812
  service = ecs.ExternalService(self, "Service",
794
813
  cluster=cluster,
795
814
  task_definition=task_definition,
796
- desired_count=5
815
+ desired_count=5,
816
+ min_healthy_percent=100
797
817
  )
798
818
  ```
799
819
 
@@ -815,6 +835,7 @@ ecs.ExternalService(self, "Service",
815
835
  cluster=cluster,
816
836
  task_definition=task_definition,
817
837
  desired_count=5,
838
+ min_healthy_percent=100,
818
839
  task_definition_revision=ecs.TaskDefinitionRevision.of(1)
819
840
  )
820
841
 
@@ -822,6 +843,7 @@ ecs.ExternalService(self, "Service",
822
843
  cluster=cluster,
823
844
  task_definition=task_definition,
824
845
  desired_count=5,
846
+ min_healthy_percent=100,
825
847
  task_definition_revision=ecs.TaskDefinitionRevision.LATEST
826
848
  )
827
849
  ```
@@ -844,6 +866,7 @@ See [Using the deployment circuit breaker](https://docs.aws.amazon.com/AmazonECS
844
866
  service = ecs.FargateService(self, "Service",
845
867
  cluster=cluster,
846
868
  task_definition=task_definition,
869
+ min_healthy_percent=100,
847
870
  circuit_breaker=ecs.DeploymentCircuitBreaker(
848
871
  enable=True,
849
872
  rollback=True
@@ -881,6 +904,7 @@ import aws_cdk.aws_cloudwatch as cw
881
904
  service = ecs.FargateService(self, "Service",
882
905
  cluster=cluster,
883
906
  task_definition=task_definition,
907
+ min_healthy_percent=100,
884
908
  deployment_alarms=ecs.DeploymentAlarmConfig(
885
909
  alarm_names=[elb_alarm.alarm_name],
886
910
  behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
@@ -969,7 +993,8 @@ service_name = "MyFargateService"
969
993
  service = ecs.FargateService(self, "Service",
970
994
  service_name=service_name,
971
995
  cluster=cluster,
972
- task_definition=task_definition
996
+ task_definition=task_definition,
997
+ min_healthy_percent=100
973
998
  )
974
999
 
975
1000
  cpu_metric = cw.Metric(
@@ -1008,7 +1033,7 @@ on the service, there will be no restrictions on the alarm name.
1008
1033
  # cluster: ecs.Cluster
1009
1034
  # task_definition: ecs.TaskDefinition
1010
1035
 
1011
- service = ecs.FargateService(self, "Service", cluster=cluster, task_definition=task_definition)
1036
+ service = ecs.FargateService(self, "Service", cluster=cluster, task_definition=task_definition, min_healthy_percent=100)
1012
1037
 
1013
1038
  lb = elbv2.ApplicationLoadBalancer(self, "LB", vpc=vpc, internet_facing=True)
1014
1039
  listener = lb.add_listener("Listener", port=80)
@@ -1036,7 +1061,7 @@ Alternatively, you can also create all load balancer targets to be registered in
1036
1061
  # task_definition: ecs.TaskDefinition
1037
1062
  # vpc: ec2.Vpc
1038
1063
 
1039
- service = ecs.FargateService(self, "Service", cluster=cluster, task_definition=task_definition)
1064
+ service = ecs.FargateService(self, "Service", cluster=cluster, task_definition=task_definition, min_healthy_percent=100)
1040
1065
 
1041
1066
  lb = elbv2.ApplicationLoadBalancer(self, "LB", vpc=vpc, internet_facing=True)
1042
1067
  listener = lb.add_listener("Listener", port=80)
@@ -1074,7 +1099,7 @@ for the alternatives.
1074
1099
  # task_definition: ecs.TaskDefinition
1075
1100
  # vpc: ec2.Vpc
1076
1101
 
1077
- service = ecs.Ec2Service(self, "Service", cluster=cluster, task_definition=task_definition)
1102
+ service = ecs.Ec2Service(self, "Service", cluster=cluster, task_definition=task_definition, min_healthy_percent=100)
1078
1103
 
1079
1104
  lb = elb.LoadBalancer(self, "LB", vpc=vpc)
1080
1105
  lb.add_listener(external_port=80)
@@ -1088,7 +1113,7 @@ Similarly, if you want to have more control over load balancer targeting:
1088
1113
  # task_definition: ecs.TaskDefinition
1089
1114
  # vpc: ec2.Vpc
1090
1115
 
1091
- service = ecs.Ec2Service(self, "Service", cluster=cluster, task_definition=task_definition)
1116
+ service = ecs.Ec2Service(self, "Service", cluster=cluster, task_definition=task_definition, min_healthy_percent=100)
1092
1117
 
1093
1118
  lb = elb.LoadBalancer(self, "LB", vpc=vpc)
1094
1119
  lb.add_listener(external_port=80)
@@ -1427,6 +1452,7 @@ specific_container.add_port_mappings(
1427
1452
  ecs.Ec2Service(self, "Service",
1428
1453
  cluster=cluster,
1429
1454
  task_definition=task_definition,
1455
+ min_healthy_percent=100,
1430
1456
  cloud_map_options=ecs.CloudMapOptions(
1431
1457
  # Create SRV records - useful for bridge networking
1432
1458
  dns_record_type=cloudmap.DnsRecordType.SRV,
@@ -1486,6 +1512,7 @@ task_definition.add_container("web",
1486
1512
  ecs.FargateService(self, "FargateService",
1487
1513
  cluster=cluster,
1488
1514
  task_definition=task_definition,
1515
+ min_healthy_percent=100,
1489
1516
  capacity_provider_strategies=[ecs.CapacityProviderStrategy(
1490
1517
  capacity_provider="FARGATE_SPOT",
1491
1518
  weight=2
@@ -1562,6 +1589,7 @@ task_definition.add_container("web",
1562
1589
  ecs.Ec2Service(self, "EC2Service",
1563
1590
  cluster=cluster,
1564
1591
  task_definition=task_definition,
1592
+ min_healthy_percent=100,
1565
1593
  capacity_provider_strategies=[ecs.CapacityProviderStrategy(
1566
1594
  capacity_provider=capacity_provider.capacity_provider_name,
1567
1595
  weight=1
@@ -1658,6 +1686,7 @@ your `Ec2Service`, `FargateService` or `ExternalService`.
1658
1686
  service = ecs.Ec2Service(self, "Service",
1659
1687
  cluster=cluster,
1660
1688
  task_definition=task_definition,
1689
+ min_healthy_percent=100,
1661
1690
  enable_execute_command=True
1662
1691
  )
1663
1692
  ```
@@ -1733,6 +1762,7 @@ cluster.add_default_cloud_map_namespace(
1733
1762
  service = ecs.FargateService(self, "Service",
1734
1763
  cluster=cluster,
1735
1764
  task_definition=task_definition,
1765
+ min_healthy_percent=100,
1736
1766
  service_connect_configuration=ecs.ServiceConnectProps(
1737
1767
  services=[ecs.ServiceConnectService(
1738
1768
  port_mapping_name="api",
@@ -1756,7 +1786,8 @@ To opt a service into using service connect without advertising a port, simply c
1756
1786
 
1757
1787
  service = ecs.FargateService(self, "Service",
1758
1788
  cluster=cluster,
1759
- task_definition=task_definition
1789
+ task_definition=task_definition,
1790
+ min_healthy_percent=100
1760
1791
  )
1761
1792
  service.enable_service_connect()
1762
1793
  ```
@@ -1771,6 +1802,7 @@ Service Connect also allows custom logging, Service Discovery name, and configur
1771
1802
  custom_service = ecs.FargateService(self, "CustomizedService",
1772
1803
  cluster=cluster,
1773
1804
  task_definition=task_definition,
1805
+ min_healthy_percent=100,
1774
1806
  service_connect_configuration=ecs.ServiceConnectProps(
1775
1807
  log_driver=ecs.LogDrivers.aws_logs(
1776
1808
  stream_prefix="sc-traffic"
@@ -1800,6 +1832,7 @@ the `idleTimeout` is reached and not the `perRequestTimeout`.
1800
1832
  service = ecs.FargateService(self, "Service",
1801
1833
  cluster=cluster,
1802
1834
  task_definition=task_definition,
1835
+ min_healthy_percent=100,
1803
1836
  service_connect_configuration=ecs.ServiceConnectProps(
1804
1837
  services=[ecs.ServiceConnectService(
1805
1838
  port_mapping_name="api",
@@ -1862,7 +1895,8 @@ task_definition.add_volume(volume)
1862
1895
 
1863
1896
  service = ecs.FargateService(self, "FargateService",
1864
1897
  cluster=cluster,
1865
- task_definition=task_definition
1898
+ task_definition=task_definition,
1899
+ min_healthy_percent=100
1866
1900
  )
1867
1901
 
1868
1902
  service.add_volume(volume)
@@ -1892,7 +1926,8 @@ volume_from_snapshot.mount_in(container,
1892
1926
  task_definition.add_volume(volume_from_snapshot)
1893
1927
  service = ecs.FargateService(self, "FargateService",
1894
1928
  cluster=cluster,
1895
- task_definition=task_definition
1929
+ task_definition=task_definition,
1930
+ min_healthy_percent=100
1896
1931
  )
1897
1932
 
1898
1933
  service.add_volume(volume_from_snapshot)
@@ -2102,7 +2137,7 @@ class AddAutoScalingGroupCapacityOptions:
2102
2137
  ) -> None:
2103
2138
  '''The properties for adding an AutoScalingGroup.
2104
2139
 
2105
- :param can_containers_access_instance_role: Specifies whether the containers can access the container instance role. Default: false
2140
+ :param can_containers_access_instance_role: (deprecated) Specifies whether the containers can access the container instance role. Default: true if
2106
2141
  :param machine_image_type: What type of machine image this is. Depending on the setting, different UserData will automatically be added to the ``AutoScalingGroup`` to configure it properly for use with ECS. If you create an ``AutoScalingGroup`` yourself and are adding it via ``addAutoScalingGroup()``, you must specify this value. If you are adding an ``autoScalingGroup`` via ``addCapacity``, this value will be determined from the ``machineImage`` you pass. Default: - Automatically determined from ``machineImage``, if available, otherwise ``MachineImageType.AMAZON_LINUX_2``.
2107
2142
  :param spot_instance_draining: Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services. For more information, see `Using Spot Instances <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-spot.html>`_. Default: false
2108
2143
  :param topic_encryption_key: If ``AddAutoScalingGroupCapacityOptions.taskDrainTime`` is non-zero, then the ECS cluster creates an SNS Topic to as part of a system to drain instances of tasks when the instance is being shut down. If this property is provided, then this key will be used to encrypt the contents of that SNS Topic. See `SNS Data Encryption <https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html>`_ for more information. Default: The SNS Topic will not be encrypted.
@@ -2143,9 +2178,14 @@ class AddAutoScalingGroupCapacityOptions:
2143
2178
 
2144
2179
  @builtins.property
2145
2180
  def can_containers_access_instance_role(self) -> typing.Optional[builtins.bool]:
2146
- '''Specifies whether the containers can access the container instance role.
2181
+ '''(deprecated) Specifies whether the containers can access the container instance role.
2147
2182
 
2148
- :default: false
2183
+ :default: true if
2184
+
2185
+ :deprecated: See https://github.com/aws/aws-cdk/discussions/32609
2186
+
2187
+ :stability: deprecated
2188
+ :aws-cdk: /aws-ecs:disableEcsImdsBlocking is set to false.
2149
2189
  '''
2150
2190
  result = self._values.get("can_containers_access_instance_role")
2151
2191
  return typing.cast(typing.Optional[builtins.bool], result)
@@ -2283,7 +2323,7 @@ class AddCapacityOptions(
2283
2323
  ) -> None:
2284
2324
  '''The properties for adding instance capacity to an AutoScalingGroup.
2285
2325
 
2286
- :param can_containers_access_instance_role: Specifies whether the containers can access the container instance role. Default: false
2326
+ :param can_containers_access_instance_role: (deprecated) Specifies whether the containers can access the container instance role. Default: true if
2287
2327
  :param machine_image_type: What type of machine image this is. Depending on the setting, different UserData will automatically be added to the ``AutoScalingGroup`` to configure it properly for use with ECS. If you create an ``AutoScalingGroup`` yourself and are adding it via ``addAutoScalingGroup()``, you must specify this value. If you are adding an ``autoScalingGroup`` via ``addCapacity``, this value will be determined from the ``machineImage`` you pass. Default: - Automatically determined from ``machineImage``, if available, otherwise ``MachineImageType.AMAZON_LINUX_2``.
2288
2328
  :param spot_instance_draining: Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services. For more information, see `Using Spot Instances <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-spot.html>`_. Default: false
2289
2329
  :param topic_encryption_key: If ``AddAutoScalingGroupCapacityOptions.taskDrainTime`` is non-zero, then the ECS cluster creates an SNS Topic to as part of a system to drain instances of tasks when the instance is being shut down. If this property is provided, then this key will be used to encrypt the contents of that SNS Topic. See `SNS Data Encryption <https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html>`_ for more information. Default: The SNS Topic will not be encrypted.
@@ -2437,9 +2477,14 @@ class AddCapacityOptions(
2437
2477
 
2438
2478
  @builtins.property
2439
2479
  def can_containers_access_instance_role(self) -> typing.Optional[builtins.bool]:
2440
- '''Specifies whether the containers can access the container instance role.
2480
+ '''(deprecated) Specifies whether the containers can access the container instance role.
2441
2481
 
2442
- :default: false
2482
+ :default: true if
2483
+
2484
+ :deprecated: See https://github.com/aws/aws-cdk/discussions/32609
2485
+
2486
+ :stability: deprecated
2487
+ :aws-cdk: /aws-ecs:disableEcsImdsBlocking is set to false.
2443
2488
  '''
2444
2489
  result = self._values.get("can_containers_access_instance_role")
2445
2490
  return typing.cast(typing.Optional[builtins.bool], result)
@@ -2925,6 +2970,7 @@ class AlarmBehavior(enum.Enum):
2925
2970
  service = ecs.FargateService(self, "Service",
2926
2971
  cluster=cluster,
2927
2972
  task_definition=task_definition,
2973
+ min_healthy_percent=100,
2928
2974
  deployment_alarms=ecs.DeploymentAlarmConfig(
2929
2975
  alarm_names=[elb_alarm.alarm_name],
2930
2976
  behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
@@ -3362,7 +3408,7 @@ class AsgCapacityProvider(
3362
3408
  :param maximum_scaling_step_size: Maximum scaling step size. In most cases this should be left alone. Default: 1000
3363
3409
  :param minimum_scaling_step_size: Minimum scaling step size. In most cases this should be left alone. Default: 1
3364
3410
  :param target_capacity_percent: Target capacity percent. In most cases this should be left alone. Default: 100
3365
- :param can_containers_access_instance_role: Specifies whether the containers can access the container instance role. Default: false
3411
+ :param can_containers_access_instance_role: (deprecated) Specifies whether the containers can access the container instance role. Default: true if
3366
3412
  :param machine_image_type: What type of machine image this is. Depending on the setting, different UserData will automatically be added to the ``AutoScalingGroup`` to configure it properly for use with ECS. If you create an ``AutoScalingGroup`` yourself and are adding it via ``addAutoScalingGroup()``, you must specify this value. If you are adding an ``autoScalingGroup`` via ``addCapacity``, this value will be determined from the ``machineImage`` you pass. Default: - Automatically determined from ``machineImage``, if available, otherwise ``MachineImageType.AMAZON_LINUX_2``.
3367
3413
  :param spot_instance_draining: Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services. For more information, see `Using Spot Instances <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-spot.html>`_. Default: false
3368
3414
  :param topic_encryption_key: If ``AddAutoScalingGroupCapacityOptions.taskDrainTime`` is non-zero, then the ECS cluster creates an SNS Topic to as part of a system to drain instances of tasks when the instance is being shut down. If this property is provided, then this key will be used to encrypt the contents of that SNS Topic. See `SNS Data Encryption <https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html>`_ for more information. Default: The SNS Topic will not be encrypted.
@@ -3413,9 +3459,14 @@ class AsgCapacityProvider(
3413
3459
  @builtins.property
3414
3460
  @jsii.member(jsii_name="canContainersAccessInstanceRole")
3415
3461
  def can_containers_access_instance_role(self) -> typing.Optional[builtins.bool]:
3416
- '''Specifies whether the containers can access the container instance role.
3462
+ '''(deprecated) Specifies whether the containers can access the container instance role.
3417
3463
 
3418
- :default: false
3464
+ :default: true if
3465
+
3466
+ :deprecated: See https://github.com/aws/aws-cdk/discussions/32609
3467
+
3468
+ :stability: deprecated
3469
+ :aws-cdk: /aws-ecs:disableEcsImdsBlocking is set to false.
3419
3470
  '''
3420
3471
  return typing.cast(typing.Optional[builtins.bool], jsii.get(self, "canContainersAccessInstanceRole"))
3421
3472
 
@@ -3471,7 +3522,7 @@ class AsgCapacityProviderProps(AddAutoScalingGroupCapacityOptions):
3471
3522
  ) -> None:
3472
3523
  '''The options for creating an Auto Scaling Group Capacity Provider.
3473
3524
 
3474
- :param can_containers_access_instance_role: Specifies whether the containers can access the container instance role. Default: false
3525
+ :param can_containers_access_instance_role: (deprecated) Specifies whether the containers can access the container instance role. Default: true if
3475
3526
  :param machine_image_type: What type of machine image this is. Depending on the setting, different UserData will automatically be added to the ``AutoScalingGroup`` to configure it properly for use with ECS. If you create an ``AutoScalingGroup`` yourself and are adding it via ``addAutoScalingGroup()``, you must specify this value. If you are adding an ``autoScalingGroup`` via ``addCapacity``, this value will be determined from the ``machineImage`` you pass. Default: - Automatically determined from ``machineImage``, if available, otherwise ``MachineImageType.AMAZON_LINUX_2``.
3476
3527
  :param spot_instance_draining: Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services. For more information, see `Using Spot Instances <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-spot.html>`_. Default: false
3477
3528
  :param topic_encryption_key: If ``AddAutoScalingGroupCapacityOptions.taskDrainTime`` is non-zero, then the ECS cluster creates an SNS Topic to as part of a system to drain instances of tasks when the instance is being shut down. If this property is provided, then this key will be used to encrypt the contents of that SNS Topic. See `SNS Data Encryption <https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html>`_ for more information. Default: The SNS Topic will not be encrypted.
@@ -3561,9 +3612,14 @@ class AsgCapacityProviderProps(AddAutoScalingGroupCapacityOptions):
3561
3612
 
3562
3613
  @builtins.property
3563
3614
  def can_containers_access_instance_role(self) -> typing.Optional[builtins.bool]:
3564
- '''Specifies whether the containers can access the container instance role.
3615
+ '''(deprecated) Specifies whether the containers can access the container instance role.
3565
3616
 
3566
- :default: false
3617
+ :default: true if
3618
+
3619
+ :deprecated: See https://github.com/aws/aws-cdk/discussions/32609
3620
+
3621
+ :stability: deprecated
3622
+ :aws-cdk: /aws-ecs:disableEcsImdsBlocking is set to false.
3567
3623
  '''
3568
3624
  result = self._values.get("can_containers_access_instance_role")
3569
3625
  return typing.cast(typing.Optional[builtins.bool], result)
@@ -19188,6 +19244,7 @@ class CloudMapNamespaceOptions:
19188
19244
  service = ecs.FargateService(self, "Service",
19189
19245
  cluster=cluster,
19190
19246
  task_definition=task_definition,
19247
+ min_healthy_percent=100,
19191
19248
  service_connect_configuration=ecs.ServiceConnectProps(
19192
19249
  services=[ecs.ServiceConnectService(
19193
19250
  port_mapping_name="api",
@@ -19652,28 +19709,24 @@ class ClusterProps:
19652
19709
 
19653
19710
  Example::
19654
19711
 
19655
- vpc = ec2.Vpc.from_lookup(self, "Vpc",
19656
- is_default=True
19657
- )
19658
- cluster = ecs.Cluster(self, "ECSCluster", vpc=vpc)
19712
+ from aws_cdk import Tags
19659
19713
 
19660
- task_definition = ecs.TaskDefinition(self, "TD",
19661
- compatibility=ecs.Compatibility.FARGATE,
19662
- cpu="256",
19663
- memory_mi_b="512"
19664
- )
19665
19714
 
19666
- task_definition.add_container("TheContainer",
19667
- image=ecs.ContainerImage.from_registry("foo/bar")
19715
+ vpc = ec2.Vpc(self, "Vpc", max_azs=1)
19716
+ cluster = ecs.Cluster(self, "EcsCluster", vpc=vpc)
19717
+ task_definition = ecs.FargateTaskDefinition(self, "TaskDef",
19718
+ memory_limit_mi_b=512,
19719
+ cpu=256
19668
19720
  )
19669
-
19670
- run_task = tasks.EcsRunTask(self, "Run",
19671
- integration_pattern=sfn.IntegrationPattern.RUN_JOB,
19721
+ task_definition.add_container("WebContainer",
19722
+ image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
19723
+ )
19724
+ Tags.of(task_definition).add("my-tag", "my-tag-value")
19725
+ scheduled_fargate_task = ecs_patterns.ScheduledFargateTask(self, "ScheduledFargateTask",
19672
19726
  cluster=cluster,
19673
19727
  task_definition=task_definition,
19674
- launch_target=tasks.EcsFargateLaunchTarget(),
19675
- cpu="1024",
19676
- memory_mi_b="1048"
19728
+ schedule=appscaling.Schedule.expression("rate(1 minute)"),
19729
+ propagate_tags=ecs.PropagatedTagSource.TASK_DEFINITION
19677
19730
  )
19678
19731
  '''
19679
19732
  if isinstance(capacity, dict):
@@ -19917,6 +19970,7 @@ class CommonTaskDefinitionAttributes:
19917
19970
  jsii_type="aws-cdk-lib.aws_ecs.CommonTaskDefinitionProps",
19918
19971
  jsii_struct_bases=[],
19919
19972
  name_mapping={
19973
+ "enable_fault_injection": "enableFaultInjection",
19920
19974
  "execution_role": "executionRole",
19921
19975
  "family": "family",
19922
19976
  "proxy_configuration": "proxyConfiguration",
@@ -19928,6 +19982,7 @@ class CommonTaskDefinitionProps:
19928
19982
  def __init__(
19929
19983
  self,
19930
19984
  *,
19985
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
19931
19986
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
19932
19987
  family: typing.Optional[builtins.str] = None,
19933
19988
  proxy_configuration: typing.Optional["ProxyConfiguration"] = None,
@@ -19939,6 +19994,7 @@ class CommonTaskDefinitionProps:
19939
19994
  For more information, see
19940
19995
  `Task Definition Parameters <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html>`_.
19941
19996
 
19997
+ :param enable_fault_injection: Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes. Default: undefined - ECS default setting is false
19942
19998
  :param execution_role: The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. The role will be used to retrieve container images from ECR and create CloudWatch log groups. Default: - An execution role will be automatically created if you use ECR images in your task definition.
19943
19999
  :param family: The name of a family that this task definition is registered to. A family groups multiple versions of a task definition. Default: - Automatically generated name.
19944
20000
  :param proxy_configuration: The configuration details for the App Mesh proxy. Default: - No proxy configuration.
@@ -19958,6 +20014,7 @@ class CommonTaskDefinitionProps:
19958
20014
  # role: iam.Role
19959
20015
 
19960
20016
  common_task_definition_props = ecs.CommonTaskDefinitionProps(
20017
+ enable_fault_injection=False,
19961
20018
  execution_role=role,
19962
20019
  family="family",
19963
20020
  proxy_configuration=proxy_configuration,
@@ -20000,12 +20057,15 @@ class CommonTaskDefinitionProps:
20000
20057
  '''
20001
20058
  if __debug__:
20002
20059
  type_hints = typing.get_type_hints(_typecheckingstub__c1277747b28f7882811be2d0e701d4bf9aa7e64beeaa64689d3e2d7c2d8099c4)
20060
+ check_type(argname="argument enable_fault_injection", value=enable_fault_injection, expected_type=type_hints["enable_fault_injection"])
20003
20061
  check_type(argname="argument execution_role", value=execution_role, expected_type=type_hints["execution_role"])
20004
20062
  check_type(argname="argument family", value=family, expected_type=type_hints["family"])
20005
20063
  check_type(argname="argument proxy_configuration", value=proxy_configuration, expected_type=type_hints["proxy_configuration"])
20006
20064
  check_type(argname="argument task_role", value=task_role, expected_type=type_hints["task_role"])
20007
20065
  check_type(argname="argument volumes", value=volumes, expected_type=type_hints["volumes"])
20008
20066
  self._values: typing.Dict[builtins.str, typing.Any] = {}
20067
+ if enable_fault_injection is not None:
20068
+ self._values["enable_fault_injection"] = enable_fault_injection
20009
20069
  if execution_role is not None:
20010
20070
  self._values["execution_role"] = execution_role
20011
20071
  if family is not None:
@@ -20017,6 +20077,17 @@ class CommonTaskDefinitionProps:
20017
20077
  if volumes is not None:
20018
20078
  self._values["volumes"] = volumes
20019
20079
 
20080
+ @builtins.property
20081
+ def enable_fault_injection(self) -> typing.Optional[builtins.bool]:
20082
+ '''Enables fault injection and allows for fault injection requests to be accepted from the task's containers.
20083
+
20084
+ Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes.
20085
+
20086
+ :default: undefined - ECS default setting is false
20087
+ '''
20088
+ result = self._values.get("enable_fault_injection")
20089
+ return typing.cast(typing.Optional[builtins.bool], result)
20090
+
20020
20091
  @builtins.property
20021
20092
  def execution_role(self) -> typing.Optional[_IRole_235f5d8e]:
20022
20093
  '''The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.
@@ -20160,6 +20231,7 @@ class ContainerDefinition(
20160
20231
  ecs.Ec2Service(self, "Service",
20161
20232
  cluster=cluster,
20162
20233
  task_definition=task_definition,
20234
+ min_healthy_percent=100,
20163
20235
  cloud_map_options=ecs.CloudMapOptions(
20164
20236
  # Create SRV records - useful for bridge networking
20165
20237
  dns_record_type=cloudmap.DnsRecordType.SRV,
@@ -20789,33 +20861,26 @@ class ContainerDefinitionOptions:
20789
20861
 
20790
20862
  Example::
20791
20863
 
20792
- # task_definition: ecs.TaskDefinition
20793
20864
  # cluster: ecs.Cluster
20865
+ # vpc: ec2.Vpc
20794
20866
 
20795
-
20796
- # Add a container to the task definition
20797
- specific_container = task_definition.add_container("Container",
20798
- image=ecs.ContainerImage.from_registry("/aws/aws-example-app"),
20799
- memory_limit_mi_b=2048
20800
- )
20801
-
20802
- # Add a port mapping
20803
- specific_container.add_port_mappings(
20804
- container_port=7600,
20805
- protocol=ecs.Protocol.TCP
20806
- )
20807
-
20808
- ecs.Ec2Service(self, "Service",
20867
+ service = ecs_patterns.ApplicationLoadBalancedFargateService(self, "Service",
20809
20868
  cluster=cluster,
20810
- task_definition=task_definition,
20811
- cloud_map_options=ecs.CloudMapOptions(
20812
- # Create SRV records - useful for bridge networking
20813
- dns_record_type=cloudmap.DnsRecordType.SRV,
20814
- # Targets port TCP port 7600 `specificContainer`
20815
- container=specific_container,
20816
- container_port=7600
20869
+ vpc=vpc,
20870
+ desired_count=1,
20871
+ min_healthy_percent=100,
20872
+ task_image_options=ecsPatterns.ApplicationLoadBalancedTaskImageOptions(
20873
+ image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample"),
20874
+ docker_labels={
20875
+ "application.label.one": "first_label",
20876
+ "application.label.two": "second_label"
20877
+ }
20817
20878
  )
20818
20879
  )
20880
+
20881
+ service.task_definition.add_container("Sidecar",
20882
+ image=ecs.ContainerImage.from_registry("example/metrics-sidecar")
20883
+ )
20819
20884
  '''
20820
20885
  if isinstance(health_check, dict):
20821
20886
  health_check = HealthCheck(**health_check)
@@ -22257,18 +22322,32 @@ class ContainerImage(
22257
22322
 
22258
22323
  Example::
22259
22324
 
22260
- # my_secret: secretsmanager.ISecret
22325
+ # vpc: ec2.Vpc
22261
22326
 
22262
22327
 
22263
- job_defn = batch.EcsJobDefinition(self, "JobDefn",
22264
- container=batch.EcsEc2ContainerDefinition(self, "containerDefn",
22265
- image=ecs.ContainerImage.from_registry("public.ecr.aws/amazonlinux/amazonlinux:latest"),
22266
- memory=cdk.Size.mebibytes(2048),
22267
- cpu=256,
22268
- secrets={
22269
- "MY_SECRET_ENV_VAR": batch.Secret.from_secrets_manager(my_secret)
22270
- }
22328
+ cluster = ecs.Cluster(self, "FargateCPCluster",
22329
+ vpc=vpc,
22330
+ enable_fargate_capacity_providers=True
22331
+ )
22332
+
22333
+ task_definition = ecs.FargateTaskDefinition(self, "TaskDef")
22334
+
22335
+ task_definition.add_container("web",
22336
+ image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
22337
+ )
22338
+
22339
+ ecs.FargateService(self, "FargateService",
22340
+ cluster=cluster,
22341
+ task_definition=task_definition,
22342
+ min_healthy_percent=100,
22343
+ capacity_provider_strategies=[ecs.CapacityProviderStrategy(
22344
+ capacity_provider="FARGATE_SPOT",
22345
+ weight=2
22346
+ ), ecs.CapacityProviderStrategy(
22347
+ capacity_provider="FARGATE",
22348
+ weight=1
22271
22349
  )
22350
+ ]
22272
22351
  )
22273
22352
  '''
22274
22353
 
@@ -22586,7 +22665,8 @@ class ContainerMountPoint(BaseMountPoint):
22586
22665
 
22587
22666
  service = ecs.FargateService(self, "FargateService",
22588
22667
  cluster=cluster,
22589
- task_definition=task_definition
22668
+ task_definition=task_definition,
22669
+ min_healthy_percent=100
22590
22670
  )
22591
22671
 
22592
22672
  service.add_volume(volume)
@@ -22988,6 +23068,7 @@ class DeploymentAlarmOptions:
22988
23068
  service = ecs.FargateService(self, "Service",
22989
23069
  cluster=cluster,
22990
23070
  task_definition=task_definition,
23071
+ min_healthy_percent=100,
22991
23072
  deployment_alarms=ecs.DeploymentAlarmConfig(
22992
23073
  alarm_names=[elb_alarm.alarm_name],
22993
23074
  behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
@@ -23061,6 +23142,7 @@ class DeploymentCircuitBreaker:
23061
23142
  service = ecs.FargateService(self, "Service",
23062
23143
  cluster=cluster,
23063
23144
  task_definition=task_definition,
23145
+ min_healthy_percent=100,
23064
23146
  circuit_breaker=ecs.DeploymentCircuitBreaker(
23065
23147
  enable=True,
23066
23148
  rollback=True
@@ -23716,7 +23798,8 @@ class EbsPropagatedTagSource(enum.Enum):
23716
23798
 
23717
23799
  service = ecs.FargateService(self, "FargateService",
23718
23800
  cluster=cluster,
23719
- task_definition=task_definition
23801
+ task_definition=task_definition,
23802
+ min_healthy_percent=100
23720
23803
  )
23721
23804
 
23722
23805
  service.add_volume(volume)
@@ -23913,7 +23996,7 @@ class Ec2ServiceProps(BaseServiceOptions):
23913
23996
  # task_definition: ecs.TaskDefinition
23914
23997
  # vpc: ec2.Vpc
23915
23998
 
23916
- service = ecs.Ec2Service(self, "Service", cluster=cluster, task_definition=task_definition)
23999
+ service = ecs.Ec2Service(self, "Service", cluster=cluster, task_definition=task_definition, min_healthy_percent=100)
23917
24000
 
23918
24001
  lb = elb.LoadBalancer(self, "LB", vpc=vpc)
23919
24002
  lb.add_listener(external_port=80)
@@ -24396,6 +24479,7 @@ class Ec2TaskDefinitionAttributes(CommonTaskDefinitionAttributes):
24396
24479
  jsii_type="aws-cdk-lib.aws_ecs.Ec2TaskDefinitionProps",
24397
24480
  jsii_struct_bases=[CommonTaskDefinitionProps],
24398
24481
  name_mapping={
24482
+ "enable_fault_injection": "enableFaultInjection",
24399
24483
  "execution_role": "executionRole",
24400
24484
  "family": "family",
24401
24485
  "proxy_configuration": "proxyConfiguration",
@@ -24412,6 +24496,7 @@ class Ec2TaskDefinitionProps(CommonTaskDefinitionProps):
24412
24496
  def __init__(
24413
24497
  self,
24414
24498
  *,
24499
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
24415
24500
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
24416
24501
  family: typing.Optional[builtins.str] = None,
24417
24502
  proxy_configuration: typing.Optional["ProxyConfiguration"] = None,
@@ -24425,6 +24510,7 @@ class Ec2TaskDefinitionProps(CommonTaskDefinitionProps):
24425
24510
  ) -> None:
24426
24511
  '''The properties for a task definition run on an EC2 cluster.
24427
24512
 
24513
+ :param enable_fault_injection: Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes. Default: undefined - ECS default setting is false
24428
24514
  :param execution_role: The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. The role will be used to retrieve container images from ECR and create CloudWatch log groups. Default: - An execution role will be automatically created if you use ECR images in your task definition.
24429
24515
  :param family: The name of a family that this task definition is registered to. A family groups multiple versions of a task definition. Default: - Automatically generated name.
24430
24516
  :param proxy_configuration: The configuration details for the App Mesh proxy. Default: - No proxy configuration.
@@ -24440,18 +24526,18 @@ class Ec2TaskDefinitionProps(CommonTaskDefinitionProps):
24440
24526
 
24441
24527
  Example::
24442
24528
 
24443
- ec2_task_definition = ecs.Ec2TaskDefinition(self, "TaskDef",
24444
- network_mode=ecs.NetworkMode.BRIDGE
24445
- )
24529
+ inference_accelerators = [{
24530
+ "device_name": "device1",
24531
+ "device_type": "eia2.medium"
24532
+ }]
24446
24533
 
24447
- container = ec2_task_definition.add_container("WebContainer",
24448
- # Use an image from DockerHub
24449
- image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample"),
24450
- memory_limit_mi_b=1024
24534
+ task_definition = ecs.Ec2TaskDefinition(self, "Ec2TaskDef",
24535
+ inference_accelerators=inference_accelerators
24451
24536
  )
24452
24537
  '''
24453
24538
  if __debug__:
24454
24539
  type_hints = typing.get_type_hints(_typecheckingstub__11bd13308faca16514041c56d48a3f2515c80d4039888b53668ceaca5b37dc0e)
24540
+ check_type(argname="argument enable_fault_injection", value=enable_fault_injection, expected_type=type_hints["enable_fault_injection"])
24455
24541
  check_type(argname="argument execution_role", value=execution_role, expected_type=type_hints["execution_role"])
24456
24542
  check_type(argname="argument family", value=family, expected_type=type_hints["family"])
24457
24543
  check_type(argname="argument proxy_configuration", value=proxy_configuration, expected_type=type_hints["proxy_configuration"])
@@ -24463,6 +24549,8 @@ class Ec2TaskDefinitionProps(CommonTaskDefinitionProps):
24463
24549
  check_type(argname="argument pid_mode", value=pid_mode, expected_type=type_hints["pid_mode"])
24464
24550
  check_type(argname="argument placement_constraints", value=placement_constraints, expected_type=type_hints["placement_constraints"])
24465
24551
  self._values: typing.Dict[builtins.str, typing.Any] = {}
24552
+ if enable_fault_injection is not None:
24553
+ self._values["enable_fault_injection"] = enable_fault_injection
24466
24554
  if execution_role is not None:
24467
24555
  self._values["execution_role"] = execution_role
24468
24556
  if family is not None:
@@ -24484,6 +24572,17 @@ class Ec2TaskDefinitionProps(CommonTaskDefinitionProps):
24484
24572
  if placement_constraints is not None:
24485
24573
  self._values["placement_constraints"] = placement_constraints
24486
24574
 
24575
+ @builtins.property
24576
+ def enable_fault_injection(self) -> typing.Optional[builtins.bool]:
24577
+ '''Enables fault injection and allows for fault injection requests to be accepted from the task's containers.
24578
+
24579
+ Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes.
24580
+
24581
+ :default: undefined - ECS default setting is false
24582
+ '''
24583
+ result = self._values.get("enable_fault_injection")
24584
+ return typing.cast(typing.Optional[builtins.bool], result)
24585
+
24487
24586
  @builtins.property
24488
24587
  def execution_role(self) -> typing.Optional[_IRole_235f5d8e]:
24489
24588
  '''The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.
@@ -24909,7 +25008,7 @@ class EcsTarget:
24909
25008
  # task_definition: ecs.TaskDefinition
24910
25009
  # vpc: ec2.Vpc
24911
25010
 
24912
- service = ecs.FargateService(self, "Service", cluster=cluster, task_definition=task_definition)
25011
+ service = ecs.FargateService(self, "Service", cluster=cluster, task_definition=task_definition, min_healthy_percent=100)
24913
25012
 
24914
25013
  lb = elbv2.ApplicationLoadBalancer(self, "LB", vpc=vpc, internet_facing=True)
24915
25014
  listener = lb.add_listener("Listener", port=80)
@@ -25828,7 +25927,8 @@ class ExternalServiceProps(BaseServiceOptions):
25828
25927
  service = ecs.ExternalService(self, "Service",
25829
25928
  cluster=cluster,
25830
25929
  task_definition=task_definition,
25831
- desired_count=5
25930
+ desired_count=5,
25931
+ min_healthy_percent=100
25832
25932
  )
25833
25933
  '''
25834
25934
  if isinstance(circuit_breaker, dict):
@@ -26223,6 +26323,7 @@ class ExternalTaskDefinitionAttributes(CommonTaskDefinitionAttributes):
26223
26323
  jsii_type="aws-cdk-lib.aws_ecs.ExternalTaskDefinitionProps",
26224
26324
  jsii_struct_bases=[CommonTaskDefinitionProps],
26225
26325
  name_mapping={
26326
+ "enable_fault_injection": "enableFaultInjection",
26226
26327
  "execution_role": "executionRole",
26227
26328
  "family": "family",
26228
26329
  "proxy_configuration": "proxyConfiguration",
@@ -26235,6 +26336,7 @@ class ExternalTaskDefinitionProps(CommonTaskDefinitionProps):
26235
26336
  def __init__(
26236
26337
  self,
26237
26338
  *,
26339
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
26238
26340
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
26239
26341
  family: typing.Optional[builtins.str] = None,
26240
26342
  proxy_configuration: typing.Optional["ProxyConfiguration"] = None,
@@ -26244,6 +26346,7 @@ class ExternalTaskDefinitionProps(CommonTaskDefinitionProps):
26244
26346
  ) -> None:
26245
26347
  '''The properties for a task definition run on an External cluster.
26246
26348
 
26349
+ :param enable_fault_injection: Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes. Default: undefined - ECS default setting is false
26247
26350
  :param execution_role: The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. The role will be used to retrieve container images from ECR and create CloudWatch log groups. Default: - An execution role will be automatically created if you use ECR images in your task definition.
26248
26351
  :param family: The name of a family that this task definition is registered to. A family groups multiple versions of a task definition. Default: - Automatically generated name.
26249
26352
  :param proxy_configuration: The configuration details for the App Mesh proxy. Default: - No proxy configuration.
@@ -26264,6 +26367,7 @@ class ExternalTaskDefinitionProps(CommonTaskDefinitionProps):
26264
26367
  # role: iam.Role
26265
26368
 
26266
26369
  external_task_definition_props = ecs.ExternalTaskDefinitionProps(
26370
+ enable_fault_injection=False,
26267
26371
  execution_role=role,
26268
26372
  family="family",
26269
26373
  network_mode=ecs.NetworkMode.NONE,
@@ -26307,6 +26411,7 @@ class ExternalTaskDefinitionProps(CommonTaskDefinitionProps):
26307
26411
  '''
26308
26412
  if __debug__:
26309
26413
  type_hints = typing.get_type_hints(_typecheckingstub__9b7789082516541a1aab36b1c591e13ce99110db761ab34a0d177950ecd704cb)
26414
+ check_type(argname="argument enable_fault_injection", value=enable_fault_injection, expected_type=type_hints["enable_fault_injection"])
26310
26415
  check_type(argname="argument execution_role", value=execution_role, expected_type=type_hints["execution_role"])
26311
26416
  check_type(argname="argument family", value=family, expected_type=type_hints["family"])
26312
26417
  check_type(argname="argument proxy_configuration", value=proxy_configuration, expected_type=type_hints["proxy_configuration"])
@@ -26314,6 +26419,8 @@ class ExternalTaskDefinitionProps(CommonTaskDefinitionProps):
26314
26419
  check_type(argname="argument volumes", value=volumes, expected_type=type_hints["volumes"])
26315
26420
  check_type(argname="argument network_mode", value=network_mode, expected_type=type_hints["network_mode"])
26316
26421
  self._values: typing.Dict[builtins.str, typing.Any] = {}
26422
+ if enable_fault_injection is not None:
26423
+ self._values["enable_fault_injection"] = enable_fault_injection
26317
26424
  if execution_role is not None:
26318
26425
  self._values["execution_role"] = execution_role
26319
26426
  if family is not None:
@@ -26327,6 +26434,17 @@ class ExternalTaskDefinitionProps(CommonTaskDefinitionProps):
26327
26434
  if network_mode is not None:
26328
26435
  self._values["network_mode"] = network_mode
26329
26436
 
26437
+ @builtins.property
26438
+ def enable_fault_injection(self) -> typing.Optional[builtins.bool]:
26439
+ '''Enables fault injection and allows for fault injection requests to be accepted from the task's containers.
26440
+
26441
+ Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes.
26442
+
26443
+ :default: undefined - ECS default setting is false
26444
+ '''
26445
+ result = self._values.get("enable_fault_injection")
26446
+ return typing.cast(typing.Optional[builtins.bool], result)
26447
+
26330
26448
  @builtins.property
26331
26449
  def execution_role(self) -> typing.Optional[_IRole_235f5d8e]:
26332
26450
  '''The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.
@@ -26640,6 +26758,7 @@ class FargateServiceProps(BaseServiceOptions):
26640
26758
  service = ecs.FargateService(self, "Service",
26641
26759
  cluster=cluster,
26642
26760
  task_definition=task_definition,
26761
+ min_healthy_percent=100,
26643
26762
  deployment_alarms=ecs.DeploymentAlarmConfig(
26644
26763
  alarm_names=[elb_alarm.alarm_name],
26645
26764
  behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
@@ -27094,6 +27213,7 @@ class FargateTaskDefinitionAttributes(CommonTaskDefinitionAttributes):
27094
27213
  jsii_type="aws-cdk-lib.aws_ecs.FargateTaskDefinitionProps",
27095
27214
  jsii_struct_bases=[CommonTaskDefinitionProps],
27096
27215
  name_mapping={
27216
+ "enable_fault_injection": "enableFaultInjection",
27097
27217
  "execution_role": "executionRole",
27098
27218
  "family": "family",
27099
27219
  "proxy_configuration": "proxyConfiguration",
@@ -27110,6 +27230,7 @@ class FargateTaskDefinitionProps(CommonTaskDefinitionProps):
27110
27230
  def __init__(
27111
27231
  self,
27112
27232
  *,
27233
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
27113
27234
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
27114
27235
  family: typing.Optional[builtins.str] = None,
27115
27236
  proxy_configuration: typing.Optional["ProxyConfiguration"] = None,
@@ -27123,6 +27244,7 @@ class FargateTaskDefinitionProps(CommonTaskDefinitionProps):
27123
27244
  ) -> None:
27124
27245
  '''The properties for a task definition.
27125
27246
 
27247
+ :param enable_fault_injection: Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes. Default: undefined - ECS default setting is false
27126
27248
  :param execution_role: The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. The role will be used to retrieve container images from ECR and create CloudWatch log groups. Default: - An execution role will be automatically created if you use ECR images in your task definition.
27127
27249
  :param family: The name of a family that this task definition is registered to. A family groups multiple versions of a task definition. Default: - Automatically generated name.
27128
27250
  :param proxy_configuration: The configuration details for the App Mesh proxy. Default: - No proxy configuration.
@@ -27152,6 +27274,7 @@ class FargateTaskDefinitionProps(CommonTaskDefinitionProps):
27152
27274
  runtime_platform = RuntimePlatform(**runtime_platform)
27153
27275
  if __debug__:
27154
27276
  type_hints = typing.get_type_hints(_typecheckingstub__da4d0b48fbacde979163c93d7fd8d5697220f750806124aabb65f0c3d34fd6ea)
27277
+ check_type(argname="argument enable_fault_injection", value=enable_fault_injection, expected_type=type_hints["enable_fault_injection"])
27155
27278
  check_type(argname="argument execution_role", value=execution_role, expected_type=type_hints["execution_role"])
27156
27279
  check_type(argname="argument family", value=family, expected_type=type_hints["family"])
27157
27280
  check_type(argname="argument proxy_configuration", value=proxy_configuration, expected_type=type_hints["proxy_configuration"])
@@ -27163,6 +27286,8 @@ class FargateTaskDefinitionProps(CommonTaskDefinitionProps):
27163
27286
  check_type(argname="argument pid_mode", value=pid_mode, expected_type=type_hints["pid_mode"])
27164
27287
  check_type(argname="argument runtime_platform", value=runtime_platform, expected_type=type_hints["runtime_platform"])
27165
27288
  self._values: typing.Dict[builtins.str, typing.Any] = {}
27289
+ if enable_fault_injection is not None:
27290
+ self._values["enable_fault_injection"] = enable_fault_injection
27166
27291
  if execution_role is not None:
27167
27292
  self._values["execution_role"] = execution_role
27168
27293
  if family is not None:
@@ -27184,6 +27309,17 @@ class FargateTaskDefinitionProps(CommonTaskDefinitionProps):
27184
27309
  if runtime_platform is not None:
27185
27310
  self._values["runtime_platform"] = runtime_platform
27186
27311
 
27312
+ @builtins.property
27313
+ def enable_fault_injection(self) -> typing.Optional[builtins.bool]:
27314
+ '''Enables fault injection and allows for fault injection requests to be accepted from the task's containers.
27315
+
27316
+ Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes.
27317
+
27318
+ :default: undefined - ECS default setting is false
27319
+ '''
27320
+ result = self._values.get("enable_fault_injection")
27321
+ return typing.cast(typing.Optional[builtins.bool], result)
27322
+
27187
27323
  @builtins.property
27188
27324
  def execution_role(self) -> typing.Optional[_IRole_235f5d8e]:
27189
27325
  '''The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.
@@ -27385,7 +27521,8 @@ class FileSystemType(enum.Enum):
27385
27521
 
27386
27522
  service = ecs.FargateService(self, "FargateService",
27387
27523
  cluster=cluster,
27388
- task_definition=task_definition
27524
+ task_definition=task_definition,
27525
+ min_healthy_percent=100
27389
27526
  )
27390
27527
 
27391
27528
  service.add_volume(volume)
@@ -30206,6 +30343,7 @@ class HealthCheck:
30206
30343
  vpc=vpc,
30207
30344
  memory_limit_mi_b=512,
30208
30345
  image=ecs.ContainerImage.from_registry("test"),
30346
+ min_healthy_percent=100,
30209
30347
  health_check=ecs.HealthCheck(
30210
30348
  command=["CMD-SHELL", "curl -f http://localhost/ || exit 1"],
30211
30349
  # the properties below are optional
@@ -31397,7 +31535,7 @@ class ListenerConfig(
31397
31535
  # task_definition: ecs.TaskDefinition
31398
31536
  # vpc: ec2.Vpc
31399
31537
 
31400
- service = ecs.FargateService(self, "Service", cluster=cluster, task_definition=task_definition)
31538
+ service = ecs.FargateService(self, "Service", cluster=cluster, task_definition=task_definition, min_healthy_percent=100)
31401
31539
 
31402
31540
  lb = elbv2.ApplicationLoadBalancer(self, "LB", vpc=vpc, internet_facing=True)
31403
31541
  listener = lb.add_listener("Listener", port=80)
@@ -31593,7 +31731,7 @@ class LoadBalancerTargetOptions:
31593
31731
  # task_definition: ecs.TaskDefinition
31594
31732
  # vpc: ec2.Vpc
31595
31733
 
31596
- service = ecs.Ec2Service(self, "Service", cluster=cluster, task_definition=task_definition)
31734
+ service = ecs.Ec2Service(self, "Service", cluster=cluster, task_definition=task_definition, min_healthy_percent=100)
31597
31735
 
31598
31736
  lb = elb.LoadBalancer(self, "LB", vpc=vpc)
31599
31737
  lb.add_listener(external_port=80)
@@ -32357,7 +32495,8 @@ class MemoryUtilizationScalingProps(_BaseTargetTrackingProps_540ba713):
32357
32495
  cpu=512,
32358
32496
  task_image_options=ecsPatterns.ApplicationLoadBalancedTaskImageOptions(
32359
32497
  image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
32360
- )
32498
+ ),
32499
+ min_healthy_percent=100
32361
32500
  )
32362
32501
 
32363
32502
  scalable_target = load_balanced_fargate_service.service.auto_scale_task_count(
@@ -33235,6 +33374,7 @@ class Protocol(enum.Enum):
33235
33374
  ecs.Ec2Service(self, "Service",
33236
33375
  cluster=cluster,
33237
33376
  task_definition=task_definition,
33377
+ min_healthy_percent=100,
33238
33378
  cloud_map_options=ecs.CloudMapOptions(
33239
33379
  # Create SRV records - useful for bridge networking
33240
33380
  dns_record_type=cloudmap.DnsRecordType.SRV,
@@ -33630,20 +33770,19 @@ class RuntimePlatform:
33630
33770
 
33631
33771
  Example::
33632
33772
 
33633
- # Create a Task Definition for the Windows container to start
33634
- task_definition = ecs.FargateTaskDefinition(self, "TaskDef",
33635
- runtime_platform=ecs.RuntimePlatform(
33636
- operating_system_family=ecs.OperatingSystemFamily.WINDOWS_SERVER_2019_CORE,
33637
- cpu_architecture=ecs.CpuArchitecture.X86_64
33638
- ),
33639
- cpu=1024,
33640
- memory_limit_mi_b=2048
33641
- )
33773
+ # cluster: ecs.Cluster
33642
33774
 
33643
- task_definition.add_container("windowsservercore",
33644
- logging=ecs.LogDriver.aws_logs(stream_prefix="win-iis-on-fargate"),
33645
- port_mappings=[ecs.PortMapping(container_port=80)],
33646
- image=ecs.ContainerImage.from_registry("mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019")
33775
+ application_load_balanced_fargate_service = ecs_patterns.ApplicationLoadBalancedFargateService(self, "Service",
33776
+ cluster=cluster,
33777
+ memory_limit_mi_b=512,
33778
+ task_image_options=ecsPatterns.ApplicationLoadBalancedTaskImageOptions(
33779
+ image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
33780
+ ),
33781
+ min_healthy_percent=100,
33782
+ runtime_platform=ecs.RuntimePlatform(
33783
+ cpu_architecture=ecs.CpuArchitecture.ARM64,
33784
+ operating_system_family=ecs.OperatingSystemFamily.LINUX
33785
+ )
33647
33786
  )
33648
33787
  '''
33649
33788
  if __debug__:
@@ -33757,7 +33896,8 @@ class ScalableTaskCount(
33757
33896
  cpu=512,
33758
33897
  task_image_options=ecsPatterns.ApplicationLoadBalancedTaskImageOptions(
33759
33898
  image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
33760
- )
33899
+ ),
33900
+ min_healthy_percent=100
33761
33901
  )
33762
33902
 
33763
33903
  scalable_target = load_balanced_fargate_service.service.auto_scale_task_count(
@@ -34613,6 +34753,7 @@ class ServiceConnectProps:
34613
34753
  custom_service = ecs.FargateService(self, "CustomizedService",
34614
34754
  cluster=cluster,
34615
34755
  task_definition=task_definition,
34756
+ min_healthy_percent=100,
34616
34757
  service_connect_configuration=ecs.ServiceConnectProps(
34617
34758
  log_driver=ecs.LogDrivers.aws_logs(
34618
34759
  stream_prefix="sc-traffic"
@@ -34938,7 +35079,8 @@ class ServiceManagedEBSVolumeConfiguration:
34938
35079
 
34939
35080
  service = ecs.FargateService(self, "FargateService",
34940
35081
  cluster=cluster,
34941
- task_definition=task_definition
35082
+ task_definition=task_definition,
35083
+ min_healthy_percent=100
34942
35084
  )
34943
35085
 
34944
35086
  service.add_volume(volume)
@@ -35165,7 +35307,8 @@ class ServiceManagedVolume(
35165
35307
 
35166
35308
  service = ecs.FargateService(self, "FargateService",
35167
35309
  cluster=cluster,
35168
- task_definition=task_definition
35310
+ task_definition=task_definition,
35311
+ min_healthy_percent=100
35169
35312
  )
35170
35313
 
35171
35314
  service.add_volume(volume)
@@ -35303,7 +35446,8 @@ class ServiceManagedVolumeProps:
35303
35446
 
35304
35447
  service = ecs.FargateService(self, "FargateService",
35305
35448
  cluster=cluster,
35306
- task_definition=task_definition
35449
+ task_definition=task_definition,
35450
+ min_healthy_percent=100
35307
35451
  )
35308
35452
 
35309
35453
  service.add_volume(volume)
@@ -36432,7 +36576,7 @@ class TaskDefinition(
36432
36576
  # task_definition: ecs.TaskDefinition
36433
36577
  # vpc: ec2.Vpc
36434
36578
 
36435
- service = ecs.FargateService(self, "Service", cluster=cluster, task_definition=task_definition)
36579
+ service = ecs.FargateService(self, "Service", cluster=cluster, task_definition=task_definition, min_healthy_percent=100)
36436
36580
 
36437
36581
  lb = elbv2.ApplicationLoadBalancer(self, "LB", vpc=vpc, internet_facing=True)
36438
36582
  listener = lb.add_listener("Listener", port=80)
@@ -36461,6 +36605,7 @@ class TaskDefinition(
36461
36605
  pid_mode: typing.Optional[PidMode] = None,
36462
36606
  placement_constraints: typing.Optional[typing.Sequence[PlacementConstraint]] = None,
36463
36607
  runtime_platform: typing.Optional[typing.Union[RuntimePlatform, typing.Dict[builtins.str, typing.Any]]] = None,
36608
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
36464
36609
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
36465
36610
  family: typing.Optional[builtins.str] = None,
36466
36611
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -36481,6 +36626,7 @@ class TaskDefinition(
36481
36626
  :param pid_mode: The process namespace to use for the containers in the task. Only supported for tasks that are hosted on AWS Fargate if the tasks are using platform version 1.4.0 or later (Linux). Only the TASK option is supported for Linux-based Fargate containers. Not supported in Windows containers. If pidMode is specified for a Fargate task, then runtimePlatform.operatingSystemFamily must also be specified. For more information, see `Task Definition Parameters <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_definition_pidmode>`_. Default: - PidMode used by the task is not specified
36482
36627
  :param placement_constraints: The placement constraints to use for tasks in the service. You can specify a maximum of 10 constraints per task (this limit includes constraints in the task definition and those specified at run time). Not supported in Fargate. Default: - No placement constraints.
36483
36628
  :param runtime_platform: The operating system that your task definitions are running on. A runtimePlatform is supported only for tasks using the Fargate launch type. Default: - Undefined.
36629
+ :param enable_fault_injection: Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes. Default: undefined - ECS default setting is false
36484
36630
  :param execution_role: The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. The role will be used to retrieve container images from ECR and create CloudWatch log groups. Default: - An execution role will be automatically created if you use ECR images in your task definition.
36485
36631
  :param family: The name of a family that this task definition is registered to. A family groups multiple versions of a task definition. Default: - Automatically generated name.
36486
36632
  :param proxy_configuration: The configuration details for the App Mesh proxy. Default: - No proxy configuration.
@@ -36502,6 +36648,7 @@ class TaskDefinition(
36502
36648
  pid_mode=pid_mode,
36503
36649
  placement_constraints=placement_constraints,
36504
36650
  runtime_platform=runtime_platform,
36651
+ enable_fault_injection=enable_fault_injection,
36505
36652
  execution_role=execution_role,
36506
36653
  family=family,
36507
36654
  proxy_configuration=proxy_configuration,
@@ -37234,6 +37381,7 @@ class TaskDefinitionAttributes(CommonTaskDefinitionAttributes):
37234
37381
  jsii_type="aws-cdk-lib.aws_ecs.TaskDefinitionProps",
37235
37382
  jsii_struct_bases=[CommonTaskDefinitionProps],
37236
37383
  name_mapping={
37384
+ "enable_fault_injection": "enableFaultInjection",
37237
37385
  "execution_role": "executionRole",
37238
37386
  "family": "family",
37239
37387
  "proxy_configuration": "proxyConfiguration",
@@ -37255,6 +37403,7 @@ class TaskDefinitionProps(CommonTaskDefinitionProps):
37255
37403
  def __init__(
37256
37404
  self,
37257
37405
  *,
37406
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
37258
37407
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
37259
37408
  family: typing.Optional[builtins.str] = None,
37260
37409
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -37273,6 +37422,7 @@ class TaskDefinitionProps(CommonTaskDefinitionProps):
37273
37422
  ) -> None:
37274
37423
  '''The properties for task definitions.
37275
37424
 
37425
+ :param enable_fault_injection: Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes. Default: undefined - ECS default setting is false
37276
37426
  :param execution_role: The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. The role will be used to retrieve container images from ECR and create CloudWatch log groups. Default: - An execution role will be automatically created if you use ECR images in your task definition.
37277
37427
  :param family: The name of a family that this task definition is registered to. A family groups multiple versions of a task definition. Default: - Automatically generated name.
37278
37428
  :param proxy_configuration: The configuration details for the App Mesh proxy. Default: - No proxy configuration.
@@ -37327,6 +37477,7 @@ class TaskDefinitionProps(CommonTaskDefinitionProps):
37327
37477
  runtime_platform = RuntimePlatform(**runtime_platform)
37328
37478
  if __debug__:
37329
37479
  type_hints = typing.get_type_hints(_typecheckingstub__94a3565a38b8645ada9c86c3d7ac059ba028553c5ec103fcd16884f758cda48d)
37480
+ check_type(argname="argument enable_fault_injection", value=enable_fault_injection, expected_type=type_hints["enable_fault_injection"])
37330
37481
  check_type(argname="argument execution_role", value=execution_role, expected_type=type_hints["execution_role"])
37331
37482
  check_type(argname="argument family", value=family, expected_type=type_hints["family"])
37332
37483
  check_type(argname="argument proxy_configuration", value=proxy_configuration, expected_type=type_hints["proxy_configuration"])
@@ -37345,6 +37496,8 @@ class TaskDefinitionProps(CommonTaskDefinitionProps):
37345
37496
  self._values: typing.Dict[builtins.str, typing.Any] = {
37346
37497
  "compatibility": compatibility,
37347
37498
  }
37499
+ if enable_fault_injection is not None:
37500
+ self._values["enable_fault_injection"] = enable_fault_injection
37348
37501
  if execution_role is not None:
37349
37502
  self._values["execution_role"] = execution_role
37350
37503
  if family is not None:
@@ -37374,6 +37527,17 @@ class TaskDefinitionProps(CommonTaskDefinitionProps):
37374
37527
  if runtime_platform is not None:
37375
37528
  self._values["runtime_platform"] = runtime_platform
37376
37529
 
37530
+ @builtins.property
37531
+ def enable_fault_injection(self) -> typing.Optional[builtins.bool]:
37532
+ '''Enables fault injection and allows for fault injection requests to be accepted from the task's containers.
37533
+
37534
+ Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes.
37535
+
37536
+ :default: undefined - ECS default setting is false
37537
+ '''
37538
+ result = self._values.get("enable_fault_injection")
37539
+ return typing.cast(typing.Optional[builtins.bool], result)
37540
+
37377
37541
  @builtins.property
37378
37542
  def execution_role(self) -> typing.Optional[_IRole_235f5d8e]:
37379
37543
  '''The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf.
@@ -37606,6 +37770,7 @@ class TaskDefinitionRevision(
37606
37770
  cluster=cluster,
37607
37771
  task_definition=task_definition,
37608
37772
  desired_count=5,
37773
+ min_healthy_percent=100,
37609
37774
  task_definition_revision=ecs.TaskDefinitionRevision.of(1)
37610
37775
  )
37611
37776
 
@@ -37613,6 +37778,7 @@ class TaskDefinitionRevision(
37613
37778
  cluster=cluster,
37614
37779
  task_definition=task_definition,
37615
37780
  desired_count=5,
37781
+ min_healthy_percent=100,
37616
37782
  task_definition_revision=ecs.TaskDefinitionRevision.LATEST
37617
37783
  )
37618
37784
  '''
@@ -38118,7 +38284,8 @@ class Volume:
38118
38284
  task_definition.add_volume(volume_from_snapshot)
38119
38285
  service = ecs.FargateService(self, "FargateService",
38120
38286
  cluster=cluster,
38121
- task_definition=task_definition
38287
+ task_definition=task_definition,
38288
+ min_healthy_percent=100
38122
38289
  )
38123
38290
 
38124
38291
  service.add_volume(volume_from_snapshot)
@@ -38932,7 +39099,7 @@ class Cluster(
38932
39099
  '''This method adds an Auto Scaling Group Capacity Provider to a cluster.
38933
39100
 
38934
39101
  :param provider: the capacity provider to add to this cluster.
38935
- :param can_containers_access_instance_role: Specifies whether the containers can access the container instance role. Default: false
39102
+ :param can_containers_access_instance_role: (deprecated) Specifies whether the containers can access the container instance role. Default: true if
38936
39103
  :param machine_image_type: What type of machine image this is. Depending on the setting, different UserData will automatically be added to the ``AutoScalingGroup`` to configure it properly for use with ECS. If you create an ``AutoScalingGroup`` yourself and are adding it via ``addAutoScalingGroup()``, you must specify this value. If you are adding an ``autoScalingGroup`` via ``addCapacity``, this value will be determined from the ``machineImage`` you pass. Default: - Automatically determined from ``machineImage``, if available, otherwise ``MachineImageType.AMAZON_LINUX_2``.
38937
39104
  :param spot_instance_draining: Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services. For more information, see `Using Spot Instances <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-spot.html>`_. Default: false
38938
39105
  :param topic_encryption_key: If ``AddAutoScalingGroupCapacityOptions.taskDrainTime`` is non-zero, then the ECS cluster creates an SNS Topic to as part of a system to drain instances of tasks when the instance is being shut down. If this property is provided, then this key will be used to encrypt the contents of that SNS Topic. See `SNS Data Encryption <https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html>`_ for more information. Default: The SNS Topic will not be encrypted.
@@ -38997,7 +39164,7 @@ class Cluster(
38997
39164
  :param id: -
38998
39165
  :param instance_type: The EC2 instance type to use when launching instances into the AutoScalingGroup.
38999
39166
  :param machine_image: The ECS-optimized AMI variant to use. The default is to use an ECS-optimized AMI of Amazon Linux 2 which is automatically updated to the latest version on every deployment. This will replace the instances in the AutoScalingGroup. Make sure you have not disabled task draining, to avoid downtime when the AMI updates. To use an image that does not update on every deployment, pass:: const machineImage = ecs.EcsOptimizedImage.amazonLinux2(ecs.AmiHardwareType.STANDARD, { cachedInContext: true, }); For more information, see `Amazon ECS-optimized AMIs <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html>`_. You must define either ``machineImage`` or ``machineImageType``, not both. Default: - Automatically updated, ECS-optimized Amazon Linux 2
39000
- :param can_containers_access_instance_role: Specifies whether the containers can access the container instance role. Default: false
39167
+ :param can_containers_access_instance_role: (deprecated) Specifies whether the containers can access the container instance role. Default: true if
39001
39168
  :param machine_image_type: What type of machine image this is. Depending on the setting, different UserData will automatically be added to the ``AutoScalingGroup`` to configure it properly for use with ECS. If you create an ``AutoScalingGroup`` yourself and are adding it via ``addAutoScalingGroup()``, you must specify this value. If you are adding an ``autoScalingGroup`` via ``addCapacity``, this value will be determined from the ``machineImage`` you pass. Default: - Automatically determined from ``machineImage``, if available, otherwise ``MachineImageType.AMAZON_LINUX_2``.
39002
39169
  :param spot_instance_draining: Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services. For more information, see `Using Spot Instances <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-spot.html>`_. Default: false
39003
39170
  :param topic_encryption_key: If ``AddAutoScalingGroupCapacityOptions.taskDrainTime`` is non-zero, then the ECS cluster creates an SNS Topic to as part of a system to drain instances of tasks when the instance is being shut down. If this property is provided, then this key will be used to encrypt the contents of that SNS Topic. See `SNS Data Encryption <https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html>`_ for more information. Default: The SNS Topic will not be encrypted.
@@ -39155,6 +39322,8 @@ class Cluster(
39155
39322
  label: typing.Optional[builtins.str] = None,
39156
39323
  period: typing.Optional[_Duration_4839e8c3] = None,
39157
39324
  region: typing.Optional[builtins.str] = None,
39325
+ stack_account: typing.Optional[builtins.str] = None,
39326
+ stack_region: typing.Optional[builtins.str] = None,
39158
39327
  statistic: typing.Optional[builtins.str] = None,
39159
39328
  unit: typing.Optional[_Unit_61bc6f70] = None,
39160
39329
  ) -> _Metric_e396a4dc:
@@ -39167,6 +39336,8 @@ class Cluster(
39167
39336
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. Default: - No label
39168
39337
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
39169
39338
  :param region: Region which this metric comes from. Default: - Deployment region.
39339
+ :param stack_account: Account of the stack this metric is attached to. Default: - Deployment account.
39340
+ :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
39170
39341
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
39171
39342
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
39172
39343
  '''
@@ -39180,6 +39351,8 @@ class Cluster(
39180
39351
  label=label,
39181
39352
  period=period,
39182
39353
  region=region,
39354
+ stack_account=stack_account,
39355
+ stack_region=stack_region,
39183
39356
  statistic=statistic,
39184
39357
  unit=unit,
39185
39358
  )
@@ -39196,6 +39369,8 @@ class Cluster(
39196
39369
  label: typing.Optional[builtins.str] = None,
39197
39370
  period: typing.Optional[_Duration_4839e8c3] = None,
39198
39371
  region: typing.Optional[builtins.str] = None,
39372
+ stack_account: typing.Optional[builtins.str] = None,
39373
+ stack_region: typing.Optional[builtins.str] = None,
39199
39374
  statistic: typing.Optional[builtins.str] = None,
39200
39375
  unit: typing.Optional[_Unit_61bc6f70] = None,
39201
39376
  ) -> _Metric_e396a4dc:
@@ -39207,6 +39382,8 @@ class Cluster(
39207
39382
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. Default: - No label
39208
39383
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
39209
39384
  :param region: Region which this metric comes from. Default: - Deployment region.
39385
+ :param stack_account: Account of the stack this metric is attached to. Default: - Deployment account.
39386
+ :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
39210
39387
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
39211
39388
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
39212
39389
 
@@ -39219,6 +39396,8 @@ class Cluster(
39219
39396
  label=label,
39220
39397
  period=period,
39221
39398
  region=region,
39399
+ stack_account=stack_account,
39400
+ stack_region=stack_region,
39222
39401
  statistic=statistic,
39223
39402
  unit=unit,
39224
39403
  )
@@ -39235,6 +39414,8 @@ class Cluster(
39235
39414
  label: typing.Optional[builtins.str] = None,
39236
39415
  period: typing.Optional[_Duration_4839e8c3] = None,
39237
39416
  region: typing.Optional[builtins.str] = None,
39417
+ stack_account: typing.Optional[builtins.str] = None,
39418
+ stack_region: typing.Optional[builtins.str] = None,
39238
39419
  statistic: typing.Optional[builtins.str] = None,
39239
39420
  unit: typing.Optional[_Unit_61bc6f70] = None,
39240
39421
  ) -> _Metric_e396a4dc:
@@ -39246,6 +39427,8 @@ class Cluster(
39246
39427
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. Default: - No label
39247
39428
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
39248
39429
  :param region: Region which this metric comes from. Default: - Deployment region.
39430
+ :param stack_account: Account of the stack this metric is attached to. Default: - Deployment account.
39431
+ :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
39249
39432
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
39250
39433
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
39251
39434
 
@@ -39258,6 +39441,8 @@ class Cluster(
39258
39441
  label=label,
39259
39442
  period=period,
39260
39443
  region=region,
39444
+ stack_account=stack_account,
39445
+ stack_region=stack_region,
39261
39446
  statistic=statistic,
39262
39447
  unit=unit,
39263
39448
  )
@@ -39274,6 +39459,8 @@ class Cluster(
39274
39459
  label: typing.Optional[builtins.str] = None,
39275
39460
  period: typing.Optional[_Duration_4839e8c3] = None,
39276
39461
  region: typing.Optional[builtins.str] = None,
39462
+ stack_account: typing.Optional[builtins.str] = None,
39463
+ stack_region: typing.Optional[builtins.str] = None,
39277
39464
  statistic: typing.Optional[builtins.str] = None,
39278
39465
  unit: typing.Optional[_Unit_61bc6f70] = None,
39279
39466
  ) -> _Metric_e396a4dc:
@@ -39285,6 +39472,8 @@ class Cluster(
39285
39472
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. Default: - No label
39286
39473
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
39287
39474
  :param region: Region which this metric comes from. Default: - Deployment region.
39475
+ :param stack_account: Account of the stack this metric is attached to. Default: - Deployment account.
39476
+ :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
39288
39477
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
39289
39478
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
39290
39479
 
@@ -39297,6 +39486,8 @@ class Cluster(
39297
39486
  label=label,
39298
39487
  period=period,
39299
39488
  region=region,
39489
+ stack_account=stack_account,
39490
+ stack_region=stack_region,
39300
39491
  statistic=statistic,
39301
39492
  unit=unit,
39302
39493
  )
@@ -39313,6 +39504,8 @@ class Cluster(
39313
39504
  label: typing.Optional[builtins.str] = None,
39314
39505
  period: typing.Optional[_Duration_4839e8c3] = None,
39315
39506
  region: typing.Optional[builtins.str] = None,
39507
+ stack_account: typing.Optional[builtins.str] = None,
39508
+ stack_region: typing.Optional[builtins.str] = None,
39316
39509
  statistic: typing.Optional[builtins.str] = None,
39317
39510
  unit: typing.Optional[_Unit_61bc6f70] = None,
39318
39511
  ) -> _Metric_e396a4dc:
@@ -39324,6 +39517,8 @@ class Cluster(
39324
39517
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. Default: - No label
39325
39518
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
39326
39519
  :param region: Region which this metric comes from. Default: - Deployment region.
39520
+ :param stack_account: Account of the stack this metric is attached to. Default: - Deployment account.
39521
+ :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
39327
39522
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
39328
39523
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
39329
39524
 
@@ -39336,6 +39531,8 @@ class Cluster(
39336
39531
  label=label,
39337
39532
  period=period,
39338
39533
  region=region,
39534
+ stack_account=stack_account,
39535
+ stack_region=stack_region,
39339
39536
  statistic=statistic,
39340
39537
  unit=unit,
39341
39538
  )
@@ -39441,6 +39638,7 @@ class DeploymentAlarmConfig(DeploymentAlarmOptions):
39441
39638
  service = ecs.FargateService(self, "Service",
39442
39639
  cluster=cluster,
39443
39640
  task_definition=task_definition,
39641
+ min_healthy_percent=100,
39444
39642
  deployment_alarms=ecs.DeploymentAlarmConfig(
39445
39643
  alarm_names=[elb_alarm.alarm_name],
39446
39644
  behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
@@ -40438,6 +40636,8 @@ class BaseService(
40438
40636
  label: typing.Optional[builtins.str] = None,
40439
40637
  period: typing.Optional[_Duration_4839e8c3] = None,
40440
40638
  region: typing.Optional[builtins.str] = None,
40639
+ stack_account: typing.Optional[builtins.str] = None,
40640
+ stack_region: typing.Optional[builtins.str] = None,
40441
40641
  statistic: typing.Optional[builtins.str] = None,
40442
40642
  unit: typing.Optional[_Unit_61bc6f70] = None,
40443
40643
  ) -> _Metric_e396a4dc:
@@ -40450,6 +40650,8 @@ class BaseService(
40450
40650
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. Default: - No label
40451
40651
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
40452
40652
  :param region: Region which this metric comes from. Default: - Deployment region.
40653
+ :param stack_account: Account of the stack this metric is attached to. Default: - Deployment account.
40654
+ :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
40453
40655
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
40454
40656
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
40455
40657
  '''
@@ -40463,6 +40665,8 @@ class BaseService(
40463
40665
  label=label,
40464
40666
  period=period,
40465
40667
  region=region,
40668
+ stack_account=stack_account,
40669
+ stack_region=stack_region,
40466
40670
  statistic=statistic,
40467
40671
  unit=unit,
40468
40672
  )
@@ -40479,6 +40683,8 @@ class BaseService(
40479
40683
  label: typing.Optional[builtins.str] = None,
40480
40684
  period: typing.Optional[_Duration_4839e8c3] = None,
40481
40685
  region: typing.Optional[builtins.str] = None,
40686
+ stack_account: typing.Optional[builtins.str] = None,
40687
+ stack_region: typing.Optional[builtins.str] = None,
40482
40688
  statistic: typing.Optional[builtins.str] = None,
40483
40689
  unit: typing.Optional[_Unit_61bc6f70] = None,
40484
40690
  ) -> _Metric_e396a4dc:
@@ -40490,6 +40696,8 @@ class BaseService(
40490
40696
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. Default: - No label
40491
40697
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
40492
40698
  :param region: Region which this metric comes from. Default: - Deployment region.
40699
+ :param stack_account: Account of the stack this metric is attached to. Default: - Deployment account.
40700
+ :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
40493
40701
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
40494
40702
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
40495
40703
 
@@ -40502,6 +40710,8 @@ class BaseService(
40502
40710
  label=label,
40503
40711
  period=period,
40504
40712
  region=region,
40713
+ stack_account=stack_account,
40714
+ stack_region=stack_region,
40505
40715
  statistic=statistic,
40506
40716
  unit=unit,
40507
40717
  )
@@ -40518,6 +40728,8 @@ class BaseService(
40518
40728
  label: typing.Optional[builtins.str] = None,
40519
40729
  period: typing.Optional[_Duration_4839e8c3] = None,
40520
40730
  region: typing.Optional[builtins.str] = None,
40731
+ stack_account: typing.Optional[builtins.str] = None,
40732
+ stack_region: typing.Optional[builtins.str] = None,
40521
40733
  statistic: typing.Optional[builtins.str] = None,
40522
40734
  unit: typing.Optional[_Unit_61bc6f70] = None,
40523
40735
  ) -> _Metric_e396a4dc:
@@ -40529,6 +40741,8 @@ class BaseService(
40529
40741
  :param label: Label for this metric when added to a Graph in a Dashboard. You can use `dynamic labels <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html>`_ to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. Default: - No label
40530
40742
  :param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
40531
40743
  :param region: Region which this metric comes from. Default: - Deployment region.
40744
+ :param stack_account: Account of the stack this metric is attached to. Default: - Deployment account.
40745
+ :param stack_region: Region of the stack this metric is attached to. Default: - Deployment region.
40532
40746
  :param statistic: What function to use for aggregating. Use the ``aws_cloudwatch.Stats`` helper class to construct valid input strings. Can be one of the following: - "Minimum" | "min" - "Maximum" | "max" - "Average" | "avg" - "Sum" | "sum" - "SampleCount | "n" - "pNN.NN" - "tmNN.NN" | "tm(NN.NN%:NN.NN%)" - "iqm" - "wmNN.NN" | "wm(NN.NN%:NN.NN%)" - "tcNN.NN" | "tc(NN.NN%:NN.NN%)" - "tsNN.NN" | "ts(NN.NN%:NN.NN%)" Default: Average
40533
40747
  :param unit: Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
40534
40748
 
@@ -40541,6 +40755,8 @@ class BaseService(
40541
40755
  label=label,
40542
40756
  period=period,
40543
40757
  region=region,
40758
+ stack_account=stack_account,
40759
+ stack_region=stack_region,
40544
40760
  statistic=statistic,
40545
40761
  unit=unit,
40546
40762
  )
@@ -40725,7 +40941,7 @@ class Ec2Service(
40725
40941
  # task_definition: ecs.TaskDefinition
40726
40942
  # vpc: ec2.Vpc
40727
40943
 
40728
- service = ecs.Ec2Service(self, "Service", cluster=cluster, task_definition=task_definition)
40944
+ service = ecs.Ec2Service(self, "Service", cluster=cluster, task_definition=task_definition, min_healthy_percent=100)
40729
40945
 
40730
40946
  lb = elb.LoadBalancer(self, "LB", vpc=vpc)
40731
40947
  lb.add_listener(external_port=80)
@@ -40944,6 +41160,7 @@ class Ec2TaskDefinition(
40944
41160
  network_mode: typing.Optional[NetworkMode] = None,
40945
41161
  pid_mode: typing.Optional[PidMode] = None,
40946
41162
  placement_constraints: typing.Optional[typing.Sequence[PlacementConstraint]] = None,
41163
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
40947
41164
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
40948
41165
  family: typing.Optional[builtins.str] = None,
40949
41166
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -40959,6 +41176,7 @@ class Ec2TaskDefinition(
40959
41176
  :param network_mode: The Docker networking mode to use for the containers in the task. The valid values are NONE, BRIDGE, AWS_VPC, and HOST. Default: - NetworkMode.BRIDGE for EC2 tasks, AWS_VPC for Fargate tasks.
40960
41177
  :param pid_mode: The process namespace to use for the containers in the task. Not supported in Windows containers. Default: - PidMode used by the task is not specified
40961
41178
  :param placement_constraints: An array of placement constraint objects to use for the task. You can specify a maximum of 10 constraints per task (this limit includes constraints in the task definition and those specified at run time). Default: - No placement constraints.
41179
+ :param enable_fault_injection: Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes. Default: undefined - ECS default setting is false
40962
41180
  :param execution_role: The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. The role will be used to retrieve container images from ECR and create CloudWatch log groups. Default: - An execution role will be automatically created if you use ECR images in your task definition.
40963
41181
  :param family: The name of a family that this task definition is registered to. A family groups multiple versions of a task definition. Default: - Automatically generated name.
40964
41182
  :param proxy_configuration: The configuration details for the App Mesh proxy. Default: - No proxy configuration.
@@ -40975,6 +41193,7 @@ class Ec2TaskDefinition(
40975
41193
  network_mode=network_mode,
40976
41194
  pid_mode=pid_mode,
40977
41195
  placement_constraints=placement_constraints,
41196
+ enable_fault_injection=enable_fault_injection,
40978
41197
  execution_role=execution_role,
40979
41198
  family=family,
40980
41199
  proxy_configuration=proxy_configuration,
@@ -41194,7 +41413,8 @@ class ExternalService(
41194
41413
  service = ecs.ExternalService(self, "Service",
41195
41414
  cluster=cluster,
41196
41415
  task_definition=task_definition,
41197
- desired_count=5
41416
+ desired_count=5,
41417
+ min_healthy_percent=100
41198
41418
  )
41199
41419
  '''
41200
41420
 
@@ -41496,6 +41716,7 @@ class ExternalTaskDefinition(
41496
41716
  id: builtins.str,
41497
41717
  *,
41498
41718
  network_mode: typing.Optional[NetworkMode] = None,
41719
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
41499
41720
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
41500
41721
  family: typing.Optional[builtins.str] = None,
41501
41722
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -41507,6 +41728,7 @@ class ExternalTaskDefinition(
41507
41728
  :param scope: -
41508
41729
  :param id: -
41509
41730
  :param network_mode: The networking mode to use for the containers in the task. With ECS Anywhere, supported modes are bridge, host and none. Default: NetworkMode.BRIDGE
41731
+ :param enable_fault_injection: Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes. Default: undefined - ECS default setting is false
41510
41732
  :param execution_role: The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. The role will be used to retrieve container images from ECR and create CloudWatch log groups. Default: - An execution role will be automatically created if you use ECR images in your task definition.
41511
41733
  :param family: The name of a family that this task definition is registered to. A family groups multiple versions of a task definition. Default: - Automatically generated name.
41512
41734
  :param proxy_configuration: The configuration details for the App Mesh proxy. Default: - No proxy configuration.
@@ -41519,6 +41741,7 @@ class ExternalTaskDefinition(
41519
41741
  check_type(argname="argument id", value=id, expected_type=type_hints["id"])
41520
41742
  props = ExternalTaskDefinitionProps(
41521
41743
  network_mode=network_mode,
41744
+ enable_fault_injection=enable_fault_injection,
41522
41745
  execution_role=execution_role,
41523
41746
  family=family,
41524
41747
  proxy_configuration=proxy_configuration,
@@ -41625,6 +41848,7 @@ class FargateService(
41625
41848
  service = ecs.FargateService(self, "Service",
41626
41849
  cluster=cluster,
41627
41850
  task_definition=task_definition,
41851
+ min_healthy_percent=100,
41628
41852
  deployment_alarms=ecs.DeploymentAlarmConfig(
41629
41853
  alarm_names=[elb_alarm.alarm_name],
41630
41854
  behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
@@ -41811,6 +42035,7 @@ class FargateTaskDefinition(
41811
42035
  ecs.FargateService(self, "FargateService",
41812
42036
  cluster=cluster,
41813
42037
  task_definition=task_definition,
42038
+ min_healthy_percent=100,
41814
42039
  capacity_provider_strategies=[ecs.CapacityProviderStrategy(
41815
42040
  capacity_provider="FARGATE_SPOT",
41816
42041
  weight=2
@@ -41832,6 +42057,7 @@ class FargateTaskDefinition(
41832
42057
  memory_limit_mib: typing.Optional[jsii.Number] = None,
41833
42058
  pid_mode: typing.Optional[PidMode] = None,
41834
42059
  runtime_platform: typing.Optional[typing.Union[RuntimePlatform, typing.Dict[builtins.str, typing.Any]]] = None,
42060
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
41835
42061
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
41836
42062
  family: typing.Optional[builtins.str] = None,
41837
42063
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -41847,6 +42073,7 @@ class FargateTaskDefinition(
41847
42073
  :param memory_limit_mib: The amount (in MiB) of memory used by the task. For tasks using the Fargate launch type, this field is required and you must use one of the following values, which determines your range of valid values for the cpu parameter: 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU) 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU) 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU) Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU) Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU) Between 16384 (16 GB) and 61440 (60 GB) in increments of 4096 (4 GB) - Available cpu values: 8192 (8 vCPU) Between 32768 (32 GB) and 122880 (120 GB) in increments of 8192 (8 GB) - Available cpu values: 16384 (16 vCPU) Default: 512
41848
42074
  :param pid_mode: The process namespace to use for the containers in the task. Only supported for tasks that are hosted on AWS Fargate if the tasks are using platform version 1.4.0 or later (Linux). Only the TASK option is supported for Linux-based Fargate containers. Not supported in Windows containers. If pidMode is specified for a Fargate task, then runtimePlatform.operatingSystemFamily must also be specified. For more information, see `Task Definition Parameters <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_definition_pidmode>`_. Default: - PidMode used by the task is not specified
41849
42075
  :param runtime_platform: The operating system that your task definitions are running on. A runtimePlatform is supported only for tasks using the Fargate launch type. Default: - Undefined.
42076
+ :param enable_fault_injection: Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Fault injection only works with tasks using the {@link NetworkMode.AWS_VPC} or {@link NetworkMode.HOST} network modes. Default: undefined - ECS default setting is false
41850
42077
  :param execution_role: The name of the IAM task execution role that grants the ECS agent permission to call AWS APIs on your behalf. The role will be used to retrieve container images from ECR and create CloudWatch log groups. Default: - An execution role will be automatically created if you use ECR images in your task definition.
41851
42078
  :param family: The name of a family that this task definition is registered to. A family groups multiple versions of a task definition. Default: - Automatically generated name.
41852
42079
  :param proxy_configuration: The configuration details for the App Mesh proxy. Default: - No proxy configuration.
@@ -41863,6 +42090,7 @@ class FargateTaskDefinition(
41863
42090
  memory_limit_mib=memory_limit_mib,
41864
42091
  pid_mode=pid_mode,
41865
42092
  runtime_platform=runtime_platform,
42093
+ enable_fault_injection=enable_fault_injection,
41866
42094
  execution_role=execution_role,
41867
42095
  family=family,
41868
42096
  proxy_configuration=proxy_configuration,
@@ -43926,6 +44154,7 @@ def _typecheckingstub__1a458c1ea772685ddb7eb49b075e7de9bed322fac4bbee8aeab1cf6b5
43926
44154
 
43927
44155
  def _typecheckingstub__c1277747b28f7882811be2d0e701d4bf9aa7e64beeaa64689d3e2d7c2d8099c4(
43928
44156
  *,
44157
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
43929
44158
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
43930
44159
  family: typing.Optional[builtins.str] = None,
43931
44160
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -44426,6 +44655,7 @@ def _typecheckingstub__e90e61a002f578b0dbe160c067f2d3de15287892110df7eedcbbfa7f0
44426
44655
 
44427
44656
  def _typecheckingstub__11bd13308faca16514041c56d48a3f2515c80d4039888b53668ceaca5b37dc0e(
44428
44657
  *,
44658
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
44429
44659
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
44430
44660
  family: typing.Optional[builtins.str] = None,
44431
44661
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -44617,6 +44847,7 @@ def _typecheckingstub__2d58078e68b889d5f10f95714f42385491c26bf6ec084584b1a1487cc
44617
44847
 
44618
44848
  def _typecheckingstub__9b7789082516541a1aab36b1c591e13ce99110db761ab34a0d177950ecd704cb(
44619
44849
  *,
44850
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
44620
44851
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
44621
44852
  family: typing.Optional[builtins.str] = None,
44622
44853
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -44676,6 +44907,7 @@ def _typecheckingstub__5dd329152ba42239c8e48630ce2d0477a28dd88014af62f4536ef752f
44676
44907
 
44677
44908
  def _typecheckingstub__da4d0b48fbacde979163c93d7fd8d5697220f750806124aabb65f0c3d34fd6ea(
44678
44909
  *,
44910
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
44679
44911
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
44680
44912
  family: typing.Optional[builtins.str] = None,
44681
44913
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -45528,6 +45760,7 @@ def _typecheckingstub__5d3bab44746554175b0727c47a3323dddca1cb0a8c9aeaf3a04d50745
45528
45760
  pid_mode: typing.Optional[PidMode] = None,
45529
45761
  placement_constraints: typing.Optional[typing.Sequence[PlacementConstraint]] = None,
45530
45762
  runtime_platform: typing.Optional[typing.Union[RuntimePlatform, typing.Dict[builtins.str, typing.Any]]] = None,
45763
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
45531
45764
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
45532
45765
  family: typing.Optional[builtins.str] = None,
45533
45766
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -45710,6 +45943,7 @@ def _typecheckingstub__723c7f01009409e12e945705433183d486be735607b50d3b8dd0ec765
45710
45943
 
45711
45944
  def _typecheckingstub__94a3565a38b8645ada9c86c3d7ac059ba028553c5ec103fcd16884f758cda48d(
45712
45945
  *,
45946
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
45713
45947
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
45714
45948
  family: typing.Optional[builtins.str] = None,
45715
45949
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -45981,6 +46215,8 @@ def _typecheckingstub__35d18b54e19d86c5562f997d757fcd71f57fa6d194d5ed055020a0ad2
45981
46215
  label: typing.Optional[builtins.str] = None,
45982
46216
  period: typing.Optional[_Duration_4839e8c3] = None,
45983
46217
  region: typing.Optional[builtins.str] = None,
46218
+ stack_account: typing.Optional[builtins.str] = None,
46219
+ stack_region: typing.Optional[builtins.str] = None,
45984
46220
  statistic: typing.Optional[builtins.str] = None,
45985
46221
  unit: typing.Optional[_Unit_61bc6f70] = None,
45986
46222
  ) -> None:
@@ -46105,6 +46341,8 @@ def _typecheckingstub__fb3b6cd83a49e029a6aab0309e4bf6a856a09b82a0d6752ebc4b80577
46105
46341
  label: typing.Optional[builtins.str] = None,
46106
46342
  period: typing.Optional[_Duration_4839e8c3] = None,
46107
46343
  region: typing.Optional[builtins.str] = None,
46344
+ stack_account: typing.Optional[builtins.str] = None,
46345
+ stack_region: typing.Optional[builtins.str] = None,
46108
46346
  statistic: typing.Optional[builtins.str] = None,
46109
46347
  unit: typing.Optional[_Unit_61bc6f70] = None,
46110
46348
  ) -> None:
@@ -46219,6 +46457,7 @@ def _typecheckingstub__3a26b01aaf87e4ece20469628f4af696fcfbad789e85b4622bd3e2092
46219
46457
  network_mode: typing.Optional[NetworkMode] = None,
46220
46458
  pid_mode: typing.Optional[PidMode] = None,
46221
46459
  placement_constraints: typing.Optional[typing.Sequence[PlacementConstraint]] = None,
46460
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
46222
46461
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
46223
46462
  family: typing.Optional[builtins.str] = None,
46224
46463
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -46365,6 +46604,7 @@ def _typecheckingstub__25b55dcc2f392f43c73212a21ab06c0332f2268cf71836b4f6c005109
46365
46604
  id: builtins.str,
46366
46605
  *,
46367
46606
  network_mode: typing.Optional[NetworkMode] = None,
46607
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
46368
46608
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
46369
46609
  family: typing.Optional[builtins.str] = None,
46370
46610
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,
@@ -46452,6 +46692,7 @@ def _typecheckingstub__d6eac52d828f2df0ab5e16014f889cf23534875319ae4b479cd554d53
46452
46692
  memory_limit_mib: typing.Optional[jsii.Number] = None,
46453
46693
  pid_mode: typing.Optional[PidMode] = None,
46454
46694
  runtime_platform: typing.Optional[typing.Union[RuntimePlatform, typing.Dict[builtins.str, typing.Any]]] = None,
46695
+ enable_fault_injection: typing.Optional[builtins.bool] = None,
46455
46696
  execution_role: typing.Optional[_IRole_235f5d8e] = None,
46456
46697
  family: typing.Optional[builtins.str] = None,
46457
46698
  proxy_configuration: typing.Optional[ProxyConfiguration] = None,