aws-cdk-lib 2.205.0__py3-none-any.whl → 2.207.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.
- aws_cdk/__init__.py +96 -15
- aws_cdk/_jsii/__init__.py +1 -1
- aws_cdk/_jsii/{aws-cdk-lib@2.205.0.jsii.tgz → aws-cdk-lib@2.207.0.jsii.tgz} +0 -0
- aws_cdk/aws_aiops/__init__.py +66 -76
- aws_cdk/aws_autoscaling/__init__.py +20 -0
- aws_cdk/aws_bedrock/__init__.py +126 -70
- aws_cdk/aws_certificatemanager/__init__.py +3 -3
- aws_cdk/aws_cleanrooms/__init__.py +6 -2
- aws_cdk/aws_cloudformation/__init__.py +28 -15
- aws_cdk/aws_cloudwatch/__init__.py +574 -33
- aws_cdk/aws_datasync/__init__.py +14 -15
- aws_cdk/aws_ec2/__init__.py +6 -2
- aws_cdk/aws_ecs/__init__.py +773 -212
- aws_cdk/aws_iotsitewise/__init__.py +13 -9
- aws_cdk/aws_kms/__init__.py +19 -17
- aws_cdk/aws_logs/__init__.py +4725 -763
- aws_cdk/aws_mediapackagev2/__init__.py +69 -48
- aws_cdk/aws_opsworkscm/__init__.py +2 -4
- aws_cdk/aws_rds/__init__.py +150 -17
- aws_cdk/aws_s3/__init__.py +9 -6
- aws_cdk/aws_sagemaker/__init__.py +3 -3
- aws_cdk/aws_ssm/__init__.py +58 -33
- aws_cdk/aws_transfer/__init__.py +21 -11
- aws_cdk/custom_resources/__init__.py +32 -4
- {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/METADATA +1 -1
- {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/RECORD +30 -30
- {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/LICENSE +0 -0
- {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/NOTICE +0 -0
- {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/WHEEL +0 -0
- {aws_cdk_lib-2.205.0.dist-info → aws_cdk_lib-2.207.0.dist-info}/top_level.txt +0 -0
aws_cdk/aws_ecs/__init__.py
CHANGED
|
@@ -2112,7 +2112,96 @@ service = ecs.FargateService(self, "FargateService",
|
|
|
2112
2112
|
)
|
|
2113
2113
|
```
|
|
2114
2114
|
|
|
2115
|
-
##
|
|
2115
|
+
## ECS Native Blue/Green Deployment
|
|
2116
|
+
|
|
2117
|
+
Amazon ECS supports native blue/green deployments that allow you to deploy new versions of your services with zero downtime. This deployment strategy creates a new set of tasks (green) alongside the existing tasks (blue), then shifts traffic from the old version to the new version.
|
|
2118
|
+
|
|
2119
|
+
[Amazon ECS blue/green deployments](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-blue-green.html)
|
|
2120
|
+
|
|
2121
|
+
### Using Escape Hatches for Blue/Green Features
|
|
2122
|
+
|
|
2123
|
+
The new blue/green deployment features are added to CloudFormation but not yet available in the CDK L2 constructs, you can use escape hatches to access them through the L1 (CfnService) construct.
|
|
2124
|
+
|
|
2125
|
+
#### Load Balancer Advanced Configuration
|
|
2126
|
+
|
|
2127
|
+
Configure advanced load balancer settings for blue/green deployments with alternate target groups and listener rules:
|
|
2128
|
+
|
|
2129
|
+
```python
|
|
2130
|
+
# service: ecs.FargateService
|
|
2131
|
+
|
|
2132
|
+
|
|
2133
|
+
cfn_service = service.node.default_child
|
|
2134
|
+
cfn_service.load_balancers = [ecs.CfnService.LoadBalancerProperty(
|
|
2135
|
+
container_name="web",
|
|
2136
|
+
container_port=80,
|
|
2137
|
+
target_group_arn="arn:aws:elasticloadbalancing:region:account:targetgroup/production",
|
|
2138
|
+
advanced_configuration=ecs.CfnService.AdvancedConfigurationProperty(
|
|
2139
|
+
alternate_target_group_arn="arn:aws:elasticloadbalancing:region:account:targetgroup/test",
|
|
2140
|
+
production_listener_rule="arn:aws:elasticloadbalancing:region:account:listener-rule/production-rule",
|
|
2141
|
+
test_listener_rule="arn:aws:elasticloadbalancing:region:account:listener-rule/test-rule",
|
|
2142
|
+
role_arn="arn:aws:iam::account:role/ecs-blue-green-role"
|
|
2143
|
+
)
|
|
2144
|
+
)]
|
|
2145
|
+
```
|
|
2146
|
+
|
|
2147
|
+
#### Blue/Green Deployment Configuration
|
|
2148
|
+
|
|
2149
|
+
Configure deployment strategy with bake time and lifecycle hooks:
|
|
2150
|
+
|
|
2151
|
+
```python
|
|
2152
|
+
# service: ecs.FargateService
|
|
2153
|
+
|
|
2154
|
+
|
|
2155
|
+
cfn_service = service.node.default_child
|
|
2156
|
+
cfn_service.deployment_configuration = ecs.CfnService.DeploymentConfigurationProperty(
|
|
2157
|
+
maximum_percent=200,
|
|
2158
|
+
minimum_healthy_percent=100,
|
|
2159
|
+
strategy="BLUE_GREEN",
|
|
2160
|
+
bake_time_in_minutes=15,
|
|
2161
|
+
lifecycle_hooks=[ecs.CfnService.DeploymentLifecycleHookProperty(
|
|
2162
|
+
hook_target_arn="arn:aws:lambda:region:account:function:pre-deployment-hook",
|
|
2163
|
+
role_arn="arn:aws:iam::account:role/deployment-hook-role",
|
|
2164
|
+
lifecycle_stages=["PRE_STOP", "POST_START"]
|
|
2165
|
+
)]
|
|
2166
|
+
)
|
|
2167
|
+
```
|
|
2168
|
+
|
|
2169
|
+
#### Service Connect Test Traffic Rules
|
|
2170
|
+
|
|
2171
|
+
Configure test traffic routing for Service Connect during blue/green deployments:
|
|
2172
|
+
|
|
2173
|
+
```python
|
|
2174
|
+
# cluster: ecs.Cluster
|
|
2175
|
+
# task_definition: ecs.TaskDefinition
|
|
2176
|
+
|
|
2177
|
+
|
|
2178
|
+
service = ecs.FargateService(self, "Service",
|
|
2179
|
+
cluster=cluster,
|
|
2180
|
+
task_definition=task_definition
|
|
2181
|
+
)
|
|
2182
|
+
|
|
2183
|
+
cfn_service = service.node.default_child
|
|
2184
|
+
cfn_service.service_connect_configuration = ecs.CfnService.ServiceConnectConfigurationProperty(
|
|
2185
|
+
enabled=True,
|
|
2186
|
+
services=[ecs.CfnService.ServiceConnectServiceProperty(
|
|
2187
|
+
port_name="api",
|
|
2188
|
+
client_aliases=[ecs.CfnService.ServiceConnectClientAliasProperty(
|
|
2189
|
+
port=80,
|
|
2190
|
+
dns_name="my-service",
|
|
2191
|
+
test_traffic_rules=ecs.CfnService.ServiceConnectTestTrafficRulesProperty(
|
|
2192
|
+
header=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderProperty(
|
|
2193
|
+
name="x-canary-test",
|
|
2194
|
+
value=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty(
|
|
2195
|
+
exact="beta-version"
|
|
2196
|
+
)
|
|
2197
|
+
)
|
|
2198
|
+
)
|
|
2199
|
+
)]
|
|
2200
|
+
)]
|
|
2201
|
+
)
|
|
2202
|
+
```
|
|
2203
|
+
|
|
2204
|
+
## Daemon Scheduling Strategy
|
|
2116
2205
|
|
|
2117
2206
|
You can specify whether service use Daemon scheduling strategy by specifying `daemon` option in Service constructs. See [differences between Daemon and Replica scheduling strategy](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html)
|
|
2118
2207
|
|
|
@@ -8553,159 +8642,23 @@ class CfnService(
|
|
|
8553
8642
|
|
|
8554
8643
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html
|
|
8555
8644
|
:cloudformationResource: AWS::ECS::Service
|
|
8556
|
-
:exampleMetadata:
|
|
8645
|
+
:exampleMetadata: infused
|
|
8557
8646
|
|
|
8558
8647
|
Example::
|
|
8559
8648
|
|
|
8560
|
-
#
|
|
8561
|
-
# The values are placeholders you should change.
|
|
8562
|
-
from aws_cdk import aws_ecs as ecs
|
|
8649
|
+
# service: ecs.FargateService
|
|
8563
8650
|
|
|
8564
|
-
cfn_service = ecs.CfnService(self, "MyCfnService",
|
|
8565
|
-
availability_zone_rebalancing="availabilityZoneRebalancing",
|
|
8566
|
-
capacity_provider_strategy=[ecs.CfnService.CapacityProviderStrategyItemProperty(
|
|
8567
|
-
base=123,
|
|
8568
|
-
capacity_provider="capacityProvider",
|
|
8569
|
-
weight=123
|
|
8570
|
-
)],
|
|
8571
|
-
cluster="cluster",
|
|
8572
|
-
deployment_configuration=ecs.CfnService.DeploymentConfigurationProperty(
|
|
8573
|
-
alarms=ecs.CfnService.DeploymentAlarmsProperty(
|
|
8574
|
-
alarm_names=["alarmNames"],
|
|
8575
|
-
enable=False,
|
|
8576
|
-
rollback=False
|
|
8577
|
-
),
|
|
8578
|
-
deployment_circuit_breaker=ecs.CfnService.DeploymentCircuitBreakerProperty(
|
|
8579
|
-
enable=False,
|
|
8580
|
-
rollback=False
|
|
8581
|
-
),
|
|
8582
|
-
maximum_percent=123,
|
|
8583
|
-
minimum_healthy_percent=123
|
|
8584
|
-
),
|
|
8585
|
-
deployment_controller=ecs.CfnService.DeploymentControllerProperty(
|
|
8586
|
-
type="type"
|
|
8587
|
-
),
|
|
8588
|
-
desired_count=123,
|
|
8589
|
-
enable_ecs_managed_tags=False,
|
|
8590
|
-
enable_execute_command=False,
|
|
8591
|
-
health_check_grace_period_seconds=123,
|
|
8592
|
-
launch_type="launchType",
|
|
8593
|
-
load_balancers=[ecs.CfnService.LoadBalancerProperty(
|
|
8594
|
-
container_name="containerName",
|
|
8595
|
-
container_port=123,
|
|
8596
|
-
load_balancer_name="loadBalancerName",
|
|
8597
|
-
target_group_arn="targetGroupArn"
|
|
8598
|
-
)],
|
|
8599
|
-
network_configuration=ecs.CfnService.NetworkConfigurationProperty(
|
|
8600
|
-
awsvpc_configuration=ecs.CfnService.AwsVpcConfigurationProperty(
|
|
8601
|
-
assign_public_ip="assignPublicIp",
|
|
8602
|
-
security_groups=["securityGroups"],
|
|
8603
|
-
subnets=["subnets"]
|
|
8604
|
-
)
|
|
8605
|
-
),
|
|
8606
|
-
placement_constraints=[ecs.CfnService.PlacementConstraintProperty(
|
|
8607
|
-
type="type",
|
|
8608
|
-
|
|
8609
|
-
# the properties below are optional
|
|
8610
|
-
expression="expression"
|
|
8611
|
-
)],
|
|
8612
|
-
placement_strategies=[ecs.CfnService.PlacementStrategyProperty(
|
|
8613
|
-
type="type",
|
|
8614
8651
|
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
# the properties below are optional
|
|
8626
|
-
log_configuration=ecs.CfnService.LogConfigurationProperty(
|
|
8627
|
-
log_driver="logDriver",
|
|
8628
|
-
options={
|
|
8629
|
-
"options_key": "options"
|
|
8630
|
-
},
|
|
8631
|
-
secret_options=[ecs.CfnService.SecretProperty(
|
|
8632
|
-
name="name",
|
|
8633
|
-
value_from="valueFrom"
|
|
8634
|
-
)]
|
|
8635
|
-
),
|
|
8636
|
-
namespace="namespace",
|
|
8637
|
-
services=[ecs.CfnService.ServiceConnectServiceProperty(
|
|
8638
|
-
port_name="portName",
|
|
8639
|
-
|
|
8640
|
-
# the properties below are optional
|
|
8641
|
-
client_aliases=[ecs.CfnService.ServiceConnectClientAliasProperty(
|
|
8642
|
-
port=123,
|
|
8643
|
-
|
|
8644
|
-
# the properties below are optional
|
|
8645
|
-
dns_name="dnsName"
|
|
8646
|
-
)],
|
|
8647
|
-
discovery_name="discoveryName",
|
|
8648
|
-
ingress_port_override=123,
|
|
8649
|
-
timeout=ecs.CfnService.TimeoutConfigurationProperty(
|
|
8650
|
-
idle_timeout_seconds=123,
|
|
8651
|
-
per_request_timeout_seconds=123
|
|
8652
|
-
),
|
|
8653
|
-
tls=ecs.CfnService.ServiceConnectTlsConfigurationProperty(
|
|
8654
|
-
issuer_certificate_authority=ecs.CfnService.ServiceConnectTlsCertificateAuthorityProperty(
|
|
8655
|
-
aws_pca_authority_arn="awsPcaAuthorityArn"
|
|
8656
|
-
),
|
|
8657
|
-
|
|
8658
|
-
# the properties below are optional
|
|
8659
|
-
kms_key="kmsKey",
|
|
8660
|
-
role_arn="roleArn"
|
|
8661
|
-
)
|
|
8662
|
-
)]
|
|
8663
|
-
),
|
|
8664
|
-
service_name="serviceName",
|
|
8665
|
-
service_registries=[ecs.CfnService.ServiceRegistryProperty(
|
|
8666
|
-
container_name="containerName",
|
|
8667
|
-
container_port=123,
|
|
8668
|
-
port=123,
|
|
8669
|
-
registry_arn="registryArn"
|
|
8670
|
-
)],
|
|
8671
|
-
tags=[CfnTag(
|
|
8672
|
-
key="key",
|
|
8673
|
-
value="value"
|
|
8674
|
-
)],
|
|
8675
|
-
task_definition="taskDefinition",
|
|
8676
|
-
volume_configurations=[ecs.CfnService.ServiceVolumeConfigurationProperty(
|
|
8677
|
-
name="name",
|
|
8678
|
-
|
|
8679
|
-
# the properties below are optional
|
|
8680
|
-
managed_ebs_volume=ecs.CfnService.ServiceManagedEBSVolumeConfigurationProperty(
|
|
8681
|
-
role_arn="roleArn",
|
|
8682
|
-
|
|
8683
|
-
# the properties below are optional
|
|
8684
|
-
encrypted=False,
|
|
8685
|
-
filesystem_type="filesystemType",
|
|
8686
|
-
iops=123,
|
|
8687
|
-
kms_key_id="kmsKeyId",
|
|
8688
|
-
size_in_gi_b=123,
|
|
8689
|
-
snapshot_id="snapshotId",
|
|
8690
|
-
tag_specifications=[ecs.CfnService.EBSTagSpecificationProperty(
|
|
8691
|
-
resource_type="resourceType",
|
|
8692
|
-
|
|
8693
|
-
# the properties below are optional
|
|
8694
|
-
propagate_tags="propagateTags",
|
|
8695
|
-
tags=[CfnTag(
|
|
8696
|
-
key="key",
|
|
8697
|
-
value="value"
|
|
8698
|
-
)]
|
|
8699
|
-
)],
|
|
8700
|
-
throughput=123,
|
|
8701
|
-
volume_initialization_rate=123,
|
|
8702
|
-
volume_type="volumeType"
|
|
8703
|
-
)
|
|
8704
|
-
)],
|
|
8705
|
-
vpc_lattice_configurations=[ecs.CfnService.VpcLatticeConfigurationProperty(
|
|
8706
|
-
port_name="portName",
|
|
8707
|
-
role_arn="roleArn",
|
|
8708
|
-
target_group_arn="targetGroupArn"
|
|
8652
|
+
cfn_service = service.node.default_child
|
|
8653
|
+
cfn_service.deployment_configuration = ecs.CfnService.DeploymentConfigurationProperty(
|
|
8654
|
+
maximum_percent=200,
|
|
8655
|
+
minimum_healthy_percent=100,
|
|
8656
|
+
strategy="BLUE_GREEN",
|
|
8657
|
+
bake_time_in_minutes=15,
|
|
8658
|
+
lifecycle_hooks=[ecs.CfnService.DeploymentLifecycleHookProperty(
|
|
8659
|
+
hook_target_arn="arn:aws:lambda:region:account:function:pre-deployment-hook",
|
|
8660
|
+
role_arn="arn:aws:iam::account:role/deployment-hook-role",
|
|
8661
|
+
lifecycle_stages=["PRE_STOP", "POST_START"]
|
|
8709
8662
|
)]
|
|
8710
8663
|
)
|
|
8711
8664
|
'''
|
|
@@ -8748,9 +8701,9 @@ class CfnService(
|
|
|
8748
8701
|
:param capacity_provider_strategy: The capacity provider strategy to use for the service. If a ``capacityProviderStrategy`` is specified, the ``launchType`` parameter must be omitted. If no ``capacityProviderStrategy`` or ``launchType`` is specified, the ``defaultCapacityProviderStrategy`` for the cluster is used. A capacity provider strategy can contain a maximum of 20 capacity providers. .. epigraph:: To remove this property from your service resource, specify an empty ``CapacityProviderStrategyItem`` array.
|
|
8749
8702
|
:param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that you run your service on. If you do not specify a cluster, the default cluster is assumed.
|
|
8750
8703
|
:param deployment_configuration: Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.
|
|
8751
|
-
:param deployment_controller: The deployment controller to use for the service.
|
|
8704
|
+
:param deployment_controller: The deployment controller to use for the service.
|
|
8752
8705
|
:param desired_count: The number of instantiations of the specified task definition to place and keep running in your service. For new services, if a desired count is not specified, a default value of ``1`` is used. When using the ``DAEMON`` scheduling strategy, the desired count is not required. For existing services, if a desired count is not specified, it is omitted from the operation.
|
|
8753
|
-
:param enable_ecs_managed_tags: Specifies whether to turn on Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging your Amazon ECS resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ in the *Amazon Elastic Container Service Developer Guide* . When you use Amazon ECS managed tags, you
|
|
8706
|
+
:param enable_ecs_managed_tags: Specifies whether to turn on Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging your Amazon ECS resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ in the *Amazon Elastic Container Service Developer Guide* . When you use Amazon ECS managed tags, you must set the ``propagateTags`` request parameter.
|
|
8754
8707
|
:param enable_execute_command: Determines whether the execute command functionality is turned on for the service. If ``true`` , the execute command functionality is turned on for all containers in tasks as part of the service.
|
|
8755
8708
|
:param health_check_grace_period_seconds: The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing, VPC Lattice, and container health checks after a task has first started. If you don't specify a health check grace period value, the default value of ``0`` is used. If you don't use any of the health checks, then ``healthCheckGracePeriodSeconds`` is unused. If your service's tasks take a while to start and respond to health checks, you can specify a health check grace period of up to 2,147,483,647 seconds (about 69 years). During that time, the Amazon ECS service scheduler ignores health check status. This grace period can prevent the service scheduler from marking tasks as unhealthy and stopping them before they have time to come up.
|
|
8756
8709
|
:param launch_type: The launch type on which to run your service. For more information, see `Amazon ECS Launch Types <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html>`_ in the *Amazon Elastic Container Service Developer Guide* .
|
|
@@ -9267,6 +9220,109 @@ class CfnService(
|
|
|
9267
9220
|
check_type(argname="argument value", value=value, expected_type=type_hints["value"])
|
|
9268
9221
|
jsii.set(self, "vpcLatticeConfigurations", value) # pyright: ignore[reportArgumentType]
|
|
9269
9222
|
|
|
9223
|
+
@jsii.data_type(
|
|
9224
|
+
jsii_type="aws-cdk-lib.aws_ecs.CfnService.AdvancedConfigurationProperty",
|
|
9225
|
+
jsii_struct_bases=[],
|
|
9226
|
+
name_mapping={
|
|
9227
|
+
"alternate_target_group_arn": "alternateTargetGroupArn",
|
|
9228
|
+
"production_listener_rule": "productionListenerRule",
|
|
9229
|
+
"role_arn": "roleArn",
|
|
9230
|
+
"test_listener_rule": "testListenerRule",
|
|
9231
|
+
},
|
|
9232
|
+
)
|
|
9233
|
+
class AdvancedConfigurationProperty:
|
|
9234
|
+
def __init__(
|
|
9235
|
+
self,
|
|
9236
|
+
*,
|
|
9237
|
+
alternate_target_group_arn: builtins.str,
|
|
9238
|
+
production_listener_rule: typing.Optional[builtins.str] = None,
|
|
9239
|
+
role_arn: typing.Optional[builtins.str] = None,
|
|
9240
|
+
test_listener_rule: typing.Optional[builtins.str] = None,
|
|
9241
|
+
) -> None:
|
|
9242
|
+
'''
|
|
9243
|
+
:param alternate_target_group_arn:
|
|
9244
|
+
:param production_listener_rule:
|
|
9245
|
+
:param role_arn:
|
|
9246
|
+
:param test_listener_rule:
|
|
9247
|
+
|
|
9248
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-advancedconfiguration.html
|
|
9249
|
+
:exampleMetadata: fixture=_generated
|
|
9250
|
+
|
|
9251
|
+
Example::
|
|
9252
|
+
|
|
9253
|
+
# The code below shows an example of how to instantiate this type.
|
|
9254
|
+
# The values are placeholders you should change.
|
|
9255
|
+
from aws_cdk import aws_ecs as ecs
|
|
9256
|
+
|
|
9257
|
+
advanced_configuration_property = ecs.CfnService.AdvancedConfigurationProperty(
|
|
9258
|
+
alternate_target_group_arn="alternateTargetGroupArn",
|
|
9259
|
+
|
|
9260
|
+
# the properties below are optional
|
|
9261
|
+
production_listener_rule="productionListenerRule",
|
|
9262
|
+
role_arn="roleArn",
|
|
9263
|
+
test_listener_rule="testListenerRule"
|
|
9264
|
+
)
|
|
9265
|
+
'''
|
|
9266
|
+
if __debug__:
|
|
9267
|
+
type_hints = typing.get_type_hints(_typecheckingstub__c3f25e48977935912f7b78499d7be554157bd31ec2fadc2d811e82880622bfdf)
|
|
9268
|
+
check_type(argname="argument alternate_target_group_arn", value=alternate_target_group_arn, expected_type=type_hints["alternate_target_group_arn"])
|
|
9269
|
+
check_type(argname="argument production_listener_rule", value=production_listener_rule, expected_type=type_hints["production_listener_rule"])
|
|
9270
|
+
check_type(argname="argument role_arn", value=role_arn, expected_type=type_hints["role_arn"])
|
|
9271
|
+
check_type(argname="argument test_listener_rule", value=test_listener_rule, expected_type=type_hints["test_listener_rule"])
|
|
9272
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
9273
|
+
"alternate_target_group_arn": alternate_target_group_arn,
|
|
9274
|
+
}
|
|
9275
|
+
if production_listener_rule is not None:
|
|
9276
|
+
self._values["production_listener_rule"] = production_listener_rule
|
|
9277
|
+
if role_arn is not None:
|
|
9278
|
+
self._values["role_arn"] = role_arn
|
|
9279
|
+
if test_listener_rule is not None:
|
|
9280
|
+
self._values["test_listener_rule"] = test_listener_rule
|
|
9281
|
+
|
|
9282
|
+
@builtins.property
|
|
9283
|
+
def alternate_target_group_arn(self) -> builtins.str:
|
|
9284
|
+
'''
|
|
9285
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-advancedconfiguration.html#cfn-ecs-service-advancedconfiguration-alternatetargetgrouparn
|
|
9286
|
+
'''
|
|
9287
|
+
result = self._values.get("alternate_target_group_arn")
|
|
9288
|
+
assert result is not None, "Required property 'alternate_target_group_arn' is missing"
|
|
9289
|
+
return typing.cast(builtins.str, result)
|
|
9290
|
+
|
|
9291
|
+
@builtins.property
|
|
9292
|
+
def production_listener_rule(self) -> typing.Optional[builtins.str]:
|
|
9293
|
+
'''
|
|
9294
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-advancedconfiguration.html#cfn-ecs-service-advancedconfiguration-productionlistenerrule
|
|
9295
|
+
'''
|
|
9296
|
+
result = self._values.get("production_listener_rule")
|
|
9297
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
9298
|
+
|
|
9299
|
+
@builtins.property
|
|
9300
|
+
def role_arn(self) -> typing.Optional[builtins.str]:
|
|
9301
|
+
'''
|
|
9302
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-advancedconfiguration.html#cfn-ecs-service-advancedconfiguration-rolearn
|
|
9303
|
+
'''
|
|
9304
|
+
result = self._values.get("role_arn")
|
|
9305
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
9306
|
+
|
|
9307
|
+
@builtins.property
|
|
9308
|
+
def test_listener_rule(self) -> typing.Optional[builtins.str]:
|
|
9309
|
+
'''
|
|
9310
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-advancedconfiguration.html#cfn-ecs-service-advancedconfiguration-testlistenerrule
|
|
9311
|
+
'''
|
|
9312
|
+
result = self._values.get("test_listener_rule")
|
|
9313
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
9314
|
+
|
|
9315
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
9316
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
9317
|
+
|
|
9318
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
9319
|
+
return not (rhs == self)
|
|
9320
|
+
|
|
9321
|
+
def __repr__(self) -> str:
|
|
9322
|
+
return "AdvancedConfigurationProperty(%s)" % ", ".join(
|
|
9323
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
9324
|
+
)
|
|
9325
|
+
|
|
9270
9326
|
@jsii.data_type(
|
|
9271
9327
|
jsii_type="aws-cdk-lib.aws_ecs.CfnService.AwsVpcConfigurationProperty",
|
|
9272
9328
|
jsii_struct_bases=[],
|
|
@@ -9499,7 +9555,7 @@ class CfnService(
|
|
|
9499
9555
|
|
|
9500
9556
|
When the alarms are generated, Amazon ECS sets the service deployment to failed. Set the rollback parameter to have Amazon ECS to roll back your service to the last completed deployment after a failure.
|
|
9501
9557
|
|
|
9502
|
-
You can only use the ``DeploymentAlarms`` method to detect failures when the ``DeploymentController`` is set to ``ECS``
|
|
9558
|
+
You can only use the ``DeploymentAlarms`` method to detect failures when the ``DeploymentController`` is set to ``ECS`` .
|
|
9503
9559
|
|
|
9504
9560
|
For more information, see `Rolling update <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html>`_ in the **Amazon Elastic Container Service Developer Guide** .
|
|
9505
9561
|
|
|
@@ -9662,9 +9718,12 @@ class CfnService(
|
|
|
9662
9718
|
jsii_struct_bases=[],
|
|
9663
9719
|
name_mapping={
|
|
9664
9720
|
"alarms": "alarms",
|
|
9721
|
+
"bake_time_in_minutes": "bakeTimeInMinutes",
|
|
9665
9722
|
"deployment_circuit_breaker": "deploymentCircuitBreaker",
|
|
9723
|
+
"lifecycle_hooks": "lifecycleHooks",
|
|
9666
9724
|
"maximum_percent": "maximumPercent",
|
|
9667
9725
|
"minimum_healthy_percent": "minimumHealthyPercent",
|
|
9726
|
+
"strategy": "strategy",
|
|
9668
9727
|
},
|
|
9669
9728
|
)
|
|
9670
9729
|
class DeploymentConfigurationProperty:
|
|
@@ -9672,16 +9731,22 @@ class CfnService(
|
|
|
9672
9731
|
self,
|
|
9673
9732
|
*,
|
|
9674
9733
|
alarms: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Union["CfnService.DeploymentAlarmsProperty", typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
9734
|
+
bake_time_in_minutes: typing.Optional[jsii.Number] = None,
|
|
9675
9735
|
deployment_circuit_breaker: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Union["CfnService.DeploymentCircuitBreakerProperty", typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
9736
|
+
lifecycle_hooks: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Sequence[typing.Union[_IResolvable_da3f097b, typing.Union["CfnService.DeploymentLifecycleHookProperty", typing.Dict[builtins.str, typing.Any]]]]]] = None,
|
|
9676
9737
|
maximum_percent: typing.Optional[jsii.Number] = None,
|
|
9677
9738
|
minimum_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
9739
|
+
strategy: typing.Optional[builtins.str] = None,
|
|
9678
9740
|
) -> None:
|
|
9679
9741
|
'''Optional deployment parameters that control how many tasks run during a deployment and the ordering of stopping and starting tasks.
|
|
9680
9742
|
|
|
9681
9743
|
:param alarms: Information about the CloudWatch alarms.
|
|
9744
|
+
:param bake_time_in_minutes:
|
|
9682
9745
|
:param deployment_circuit_breaker: .. epigraph:: The deployment circuit breaker can only be used for services using the rolling update ( ``ECS`` ) deployment type. The *deployment circuit breaker* determines whether a service deployment will fail if the service can't reach a steady state. If you use the deployment circuit breaker, a service deployment will transition to a failed state and stop launching new tasks. If you use the rollback option, when a service deployment fails, the service is rolled back to the last deployment that completed successfully. For more information, see `Rolling update <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html>`_ in the *Amazon Elastic Container Service Developer Guide*
|
|
9746
|
+
:param lifecycle_hooks:
|
|
9683
9747
|
:param maximum_percent: If a service is using the rolling update ( ``ECS`` ) deployment type, the ``maximumPercent`` parameter represents an upper limit on the number of your service's tasks that are allowed in the ``RUNNING`` or ``PENDING`` state during a deployment, as a percentage of the ``desiredCount`` (rounded down to the nearest integer). This parameter enables you to define the deployment batch size. For example, if your service is using the ``REPLICA`` service scheduler and has a ``desiredCount`` of four tasks and a ``maximumPercent`` value of 200%, the scheduler may start four new tasks before stopping the four older tasks (provided that the cluster resources required to do this are available). The default ``maximumPercent`` value for a service using the ``REPLICA`` service scheduler is 200%. The Amazon ECS scheduler uses this parameter to replace unhealthy tasks by starting replacement tasks first and then stopping the unhealthy tasks, as long as cluster resources for starting replacement tasks are available. For more information about how the scheduler replaces unhealthy tasks, see `Amazon ECS services <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html>`_ . If a service is using either the blue/green ( ``CODE_DEPLOY`` ) or ``EXTERNAL`` deployment types, and tasks in the service use the EC2 launch type, the *maximum percent* value is set to the default value. The *maximum percent* value is used to define the upper limit on the number of the tasks in the service that remain in the ``RUNNING`` state while the container instances are in the ``DRAINING`` state. .. epigraph:: You can't specify a custom ``maximumPercent`` value for a service that uses either the blue/green ( ``CODE_DEPLOY`` ) or ``EXTERNAL`` deployment types and has tasks that use the EC2 launch type. If the service uses either the blue/green ( ``CODE_DEPLOY`` ) or ``EXTERNAL`` deployment types, and the tasks in the service use the Fargate launch type, the maximum percent value is not used. The value is still returned when describing your service.
|
|
9684
9748
|
:param minimum_healthy_percent: If a service is using the rolling update ( ``ECS`` ) deployment type, the ``minimumHealthyPercent`` represents a lower limit on the number of your service's tasks that must remain in the ``RUNNING`` state during a deployment, as a percentage of the ``desiredCount`` (rounded up to the nearest integer). This parameter enables you to deploy without using additional cluster capacity. For example, if your service has a ``desiredCount`` of four tasks and a ``minimumHealthyPercent`` of 50%, the service scheduler may stop two existing tasks to free up cluster capacity before starting two new tasks. If any tasks are unhealthy and if ``maximumPercent`` doesn't allow the Amazon ECS scheduler to start replacement tasks, the scheduler stops the unhealthy tasks one-by-one — using the ``minimumHealthyPercent`` as a constraint — to clear up capacity to launch replacement tasks. For more information about how the scheduler replaces unhealthy tasks, see `Amazon ECS services <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html>`_ . For services that *do not* use a load balancer, the following should be noted: - A service is considered healthy if all essential containers within the tasks in the service pass their health checks. - If a task has no essential containers with a health check defined, the service scheduler will wait for 40 seconds after a task reaches a ``RUNNING`` state before the task is counted towards the minimum healthy percent total. - If a task has one or more essential containers with a health check defined, the service scheduler will wait for the task to reach a healthy status before counting it towards the minimum healthy percent total. A task is considered healthy when all essential containers within the task have passed their health checks. The amount of time the service scheduler can wait for is determined by the container health check settings. For services that *do* use a load balancer, the following should be noted: - If a task has no essential containers with a health check defined, the service scheduler will wait for the load balancer target group health check to return a healthy status before counting the task towards the minimum healthy percent total. - If a task has an essential container with a health check defined, the service scheduler will wait for both the task to reach a healthy status and the load balancer target group health check to return a healthy status before counting the task towards the minimum healthy percent total. The default value for a replica service for ``minimumHealthyPercent`` is 100%. The default ``minimumHealthyPercent`` value for a service using the ``DAEMON`` service schedule is 0% for the AWS CLI , the AWS SDKs, and the APIs and 50% for the AWS Management Console. The minimum number of healthy tasks during a deployment is the ``desiredCount`` multiplied by the ``minimumHealthyPercent`` /100, rounded up to the nearest integer value. If a service is using either the blue/green ( ``CODE_DEPLOY`` ) or ``EXTERNAL`` deployment types and is running tasks that use the EC2 launch type, the *minimum healthy percent* value is set to the default value. The *minimum healthy percent* value is used to define the lower limit on the number of the tasks in the service that remain in the ``RUNNING`` state while the container instances are in the ``DRAINING`` state. .. epigraph:: You can't specify a custom ``minimumHealthyPercent`` value for a service that uses either the blue/green ( ``CODE_DEPLOY`` ) or ``EXTERNAL`` deployment types and has tasks that use the EC2 launch type. If a service is using either the blue/green ( ``CODE_DEPLOY`` ) or ``EXTERNAL`` deployment types and is running tasks that use the Fargate launch type, the minimum healthy percent value is not used, although it is returned when describing your service.
|
|
9749
|
+
:param strategy:
|
|
9685
9750
|
|
|
9686
9751
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentconfiguration.html
|
|
9687
9752
|
:exampleMetadata: fixture=_generated
|
|
@@ -9698,29 +9763,45 @@ class CfnService(
|
|
|
9698
9763
|
enable=False,
|
|
9699
9764
|
rollback=False
|
|
9700
9765
|
),
|
|
9766
|
+
bake_time_in_minutes=123,
|
|
9701
9767
|
deployment_circuit_breaker=ecs.CfnService.DeploymentCircuitBreakerProperty(
|
|
9702
9768
|
enable=False,
|
|
9703
9769
|
rollback=False
|
|
9704
9770
|
),
|
|
9771
|
+
lifecycle_hooks=[ecs.CfnService.DeploymentLifecycleHookProperty(
|
|
9772
|
+
hook_target_arn="hookTargetArn",
|
|
9773
|
+
lifecycle_stages=["lifecycleStages"],
|
|
9774
|
+
role_arn="roleArn"
|
|
9775
|
+
)],
|
|
9705
9776
|
maximum_percent=123,
|
|
9706
|
-
minimum_healthy_percent=123
|
|
9777
|
+
minimum_healthy_percent=123,
|
|
9778
|
+
strategy="strategy"
|
|
9707
9779
|
)
|
|
9708
9780
|
'''
|
|
9709
9781
|
if __debug__:
|
|
9710
9782
|
type_hints = typing.get_type_hints(_typecheckingstub__d809d14e704a11675cbface3b43579e5f8f2a29c9b48e27608c625a3f01cb3a6)
|
|
9711
9783
|
check_type(argname="argument alarms", value=alarms, expected_type=type_hints["alarms"])
|
|
9784
|
+
check_type(argname="argument bake_time_in_minutes", value=bake_time_in_minutes, expected_type=type_hints["bake_time_in_minutes"])
|
|
9712
9785
|
check_type(argname="argument deployment_circuit_breaker", value=deployment_circuit_breaker, expected_type=type_hints["deployment_circuit_breaker"])
|
|
9786
|
+
check_type(argname="argument lifecycle_hooks", value=lifecycle_hooks, expected_type=type_hints["lifecycle_hooks"])
|
|
9713
9787
|
check_type(argname="argument maximum_percent", value=maximum_percent, expected_type=type_hints["maximum_percent"])
|
|
9714
9788
|
check_type(argname="argument minimum_healthy_percent", value=minimum_healthy_percent, expected_type=type_hints["minimum_healthy_percent"])
|
|
9789
|
+
check_type(argname="argument strategy", value=strategy, expected_type=type_hints["strategy"])
|
|
9715
9790
|
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
9716
9791
|
if alarms is not None:
|
|
9717
9792
|
self._values["alarms"] = alarms
|
|
9793
|
+
if bake_time_in_minutes is not None:
|
|
9794
|
+
self._values["bake_time_in_minutes"] = bake_time_in_minutes
|
|
9718
9795
|
if deployment_circuit_breaker is not None:
|
|
9719
9796
|
self._values["deployment_circuit_breaker"] = deployment_circuit_breaker
|
|
9797
|
+
if lifecycle_hooks is not None:
|
|
9798
|
+
self._values["lifecycle_hooks"] = lifecycle_hooks
|
|
9720
9799
|
if maximum_percent is not None:
|
|
9721
9800
|
self._values["maximum_percent"] = maximum_percent
|
|
9722
9801
|
if minimum_healthy_percent is not None:
|
|
9723
9802
|
self._values["minimum_healthy_percent"] = minimum_healthy_percent
|
|
9803
|
+
if strategy is not None:
|
|
9804
|
+
self._values["strategy"] = strategy
|
|
9724
9805
|
|
|
9725
9806
|
@builtins.property
|
|
9726
9807
|
def alarms(
|
|
@@ -9733,6 +9814,14 @@ class CfnService(
|
|
|
9733
9814
|
result = self._values.get("alarms")
|
|
9734
9815
|
return typing.cast(typing.Optional[typing.Union[_IResolvable_da3f097b, "CfnService.DeploymentAlarmsProperty"]], result)
|
|
9735
9816
|
|
|
9817
|
+
@builtins.property
|
|
9818
|
+
def bake_time_in_minutes(self) -> typing.Optional[jsii.Number]:
|
|
9819
|
+
'''
|
|
9820
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentconfiguration.html#cfn-ecs-service-deploymentconfiguration-baketimeinminutes
|
|
9821
|
+
'''
|
|
9822
|
+
result = self._values.get("bake_time_in_minutes")
|
|
9823
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
9824
|
+
|
|
9736
9825
|
@builtins.property
|
|
9737
9826
|
def deployment_circuit_breaker(
|
|
9738
9827
|
self,
|
|
@@ -9748,6 +9837,16 @@ class CfnService(
|
|
|
9748
9837
|
result = self._values.get("deployment_circuit_breaker")
|
|
9749
9838
|
return typing.cast(typing.Optional[typing.Union[_IResolvable_da3f097b, "CfnService.DeploymentCircuitBreakerProperty"]], result)
|
|
9750
9839
|
|
|
9840
|
+
@builtins.property
|
|
9841
|
+
def lifecycle_hooks(
|
|
9842
|
+
self,
|
|
9843
|
+
) -> typing.Optional[typing.Union[_IResolvable_da3f097b, typing.List[typing.Union[_IResolvable_da3f097b, "CfnService.DeploymentLifecycleHookProperty"]]]]:
|
|
9844
|
+
'''
|
|
9845
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentconfiguration.html#cfn-ecs-service-deploymentconfiguration-lifecyclehooks
|
|
9846
|
+
'''
|
|
9847
|
+
result = self._values.get("lifecycle_hooks")
|
|
9848
|
+
return typing.cast(typing.Optional[typing.Union[_IResolvable_da3f097b, typing.List[typing.Union[_IResolvable_da3f097b, "CfnService.DeploymentLifecycleHookProperty"]]]], result)
|
|
9849
|
+
|
|
9751
9850
|
@builtins.property
|
|
9752
9851
|
def maximum_percent(self) -> typing.Optional[jsii.Number]:
|
|
9753
9852
|
'''If a service is using the rolling update ( ``ECS`` ) deployment type, the ``maximumPercent`` parameter represents an upper limit on the number of your service's tasks that are allowed in the ``RUNNING`` or ``PENDING`` state during a deployment, as a percentage of the ``desiredCount`` (rounded down to the nearest integer).
|
|
@@ -9803,6 +9902,14 @@ class CfnService(
|
|
|
9803
9902
|
result = self._values.get("minimum_healthy_percent")
|
|
9804
9903
|
return typing.cast(typing.Optional[jsii.Number], result)
|
|
9805
9904
|
|
|
9905
|
+
@builtins.property
|
|
9906
|
+
def strategy(self) -> typing.Optional[builtins.str]:
|
|
9907
|
+
'''
|
|
9908
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentconfiguration.html#cfn-ecs-service-deploymentconfiguration-strategy
|
|
9909
|
+
'''
|
|
9910
|
+
result = self._values.get("strategy")
|
|
9911
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
9912
|
+
|
|
9806
9913
|
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
9807
9914
|
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
9808
9915
|
|
|
@@ -9823,7 +9930,7 @@ class CfnService(
|
|
|
9823
9930
|
def __init__(self, *, type: typing.Optional[builtins.str] = None) -> None:
|
|
9824
9931
|
'''The deployment controller to use for the service.
|
|
9825
9932
|
|
|
9826
|
-
:param type: The deployment controller type to use.
|
|
9933
|
+
:param type: The deployment controller type to use. The deployment controller is the mechanism that determines how tasks are deployed for your service. The valid options are: - ECS When you create a service which uses the ``ECS`` deployment controller, you can choose between the following deployment strategies: - ``ROLLING`` : When you create a service which uses the *rolling update* ( ``ROLLING`` ) deployment strategy, the Amazon ECS service scheduler replaces the currently running tasks with new tasks. The number of tasks that Amazon ECS adds or removes from the service during a rolling update is controlled by the service deployment configuration. Rolling update deployments are best suited for the following scenarios: - Gradual service updates: You need to update your service incrementally without taking the entire service offline at once. - Limited resource requirements: You want to avoid the additional resource costs of running two complete environments simultaneously (as required by blue/green deployments). - Acceptable deployment time: Your application can tolerate a longer deployment process, as rolling updates replace tasks one by one. - No need for instant roll back: Your service can tolerate a rollback process that takes minutes rather than seconds. - Simple deployment process: You prefer a straightforward deployment approach without the complexity of managing multiple environments, target groups, and listeners. - No load balancer requirement: Your service doesn't use or require a load balancer, Application Load Balancer , Network Load Balancer , or Service Connect (which are required for blue/green deployments). - Stateful applications: Your application maintains state that makes it difficult to run two parallel environments. - Cost sensitivity: You want to minimize deployment costs by not running duplicate environments during deployment. Rolling updates are the default deployment strategy for services and provide a balance between deployment safety and resource efficiency for many common application scenarios. - ``BLUE_GREEN`` : A *blue/green* deployment strategy ( ``BLUE_GREEN`` ) is a release methodology that reduces downtime and risk by running two identical production environments called blue and green. With Amazon ECS blue/green deployments, you can validate new service revisions before directing production traffic to them. This approach provides a safer way to deploy changes with the ability to quickly roll back if needed. Amazon ECS blue/green deployments are best suited for the following scenarios: - Service validation: When you need to validate new service revisions before directing production traffic to them - Zero downtime: When your service requires zero-downtime deployments - Instant roll back: When you need the ability to quickly roll back if issues are detected - Load balancer requirement: When your service uses Application Load Balancer , Network Load Balancer , or Service Connect - External Use a third-party deployment controller. - Blue/green deployment (powered by CodeDeploy ) CodeDeploy installs an updated version of the application as a new replacement task set and reroutes production traffic from the original application task set to the replacement task set. The original task set is terminated after a successful deployment. Use this deployment controller to verify a new deployment of a service before sending production traffic to it. When updating the deployment controller for a service, consider the following depending on the type of migration you're performing. - If you have a template that contains the ``EXTERNAL`` deployment controller information as well as ``TaskSet`` and ``PrimaryTaskSet`` resources, and you remove the task set resources from the template when updating from ``EXTERNAL`` to ``ECS`` , the ``DescribeTaskSet`` and ``DeleteTaskSet`` API calls will return a 400 error after the deployment controller is updated to ``ECS`` . This results in a delete failure on the task set resources, even though the stack transitions to ``UPDATE_COMPLETE`` status. For more information, see `Resource removed from stack but not deleted <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-resource-removed-not-deleted>`_ in the AWS CloudFormation User Guide. To fix this issue, delete the task sets directly using the Amazon ECS ``DeleteTaskSet`` API. For more information about how to delete a task set, see `DeleteTaskSet <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteTaskSet.html>`_ in the Amazon Elastic Container Service API Reference. - If you're migrating from ``CODE_DEPLOY`` to ``ECS`` with a new task definition and AWS CloudFormation performs a rollback operation, the Amazon ECS ``UpdateService`` request fails with the following error: Resource handler returned message: "Invalid request provided: Unable to update task definition on services with a CODE_DEPLOY deployment controller. - After a successful migration from ``ECS`` to ``EXTERNAL`` deployment controller, you need to manually remove the ``ACTIVE`` task set, because Amazon ECS no longer manages the deployment. For information about how to delete a task set, see `DeleteTaskSet <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteTaskSet.html>`_ in the Amazon Elastic Container Service API Reference.
|
|
9827
9934
|
|
|
9828
9935
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentcontroller.html
|
|
9829
9936
|
:exampleMetadata: fixture=_generated
|
|
@@ -9847,11 +9954,53 @@ class CfnService(
|
|
|
9847
9954
|
|
|
9848
9955
|
@builtins.property
|
|
9849
9956
|
def type(self) -> typing.Optional[builtins.str]:
|
|
9850
|
-
'''The deployment controller type to use.
|
|
9957
|
+
'''The deployment controller type to use.
|
|
9958
|
+
|
|
9959
|
+
The deployment controller is the mechanism that determines how tasks are deployed for your service. The valid options are:
|
|
9960
|
+
|
|
9961
|
+
- ECS
|
|
9962
|
+
|
|
9963
|
+
When you create a service which uses the ``ECS`` deployment controller, you can choose between the following deployment strategies:
|
|
9964
|
+
|
|
9965
|
+
- ``ROLLING`` : When you create a service which uses the *rolling update* ( ``ROLLING`` ) deployment strategy, the Amazon ECS service scheduler replaces the currently running tasks with new tasks. The number of tasks that Amazon ECS adds or removes from the service during a rolling update is controlled by the service deployment configuration.
|
|
9851
9966
|
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
-
|
|
9967
|
+
Rolling update deployments are best suited for the following scenarios:
|
|
9968
|
+
|
|
9969
|
+
- Gradual service updates: You need to update your service incrementally without taking the entire service offline at once.
|
|
9970
|
+
- Limited resource requirements: You want to avoid the additional resource costs of running two complete environments simultaneously (as required by blue/green deployments).
|
|
9971
|
+
- Acceptable deployment time: Your application can tolerate a longer deployment process, as rolling updates replace tasks one by one.
|
|
9972
|
+
- No need for instant roll back: Your service can tolerate a rollback process that takes minutes rather than seconds.
|
|
9973
|
+
- Simple deployment process: You prefer a straightforward deployment approach without the complexity of managing multiple environments, target groups, and listeners.
|
|
9974
|
+
- No load balancer requirement: Your service doesn't use or require a load balancer, Application Load Balancer , Network Load Balancer , or Service Connect (which are required for blue/green deployments).
|
|
9975
|
+
- Stateful applications: Your application maintains state that makes it difficult to run two parallel environments.
|
|
9976
|
+
- Cost sensitivity: You want to minimize deployment costs by not running duplicate environments during deployment.
|
|
9977
|
+
|
|
9978
|
+
Rolling updates are the default deployment strategy for services and provide a balance between deployment safety and resource efficiency for many common application scenarios.
|
|
9979
|
+
|
|
9980
|
+
- ``BLUE_GREEN`` : A *blue/green* deployment strategy ( ``BLUE_GREEN`` ) is a release methodology that reduces downtime and risk by running two identical production environments called blue and green. With Amazon ECS blue/green deployments, you can validate new service revisions before directing production traffic to them. This approach provides a safer way to deploy changes with the ability to quickly roll back if needed.
|
|
9981
|
+
|
|
9982
|
+
Amazon ECS blue/green deployments are best suited for the following scenarios:
|
|
9983
|
+
|
|
9984
|
+
- Service validation: When you need to validate new service revisions before directing production traffic to them
|
|
9985
|
+
- Zero downtime: When your service requires zero-downtime deployments
|
|
9986
|
+
- Instant roll back: When you need the ability to quickly roll back if issues are detected
|
|
9987
|
+
- Load balancer requirement: When your service uses Application Load Balancer , Network Load Balancer , or Service Connect
|
|
9988
|
+
- External
|
|
9989
|
+
|
|
9990
|
+
Use a third-party deployment controller.
|
|
9991
|
+
|
|
9992
|
+
- Blue/green deployment (powered by CodeDeploy )
|
|
9993
|
+
|
|
9994
|
+
CodeDeploy installs an updated version of the application as a new replacement task set and reroutes production traffic from the original application task set to the replacement task set. The original task set is terminated after a successful deployment. Use this deployment controller to verify a new deployment of a service before sending production traffic to it.
|
|
9995
|
+
|
|
9996
|
+
When updating the deployment controller for a service, consider the following depending on the type of migration you're performing.
|
|
9997
|
+
|
|
9998
|
+
- If you have a template that contains the ``EXTERNAL`` deployment controller information as well as ``TaskSet`` and ``PrimaryTaskSet`` resources, and you remove the task set resources from the template when updating from ``EXTERNAL`` to ``ECS`` , the ``DescribeTaskSet`` and ``DeleteTaskSet`` API calls will return a 400 error after the deployment controller is updated to ``ECS`` . This results in a delete failure on the task set resources, even though the stack transitions to ``UPDATE_COMPLETE`` status. For more information, see `Resource removed from stack but not deleted <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-resource-removed-not-deleted>`_ in the AWS CloudFormation User Guide. To fix this issue, delete the task sets directly using the Amazon ECS ``DeleteTaskSet`` API. For more information about how to delete a task set, see `DeleteTaskSet <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteTaskSet.html>`_ in the Amazon Elastic Container Service API Reference.
|
|
9999
|
+
- If you're migrating from ``CODE_DEPLOY`` to ``ECS`` with a new task definition and AWS CloudFormation performs a rollback operation, the Amazon ECS ``UpdateService`` request fails with the following error:
|
|
10000
|
+
|
|
10001
|
+
Resource handler returned message: "Invalid request provided: Unable to update task definition on services with a CODE_DEPLOY deployment controller.
|
|
10002
|
+
|
|
10003
|
+
- After a successful migration from ``ECS`` to ``EXTERNAL`` deployment controller, you need to manually remove the ``ACTIVE`` task set, because Amazon ECS no longer manages the deployment. For information about how to delete a task set, see `DeleteTaskSet <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteTaskSet.html>`_ in the Amazon Elastic Container Service API Reference.
|
|
9855
10004
|
|
|
9856
10005
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentcontroller.html#cfn-ecs-service-deploymentcontroller-type
|
|
9857
10006
|
'''
|
|
@@ -9869,6 +10018,92 @@ class CfnService(
|
|
|
9869
10018
|
k + "=" + repr(v) for k, v in self._values.items()
|
|
9870
10019
|
)
|
|
9871
10020
|
|
|
10021
|
+
@jsii.data_type(
|
|
10022
|
+
jsii_type="aws-cdk-lib.aws_ecs.CfnService.DeploymentLifecycleHookProperty",
|
|
10023
|
+
jsii_struct_bases=[],
|
|
10024
|
+
name_mapping={
|
|
10025
|
+
"hook_target_arn": "hookTargetArn",
|
|
10026
|
+
"lifecycle_stages": "lifecycleStages",
|
|
10027
|
+
"role_arn": "roleArn",
|
|
10028
|
+
},
|
|
10029
|
+
)
|
|
10030
|
+
class DeploymentLifecycleHookProperty:
|
|
10031
|
+
def __init__(
|
|
10032
|
+
self,
|
|
10033
|
+
*,
|
|
10034
|
+
hook_target_arn: builtins.str,
|
|
10035
|
+
lifecycle_stages: typing.Sequence[builtins.str],
|
|
10036
|
+
role_arn: builtins.str,
|
|
10037
|
+
) -> None:
|
|
10038
|
+
'''
|
|
10039
|
+
:param hook_target_arn:
|
|
10040
|
+
:param lifecycle_stages:
|
|
10041
|
+
:param role_arn:
|
|
10042
|
+
|
|
10043
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentlifecyclehook.html
|
|
10044
|
+
:exampleMetadata: fixture=_generated
|
|
10045
|
+
|
|
10046
|
+
Example::
|
|
10047
|
+
|
|
10048
|
+
# The code below shows an example of how to instantiate this type.
|
|
10049
|
+
# The values are placeholders you should change.
|
|
10050
|
+
from aws_cdk import aws_ecs as ecs
|
|
10051
|
+
|
|
10052
|
+
deployment_lifecycle_hook_property = ecs.CfnService.DeploymentLifecycleHookProperty(
|
|
10053
|
+
hook_target_arn="hookTargetArn",
|
|
10054
|
+
lifecycle_stages=["lifecycleStages"],
|
|
10055
|
+
role_arn="roleArn"
|
|
10056
|
+
)
|
|
10057
|
+
'''
|
|
10058
|
+
if __debug__:
|
|
10059
|
+
type_hints = typing.get_type_hints(_typecheckingstub__81d51cf744a434ad2ba13fc9f3dea23611c28b28f4a9414d8324cf57768cea5e)
|
|
10060
|
+
check_type(argname="argument hook_target_arn", value=hook_target_arn, expected_type=type_hints["hook_target_arn"])
|
|
10061
|
+
check_type(argname="argument lifecycle_stages", value=lifecycle_stages, expected_type=type_hints["lifecycle_stages"])
|
|
10062
|
+
check_type(argname="argument role_arn", value=role_arn, expected_type=type_hints["role_arn"])
|
|
10063
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
10064
|
+
"hook_target_arn": hook_target_arn,
|
|
10065
|
+
"lifecycle_stages": lifecycle_stages,
|
|
10066
|
+
"role_arn": role_arn,
|
|
10067
|
+
}
|
|
10068
|
+
|
|
10069
|
+
@builtins.property
|
|
10070
|
+
def hook_target_arn(self) -> builtins.str:
|
|
10071
|
+
'''
|
|
10072
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentlifecyclehook.html#cfn-ecs-service-deploymentlifecyclehook-hooktargetarn
|
|
10073
|
+
'''
|
|
10074
|
+
result = self._values.get("hook_target_arn")
|
|
10075
|
+
assert result is not None, "Required property 'hook_target_arn' is missing"
|
|
10076
|
+
return typing.cast(builtins.str, result)
|
|
10077
|
+
|
|
10078
|
+
@builtins.property
|
|
10079
|
+
def lifecycle_stages(self) -> typing.List[builtins.str]:
|
|
10080
|
+
'''
|
|
10081
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentlifecyclehook.html#cfn-ecs-service-deploymentlifecyclehook-lifecyclestages
|
|
10082
|
+
'''
|
|
10083
|
+
result = self._values.get("lifecycle_stages")
|
|
10084
|
+
assert result is not None, "Required property 'lifecycle_stages' is missing"
|
|
10085
|
+
return typing.cast(typing.List[builtins.str], result)
|
|
10086
|
+
|
|
10087
|
+
@builtins.property
|
|
10088
|
+
def role_arn(self) -> builtins.str:
|
|
10089
|
+
'''
|
|
10090
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentlifecyclehook.html#cfn-ecs-service-deploymentlifecyclehook-rolearn
|
|
10091
|
+
'''
|
|
10092
|
+
result = self._values.get("role_arn")
|
|
10093
|
+
assert result is not None, "Required property 'role_arn' is missing"
|
|
10094
|
+
return typing.cast(builtins.str, result)
|
|
10095
|
+
|
|
10096
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
10097
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
10098
|
+
|
|
10099
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
10100
|
+
return not (rhs == self)
|
|
10101
|
+
|
|
10102
|
+
def __repr__(self) -> str:
|
|
10103
|
+
return "DeploymentLifecycleHookProperty(%s)" % ", ".join(
|
|
10104
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
10105
|
+
)
|
|
10106
|
+
|
|
9872
10107
|
@jsii.data_type(
|
|
9873
10108
|
jsii_type="aws-cdk-lib.aws_ecs.CfnService.EBSTagSpecificationProperty",
|
|
9874
10109
|
jsii_struct_bases=[],
|
|
@@ -9972,6 +10207,7 @@ class CfnService(
|
|
|
9972
10207
|
jsii_type="aws-cdk-lib.aws_ecs.CfnService.LoadBalancerProperty",
|
|
9973
10208
|
jsii_struct_bases=[],
|
|
9974
10209
|
name_mapping={
|
|
10210
|
+
"advanced_configuration": "advancedConfiguration",
|
|
9975
10211
|
"container_name": "containerName",
|
|
9976
10212
|
"container_port": "containerPort",
|
|
9977
10213
|
"load_balancer_name": "loadBalancerName",
|
|
@@ -9982,6 +10218,7 @@ class CfnService(
|
|
|
9982
10218
|
def __init__(
|
|
9983
10219
|
self,
|
|
9984
10220
|
*,
|
|
10221
|
+
advanced_configuration: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Union["CfnService.AdvancedConfigurationProperty", typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
9985
10222
|
container_name: typing.Optional[builtins.str] = None,
|
|
9986
10223
|
container_port: typing.Optional[jsii.Number] = None,
|
|
9987
10224
|
load_balancer_name: typing.Optional[builtins.str] = None,
|
|
@@ -9993,6 +10230,7 @@ class CfnService(
|
|
|
9993
10230
|
|
|
9994
10231
|
Services with tasks that use the ``awsvpc`` network mode (for example, those with the Fargate launch type) only support Application Load Balancers and Network Load Balancers. Classic Load Balancers are not supported. Also, when you create any target groups for these services, you must choose ``ip`` as the target type, not ``instance`` . Tasks that use the ``awsvpc`` network mode are associated with an elastic network interface, not an Amazon EC2 instance.
|
|
9995
10232
|
|
|
10233
|
+
:param advanced_configuration:
|
|
9996
10234
|
:param container_name: The name of the container (as it appears in a container definition) to associate with the load balancer. You need to specify the container name when configuring the target group for an Amazon ECS load balancer.
|
|
9997
10235
|
:param container_port: The port on the container to associate with the load balancer. This port must correspond to a ``containerPort`` in the task definition the tasks in the service are using. For tasks that use the EC2 launch type, the container instance they're launched on must allow ingress traffic on the ``hostPort`` of the port mapping.
|
|
9998
10236
|
:param load_balancer_name: The name of the load balancer to associate with the Amazon ECS service or task set. If you are using an Application Load Balancer or a Network Load Balancer the load balancer name parameter should be omitted.
|
|
@@ -10008,6 +10246,14 @@ class CfnService(
|
|
|
10008
10246
|
from aws_cdk import aws_ecs as ecs
|
|
10009
10247
|
|
|
10010
10248
|
load_balancer_property = ecs.CfnService.LoadBalancerProperty(
|
|
10249
|
+
advanced_configuration=ecs.CfnService.AdvancedConfigurationProperty(
|
|
10250
|
+
alternate_target_group_arn="alternateTargetGroupArn",
|
|
10251
|
+
|
|
10252
|
+
# the properties below are optional
|
|
10253
|
+
production_listener_rule="productionListenerRule",
|
|
10254
|
+
role_arn="roleArn",
|
|
10255
|
+
test_listener_rule="testListenerRule"
|
|
10256
|
+
),
|
|
10011
10257
|
container_name="containerName",
|
|
10012
10258
|
container_port=123,
|
|
10013
10259
|
load_balancer_name="loadBalancerName",
|
|
@@ -10016,11 +10262,14 @@ class CfnService(
|
|
|
10016
10262
|
'''
|
|
10017
10263
|
if __debug__:
|
|
10018
10264
|
type_hints = typing.get_type_hints(_typecheckingstub__251c3999c1586967f7c9091782e6a113831e05b5f853b910cad8c8e75f654def)
|
|
10265
|
+
check_type(argname="argument advanced_configuration", value=advanced_configuration, expected_type=type_hints["advanced_configuration"])
|
|
10019
10266
|
check_type(argname="argument container_name", value=container_name, expected_type=type_hints["container_name"])
|
|
10020
10267
|
check_type(argname="argument container_port", value=container_port, expected_type=type_hints["container_port"])
|
|
10021
10268
|
check_type(argname="argument load_balancer_name", value=load_balancer_name, expected_type=type_hints["load_balancer_name"])
|
|
10022
10269
|
check_type(argname="argument target_group_arn", value=target_group_arn, expected_type=type_hints["target_group_arn"])
|
|
10023
10270
|
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
10271
|
+
if advanced_configuration is not None:
|
|
10272
|
+
self._values["advanced_configuration"] = advanced_configuration
|
|
10024
10273
|
if container_name is not None:
|
|
10025
10274
|
self._values["container_name"] = container_name
|
|
10026
10275
|
if container_port is not None:
|
|
@@ -10030,6 +10279,16 @@ class CfnService(
|
|
|
10030
10279
|
if target_group_arn is not None:
|
|
10031
10280
|
self._values["target_group_arn"] = target_group_arn
|
|
10032
10281
|
|
|
10282
|
+
@builtins.property
|
|
10283
|
+
def advanced_configuration(
|
|
10284
|
+
self,
|
|
10285
|
+
) -> typing.Optional[typing.Union[_IResolvable_da3f097b, "CfnService.AdvancedConfigurationProperty"]]:
|
|
10286
|
+
'''
|
|
10287
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-loadbalancer.html#cfn-ecs-service-loadbalancer-advancedconfiguration
|
|
10288
|
+
'''
|
|
10289
|
+
result = self._values.get("advanced_configuration")
|
|
10290
|
+
return typing.cast(typing.Optional[typing.Union[_IResolvable_da3f097b, "CfnService.AdvancedConfigurationProperty"]], result)
|
|
10291
|
+
|
|
10033
10292
|
@builtins.property
|
|
10034
10293
|
def container_name(self) -> typing.Optional[builtins.str]:
|
|
10035
10294
|
'''The name of the container (as it appears in a container definition) to associate with the load balancer.
|
|
@@ -10621,7 +10880,11 @@ class CfnService(
|
|
|
10621
10880
|
@jsii.data_type(
|
|
10622
10881
|
jsii_type="aws-cdk-lib.aws_ecs.CfnService.ServiceConnectClientAliasProperty",
|
|
10623
10882
|
jsii_struct_bases=[],
|
|
10624
|
-
name_mapping={
|
|
10883
|
+
name_mapping={
|
|
10884
|
+
"port": "port",
|
|
10885
|
+
"dns_name": "dnsName",
|
|
10886
|
+
"test_traffic_rules": "testTrafficRules",
|
|
10887
|
+
},
|
|
10625
10888
|
)
|
|
10626
10889
|
class ServiceConnectClientAliasProperty:
|
|
10627
10890
|
def __init__(
|
|
@@ -10629,6 +10892,7 @@ class CfnService(
|
|
|
10629
10892
|
*,
|
|
10630
10893
|
port: jsii.Number,
|
|
10631
10894
|
dns_name: typing.Optional[builtins.str] = None,
|
|
10895
|
+
test_traffic_rules: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Union["CfnService.ServiceConnectTestTrafficRulesProperty", typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
10632
10896
|
) -> None:
|
|
10633
10897
|
'''Each alias ("endpoint") is a fully-qualified name and port number that other tasks ("clients") can use to connect to this service.
|
|
10634
10898
|
|
|
@@ -10638,6 +10902,7 @@ class CfnService(
|
|
|
10638
10902
|
|
|
10639
10903
|
:param port: The listening port number for the Service Connect proxy. This port is available inside of all of the tasks within the same namespace. To avoid changing your applications in client Amazon ECS services, set this to the same port that the client application uses by default. For more information, see `Service Connect <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html>`_ in the *Amazon Elastic Container Service Developer Guide* .
|
|
10640
10904
|
:param dns_name: The ``dnsName`` is the name that you use in the applications of client tasks to connect to this service. The name must be a valid DNS name but doesn't need to be fully-qualified. The name can include up to 127 characters. The name can include lowercase letters, numbers, underscores (_), hyphens (-), and periods (.). The name can't start with a hyphen. If this parameter isn't specified, the default value of ``discoveryName.namespace`` is used. If the ``discoveryName`` isn't specified, the port mapping name from the task definition is used in ``portName.namespace`` . To avoid changing your applications in client Amazon ECS services, set this to the same name that the client application uses by default. For example, a few common names are ``database`` , ``db`` , or the lowercase name of a database, such as ``mysql`` or ``redis`` . For more information, see `Service Connect <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html>`_ in the *Amazon Elastic Container Service Developer Guide* .
|
|
10905
|
+
:param test_traffic_rules:
|
|
10641
10906
|
|
|
10642
10907
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectclientalias.html
|
|
10643
10908
|
:exampleMetadata: fixture=_generated
|
|
@@ -10652,18 +10917,31 @@ class CfnService(
|
|
|
10652
10917
|
port=123,
|
|
10653
10918
|
|
|
10654
10919
|
# the properties below are optional
|
|
10655
|
-
dns_name="dnsName"
|
|
10920
|
+
dns_name="dnsName",
|
|
10921
|
+
test_traffic_rules=ecs.CfnService.ServiceConnectTestTrafficRulesProperty(
|
|
10922
|
+
header=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderProperty(
|
|
10923
|
+
name="name",
|
|
10924
|
+
|
|
10925
|
+
# the properties below are optional
|
|
10926
|
+
value=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty(
|
|
10927
|
+
exact="exact"
|
|
10928
|
+
)
|
|
10929
|
+
)
|
|
10930
|
+
)
|
|
10656
10931
|
)
|
|
10657
10932
|
'''
|
|
10658
10933
|
if __debug__:
|
|
10659
10934
|
type_hints = typing.get_type_hints(_typecheckingstub__7552e3d2b970cfb26552bec096b0680acf8bc8c7b59096bbf5a210dd3266fd35)
|
|
10660
10935
|
check_type(argname="argument port", value=port, expected_type=type_hints["port"])
|
|
10661
10936
|
check_type(argname="argument dns_name", value=dns_name, expected_type=type_hints["dns_name"])
|
|
10937
|
+
check_type(argname="argument test_traffic_rules", value=test_traffic_rules, expected_type=type_hints["test_traffic_rules"])
|
|
10662
10938
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
10663
10939
|
"port": port,
|
|
10664
10940
|
}
|
|
10665
10941
|
if dns_name is not None:
|
|
10666
10942
|
self._values["dns_name"] = dns_name
|
|
10943
|
+
if test_traffic_rules is not None:
|
|
10944
|
+
self._values["test_traffic_rules"] = test_traffic_rules
|
|
10667
10945
|
|
|
10668
10946
|
@builtins.property
|
|
10669
10947
|
def port(self) -> jsii.Number:
|
|
@@ -10694,6 +10972,16 @@ class CfnService(
|
|
|
10694
10972
|
result = self._values.get("dns_name")
|
|
10695
10973
|
return typing.cast(typing.Optional[builtins.str], result)
|
|
10696
10974
|
|
|
10975
|
+
@builtins.property
|
|
10976
|
+
def test_traffic_rules(
|
|
10977
|
+
self,
|
|
10978
|
+
) -> typing.Optional[typing.Union[_IResolvable_da3f097b, "CfnService.ServiceConnectTestTrafficRulesProperty"]]:
|
|
10979
|
+
'''
|
|
10980
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnectclientalias.html#cfn-ecs-service-serviceconnectclientalias-testtrafficrules
|
|
10981
|
+
'''
|
|
10982
|
+
result = self._values.get("test_traffic_rules")
|
|
10983
|
+
return typing.cast(typing.Optional[typing.Union[_IResolvable_da3f097b, "CfnService.ServiceConnectTestTrafficRulesProperty"]], result)
|
|
10984
|
+
|
|
10697
10985
|
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
10698
10986
|
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
10699
10987
|
|
|
@@ -10767,7 +11055,17 @@ class CfnService(
|
|
|
10767
11055
|
port=123,
|
|
10768
11056
|
|
|
10769
11057
|
# the properties below are optional
|
|
10770
|
-
dns_name="dnsName"
|
|
11058
|
+
dns_name="dnsName",
|
|
11059
|
+
test_traffic_rules=ecs.CfnService.ServiceConnectTestTrafficRulesProperty(
|
|
11060
|
+
header=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderProperty(
|
|
11061
|
+
name="name",
|
|
11062
|
+
|
|
11063
|
+
# the properties below are optional
|
|
11064
|
+
value=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty(
|
|
11065
|
+
exact="exact"
|
|
11066
|
+
)
|
|
11067
|
+
)
|
|
11068
|
+
)
|
|
10771
11069
|
)],
|
|
10772
11070
|
discovery_name="discoveryName",
|
|
10773
11071
|
ingress_port_override=123,
|
|
@@ -10930,7 +11228,17 @@ class CfnService(
|
|
|
10930
11228
|
port=123,
|
|
10931
11229
|
|
|
10932
11230
|
# the properties below are optional
|
|
10933
|
-
dns_name="dnsName"
|
|
11231
|
+
dns_name="dnsName",
|
|
11232
|
+
test_traffic_rules=ecs.CfnService.ServiceConnectTestTrafficRulesProperty(
|
|
11233
|
+
header=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderProperty(
|
|
11234
|
+
name="name",
|
|
11235
|
+
|
|
11236
|
+
# the properties below are optional
|
|
11237
|
+
value=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty(
|
|
11238
|
+
exact="exact"
|
|
11239
|
+
)
|
|
11240
|
+
)
|
|
11241
|
+
)
|
|
10934
11242
|
)],
|
|
10935
11243
|
discovery_name="discoveryName",
|
|
10936
11244
|
ingress_port_override=123,
|
|
@@ -11059,6 +11367,193 @@ class CfnService(
|
|
|
11059
11367
|
k + "=" + repr(v) for k, v in self._values.items()
|
|
11060
11368
|
)
|
|
11061
11369
|
|
|
11370
|
+
@jsii.data_type(
|
|
11371
|
+
jsii_type="aws-cdk-lib.aws_ecs.CfnService.ServiceConnectTestTrafficRulesHeaderProperty",
|
|
11372
|
+
jsii_struct_bases=[],
|
|
11373
|
+
name_mapping={"name": "name", "value": "value"},
|
|
11374
|
+
)
|
|
11375
|
+
class ServiceConnectTestTrafficRulesHeaderProperty:
|
|
11376
|
+
def __init__(
|
|
11377
|
+
self,
|
|
11378
|
+
*,
|
|
11379
|
+
name: builtins.str,
|
|
11380
|
+
value: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Union["CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty", typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
11381
|
+
) -> None:
|
|
11382
|
+
'''
|
|
11383
|
+
:param name:
|
|
11384
|
+
:param value:
|
|
11385
|
+
|
|
11386
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnecttesttrafficrulesheader.html
|
|
11387
|
+
:exampleMetadata: fixture=_generated
|
|
11388
|
+
|
|
11389
|
+
Example::
|
|
11390
|
+
|
|
11391
|
+
# The code below shows an example of how to instantiate this type.
|
|
11392
|
+
# The values are placeholders you should change.
|
|
11393
|
+
from aws_cdk import aws_ecs as ecs
|
|
11394
|
+
|
|
11395
|
+
service_connect_test_traffic_rules_header_property = ecs.CfnService.ServiceConnectTestTrafficRulesHeaderProperty(
|
|
11396
|
+
name="name",
|
|
11397
|
+
|
|
11398
|
+
# the properties below are optional
|
|
11399
|
+
value=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty(
|
|
11400
|
+
exact="exact"
|
|
11401
|
+
)
|
|
11402
|
+
)
|
|
11403
|
+
'''
|
|
11404
|
+
if __debug__:
|
|
11405
|
+
type_hints = typing.get_type_hints(_typecheckingstub__95be6c123aaeddaea0658f43268bed3cd0c9fdafbb6f8eb86f2cfa3ece72131e)
|
|
11406
|
+
check_type(argname="argument name", value=name, expected_type=type_hints["name"])
|
|
11407
|
+
check_type(argname="argument value", value=value, expected_type=type_hints["value"])
|
|
11408
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
11409
|
+
"name": name,
|
|
11410
|
+
}
|
|
11411
|
+
if value is not None:
|
|
11412
|
+
self._values["value"] = value
|
|
11413
|
+
|
|
11414
|
+
@builtins.property
|
|
11415
|
+
def name(self) -> builtins.str:
|
|
11416
|
+
'''
|
|
11417
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnecttesttrafficrulesheader.html#cfn-ecs-service-serviceconnecttesttrafficrulesheader-name
|
|
11418
|
+
'''
|
|
11419
|
+
result = self._values.get("name")
|
|
11420
|
+
assert result is not None, "Required property 'name' is missing"
|
|
11421
|
+
return typing.cast(builtins.str, result)
|
|
11422
|
+
|
|
11423
|
+
@builtins.property
|
|
11424
|
+
def value(
|
|
11425
|
+
self,
|
|
11426
|
+
) -> typing.Optional[typing.Union[_IResolvable_da3f097b, "CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty"]]:
|
|
11427
|
+
'''
|
|
11428
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnecttesttrafficrulesheader.html#cfn-ecs-service-serviceconnecttesttrafficrulesheader-value
|
|
11429
|
+
'''
|
|
11430
|
+
result = self._values.get("value")
|
|
11431
|
+
return typing.cast(typing.Optional[typing.Union[_IResolvable_da3f097b, "CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty"]], result)
|
|
11432
|
+
|
|
11433
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
11434
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
11435
|
+
|
|
11436
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
11437
|
+
return not (rhs == self)
|
|
11438
|
+
|
|
11439
|
+
def __repr__(self) -> str:
|
|
11440
|
+
return "ServiceConnectTestTrafficRulesHeaderProperty(%s)" % ", ".join(
|
|
11441
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
11442
|
+
)
|
|
11443
|
+
|
|
11444
|
+
@jsii.data_type(
|
|
11445
|
+
jsii_type="aws-cdk-lib.aws_ecs.CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty",
|
|
11446
|
+
jsii_struct_bases=[],
|
|
11447
|
+
name_mapping={"exact": "exact"},
|
|
11448
|
+
)
|
|
11449
|
+
class ServiceConnectTestTrafficRulesHeaderValueProperty:
|
|
11450
|
+
def __init__(self, *, exact: builtins.str) -> None:
|
|
11451
|
+
'''
|
|
11452
|
+
:param exact:
|
|
11453
|
+
|
|
11454
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnecttesttrafficrulesheadervalue.html
|
|
11455
|
+
:exampleMetadata: fixture=_generated
|
|
11456
|
+
|
|
11457
|
+
Example::
|
|
11458
|
+
|
|
11459
|
+
# The code below shows an example of how to instantiate this type.
|
|
11460
|
+
# The values are placeholders you should change.
|
|
11461
|
+
from aws_cdk import aws_ecs as ecs
|
|
11462
|
+
|
|
11463
|
+
service_connect_test_traffic_rules_header_value_property = ecs.CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty(
|
|
11464
|
+
exact="exact"
|
|
11465
|
+
)
|
|
11466
|
+
'''
|
|
11467
|
+
if __debug__:
|
|
11468
|
+
type_hints = typing.get_type_hints(_typecheckingstub__00399c48ee323c2a3961b9504adf57d82b84cf123d2dd023433fc918ac78282f)
|
|
11469
|
+
check_type(argname="argument exact", value=exact, expected_type=type_hints["exact"])
|
|
11470
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
11471
|
+
"exact": exact,
|
|
11472
|
+
}
|
|
11473
|
+
|
|
11474
|
+
@builtins.property
|
|
11475
|
+
def exact(self) -> builtins.str:
|
|
11476
|
+
'''
|
|
11477
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnecttesttrafficrulesheadervalue.html#cfn-ecs-service-serviceconnecttesttrafficrulesheadervalue-exact
|
|
11478
|
+
'''
|
|
11479
|
+
result = self._values.get("exact")
|
|
11480
|
+
assert result is not None, "Required property 'exact' is missing"
|
|
11481
|
+
return typing.cast(builtins.str, result)
|
|
11482
|
+
|
|
11483
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
11484
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
11485
|
+
|
|
11486
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
11487
|
+
return not (rhs == self)
|
|
11488
|
+
|
|
11489
|
+
def __repr__(self) -> str:
|
|
11490
|
+
return "ServiceConnectTestTrafficRulesHeaderValueProperty(%s)" % ", ".join(
|
|
11491
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
11492
|
+
)
|
|
11493
|
+
|
|
11494
|
+
@jsii.data_type(
|
|
11495
|
+
jsii_type="aws-cdk-lib.aws_ecs.CfnService.ServiceConnectTestTrafficRulesProperty",
|
|
11496
|
+
jsii_struct_bases=[],
|
|
11497
|
+
name_mapping={"header": "header"},
|
|
11498
|
+
)
|
|
11499
|
+
class ServiceConnectTestTrafficRulesProperty:
|
|
11500
|
+
def __init__(
|
|
11501
|
+
self,
|
|
11502
|
+
*,
|
|
11503
|
+
header: typing.Union[_IResolvable_da3f097b, typing.Union["CfnService.ServiceConnectTestTrafficRulesHeaderProperty", typing.Dict[builtins.str, typing.Any]]],
|
|
11504
|
+
) -> None:
|
|
11505
|
+
'''
|
|
11506
|
+
:param header:
|
|
11507
|
+
|
|
11508
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnecttesttrafficrules.html
|
|
11509
|
+
:exampleMetadata: fixture=_generated
|
|
11510
|
+
|
|
11511
|
+
Example::
|
|
11512
|
+
|
|
11513
|
+
# The code below shows an example of how to instantiate this type.
|
|
11514
|
+
# The values are placeholders you should change.
|
|
11515
|
+
from aws_cdk import aws_ecs as ecs
|
|
11516
|
+
|
|
11517
|
+
service_connect_test_traffic_rules_property = ecs.CfnService.ServiceConnectTestTrafficRulesProperty(
|
|
11518
|
+
header=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderProperty(
|
|
11519
|
+
name="name",
|
|
11520
|
+
|
|
11521
|
+
# the properties below are optional
|
|
11522
|
+
value=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty(
|
|
11523
|
+
exact="exact"
|
|
11524
|
+
)
|
|
11525
|
+
)
|
|
11526
|
+
)
|
|
11527
|
+
'''
|
|
11528
|
+
if __debug__:
|
|
11529
|
+
type_hints = typing.get_type_hints(_typecheckingstub__38ae0ce4b02d72c8b4b7583b571baf645aed5c2d7b9e970baefceb7ffc5abed3)
|
|
11530
|
+
check_type(argname="argument header", value=header, expected_type=type_hints["header"])
|
|
11531
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
11532
|
+
"header": header,
|
|
11533
|
+
}
|
|
11534
|
+
|
|
11535
|
+
@builtins.property
|
|
11536
|
+
def header(
|
|
11537
|
+
self,
|
|
11538
|
+
) -> typing.Union[_IResolvable_da3f097b, "CfnService.ServiceConnectTestTrafficRulesHeaderProperty"]:
|
|
11539
|
+
'''
|
|
11540
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceconnecttesttrafficrules.html#cfn-ecs-service-serviceconnecttesttrafficrules-header
|
|
11541
|
+
'''
|
|
11542
|
+
result = self._values.get("header")
|
|
11543
|
+
assert result is not None, "Required property 'header' is missing"
|
|
11544
|
+
return typing.cast(typing.Union[_IResolvable_da3f097b, "CfnService.ServiceConnectTestTrafficRulesHeaderProperty"], result)
|
|
11545
|
+
|
|
11546
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
11547
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
11548
|
+
|
|
11549
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
11550
|
+
return not (rhs == self)
|
|
11551
|
+
|
|
11552
|
+
def __repr__(self) -> str:
|
|
11553
|
+
return "ServiceConnectTestTrafficRulesProperty(%s)" % ", ".join(
|
|
11554
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
11555
|
+
)
|
|
11556
|
+
|
|
11062
11557
|
@jsii.data_type(
|
|
11063
11558
|
jsii_type="aws-cdk-lib.aws_ecs.CfnService.ServiceConnectTlsCertificateAuthorityProperty",
|
|
11064
11559
|
jsii_struct_bases=[],
|
|
@@ -11976,9 +12471,9 @@ class CfnServiceProps:
|
|
|
11976
12471
|
:param capacity_provider_strategy: The capacity provider strategy to use for the service. If a ``capacityProviderStrategy`` is specified, the ``launchType`` parameter must be omitted. If no ``capacityProviderStrategy`` or ``launchType`` is specified, the ``defaultCapacityProviderStrategy`` for the cluster is used. A capacity provider strategy can contain a maximum of 20 capacity providers. .. epigraph:: To remove this property from your service resource, specify an empty ``CapacityProviderStrategyItem`` array.
|
|
11977
12472
|
:param cluster: The short name or full Amazon Resource Name (ARN) of the cluster that you run your service on. If you do not specify a cluster, the default cluster is assumed.
|
|
11978
12473
|
:param deployment_configuration: Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.
|
|
11979
|
-
:param deployment_controller: The deployment controller to use for the service.
|
|
12474
|
+
:param deployment_controller: The deployment controller to use for the service.
|
|
11980
12475
|
:param desired_count: The number of instantiations of the specified task definition to place and keep running in your service. For new services, if a desired count is not specified, a default value of ``1`` is used. When using the ``DAEMON`` scheduling strategy, the desired count is not required. For existing services, if a desired count is not specified, it is omitted from the operation.
|
|
11981
|
-
:param enable_ecs_managed_tags: Specifies whether to turn on Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging your Amazon ECS resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ in the *Amazon Elastic Container Service Developer Guide* . When you use Amazon ECS managed tags, you
|
|
12476
|
+
:param enable_ecs_managed_tags: Specifies whether to turn on Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging your Amazon ECS resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ in the *Amazon Elastic Container Service Developer Guide* . When you use Amazon ECS managed tags, you must set the ``propagateTags`` request parameter.
|
|
11982
12477
|
:param enable_execute_command: Determines whether the execute command functionality is turned on for the service. If ``true`` , the execute command functionality is turned on for all containers in tasks as part of the service.
|
|
11983
12478
|
:param health_check_grace_period_seconds: The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing, VPC Lattice, and container health checks after a task has first started. If you don't specify a health check grace period value, the default value of ``0`` is used. If you don't use any of the health checks, then ``healthCheckGracePeriodSeconds`` is unused. If your service's tasks take a while to start and respond to health checks, you can specify a health check grace period of up to 2,147,483,647 seconds (about 69 years). During that time, the Amazon ECS service scheduler ignores health check status. This grace period can prevent the service scheduler from marking tasks as unhealthy and stopping them before they have time to come up.
|
|
11984
12479
|
:param launch_type: The launch type on which to run your service. For more information, see `Amazon ECS Launch Types <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html>`_ in the *Amazon Elastic Container Service Developer Guide* .
|
|
@@ -12021,12 +12516,19 @@ class CfnServiceProps:
|
|
|
12021
12516
|
enable=False,
|
|
12022
12517
|
rollback=False
|
|
12023
12518
|
),
|
|
12519
|
+
bake_time_in_minutes=123,
|
|
12024
12520
|
deployment_circuit_breaker=ecs.CfnService.DeploymentCircuitBreakerProperty(
|
|
12025
12521
|
enable=False,
|
|
12026
12522
|
rollback=False
|
|
12027
12523
|
),
|
|
12524
|
+
lifecycle_hooks=[ecs.CfnService.DeploymentLifecycleHookProperty(
|
|
12525
|
+
hook_target_arn="hookTargetArn",
|
|
12526
|
+
lifecycle_stages=["lifecycleStages"],
|
|
12527
|
+
role_arn="roleArn"
|
|
12528
|
+
)],
|
|
12028
12529
|
maximum_percent=123,
|
|
12029
|
-
minimum_healthy_percent=123
|
|
12530
|
+
minimum_healthy_percent=123,
|
|
12531
|
+
strategy="strategy"
|
|
12030
12532
|
),
|
|
12031
12533
|
deployment_controller=ecs.CfnService.DeploymentControllerProperty(
|
|
12032
12534
|
type="type"
|
|
@@ -12037,6 +12539,14 @@ class CfnServiceProps:
|
|
|
12037
12539
|
health_check_grace_period_seconds=123,
|
|
12038
12540
|
launch_type="launchType",
|
|
12039
12541
|
load_balancers=[ecs.CfnService.LoadBalancerProperty(
|
|
12542
|
+
advanced_configuration=ecs.CfnService.AdvancedConfigurationProperty(
|
|
12543
|
+
alternate_target_group_arn="alternateTargetGroupArn",
|
|
12544
|
+
|
|
12545
|
+
# the properties below are optional
|
|
12546
|
+
production_listener_rule="productionListenerRule",
|
|
12547
|
+
role_arn="roleArn",
|
|
12548
|
+
test_listener_rule="testListenerRule"
|
|
12549
|
+
),
|
|
12040
12550
|
container_name="containerName",
|
|
12041
12551
|
container_port=123,
|
|
12042
12552
|
load_balancer_name="loadBalancerName",
|
|
@@ -12088,7 +12598,17 @@ class CfnServiceProps:
|
|
|
12088
12598
|
port=123,
|
|
12089
12599
|
|
|
12090
12600
|
# the properties below are optional
|
|
12091
|
-
dns_name="dnsName"
|
|
12601
|
+
dns_name="dnsName",
|
|
12602
|
+
test_traffic_rules=ecs.CfnService.ServiceConnectTestTrafficRulesProperty(
|
|
12603
|
+
header=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderProperty(
|
|
12604
|
+
name="name",
|
|
12605
|
+
|
|
12606
|
+
# the properties below are optional
|
|
12607
|
+
value=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty(
|
|
12608
|
+
exact="exact"
|
|
12609
|
+
)
|
|
12610
|
+
)
|
|
12611
|
+
)
|
|
12092
12612
|
)],
|
|
12093
12613
|
discovery_name="discoveryName",
|
|
12094
12614
|
ingress_port_override=123,
|
|
@@ -12293,8 +12813,6 @@ class CfnServiceProps:
|
|
|
12293
12813
|
) -> typing.Optional[typing.Union[_IResolvable_da3f097b, CfnService.DeploymentControllerProperty]]:
|
|
12294
12814
|
'''The deployment controller to use for the service.
|
|
12295
12815
|
|
|
12296
|
-
If no deployment controller is specified, the default value of ``ECS`` is used.
|
|
12297
|
-
|
|
12298
12816
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-deploymentcontroller
|
|
12299
12817
|
'''
|
|
12300
12818
|
result = self._values.get("deployment_controller")
|
|
@@ -12321,7 +12839,7 @@ class CfnServiceProps:
|
|
|
12321
12839
|
|
|
12322
12840
|
For more information, see `Tagging your Amazon ECS resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ in the *Amazon Elastic Container Service Developer Guide* .
|
|
12323
12841
|
|
|
12324
|
-
When you use Amazon ECS managed tags, you
|
|
12842
|
+
When you use Amazon ECS managed tags, you must set the ``propagateTags`` request parameter.
|
|
12325
12843
|
|
|
12326
12844
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-enableecsmanagedtags
|
|
12327
12845
|
'''
|
|
@@ -27367,34 +27885,28 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
27367
27885
|
|
|
27368
27886
|
# cluster: ecs.Cluster
|
|
27369
27887
|
# task_definition: ecs.TaskDefinition
|
|
27888
|
+
# elb_alarm: cw.Alarm
|
|
27889
|
+
|
|
27370
27890
|
|
|
27371
|
-
service_name = "MyFargateService"
|
|
27372
27891
|
service = ecs.FargateService(self, "Service",
|
|
27373
|
-
service_name=service_name,
|
|
27374
27892
|
cluster=cluster,
|
|
27375
27893
|
task_definition=task_definition,
|
|
27376
|
-
min_healthy_percent=100
|
|
27894
|
+
min_healthy_percent=100,
|
|
27895
|
+
deployment_alarms=ecs.DeploymentAlarmConfig(
|
|
27896
|
+
alarm_names=[elb_alarm.alarm_name],
|
|
27897
|
+
behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
|
|
27898
|
+
)
|
|
27377
27899
|
)
|
|
27378
27900
|
|
|
27379
|
-
|
|
27380
|
-
|
|
27381
|
-
|
|
27382
|
-
|
|
27383
|
-
|
|
27384
|
-
dimensions_map={
|
|
27385
|
-
"ClusterName": cluster.cluster_name,
|
|
27386
|
-
# Using `service.serviceName` here will cause a circular dependency
|
|
27387
|
-
"ServiceName": service_name
|
|
27388
|
-
}
|
|
27389
|
-
)
|
|
27390
|
-
my_alarm = cw.Alarm(self, "CPUAlarm",
|
|
27391
|
-
alarm_name="cpuAlarmName",
|
|
27392
|
-
metric=cpu_metric,
|
|
27901
|
+
# Defining a deployment alarm after the service has been created
|
|
27902
|
+
cpu_alarm_name = "MyCpuMetricAlarm"
|
|
27903
|
+
cw.Alarm(self, "CPUAlarm",
|
|
27904
|
+
alarm_name=cpu_alarm_name,
|
|
27905
|
+
metric=service.metric_cpu_utilization(),
|
|
27393
27906
|
evaluation_periods=2,
|
|
27394
27907
|
threshold=80
|
|
27395
27908
|
)
|
|
27396
|
-
|
|
27397
|
-
service.enable_deployment_alarms([my_alarm.alarm_name],
|
|
27909
|
+
service.enable_deployment_alarms([cpu_alarm_name],
|
|
27398
27910
|
behavior=ecs.AlarmBehavior.FAIL_ON_ALARM
|
|
27399
27911
|
)
|
|
27400
27912
|
'''
|
|
@@ -33477,11 +33989,7 @@ class NetworkMode(enum.Enum):
|
|
|
33477
33989
|
single container instance when port mappings are used.
|
|
33478
33990
|
'''
|
|
33479
33991
|
NAT = "NAT"
|
|
33480
|
-
'''The task utilizes
|
|
33481
|
-
|
|
33482
|
-
This is the only supported network mode for Windows containers. For more information, see
|
|
33483
|
-
`Task Definition Parameters <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#network_mode>`_.
|
|
33484
|
-
'''
|
|
33992
|
+
'''The task utilizes Docker's built-in virtual network which runs inside each Windows container instance.'''
|
|
33485
33993
|
|
|
33486
33994
|
|
|
33487
33995
|
class OperatingSystemFamily(
|
|
@@ -33577,6 +34085,18 @@ class OperatingSystemFamily(
|
|
|
33577
34085
|
'''WINDOWS_SERVER_2022_FULL.'''
|
|
33578
34086
|
return typing.cast("OperatingSystemFamily", jsii.sget(cls, "WINDOWS_SERVER_2022_FULL"))
|
|
33579
34087
|
|
|
34088
|
+
@jsii.python.classproperty
|
|
34089
|
+
@jsii.member(jsii_name="WINDOWS_SERVER_2025_CORE")
|
|
34090
|
+
def WINDOWS_SERVER_2025_CORE(cls) -> "OperatingSystemFamily":
|
|
34091
|
+
'''WINDOWS_SERVER_2025_CORE.'''
|
|
34092
|
+
return typing.cast("OperatingSystemFamily", jsii.sget(cls, "WINDOWS_SERVER_2025_CORE"))
|
|
34093
|
+
|
|
34094
|
+
@jsii.python.classproperty
|
|
34095
|
+
@jsii.member(jsii_name="WINDOWS_SERVER_2025_FULL")
|
|
34096
|
+
def WINDOWS_SERVER_2025_FULL(cls) -> "OperatingSystemFamily":
|
|
34097
|
+
'''WINDOWS_SERVER_2025_FULL.'''
|
|
34098
|
+
return typing.cast("OperatingSystemFamily", jsii.sget(cls, "WINDOWS_SERVER_2025_FULL"))
|
|
34099
|
+
|
|
33580
34100
|
@jsii.python.classproperty
|
|
33581
34101
|
@jsii.member(jsii_name="WINDOWS_SERVER_20H2_CORE")
|
|
33582
34102
|
def WINDOWS_SERVER_20_H2_CORE(cls) -> "OperatingSystemFamily":
|
|
@@ -39389,6 +39909,7 @@ class VolumeFrom:
|
|
|
39389
39909
|
class WindowsOptimizedVersion(enum.Enum):
|
|
39390
39910
|
'''ECS-optimized Windows version list.'''
|
|
39391
39911
|
|
|
39912
|
+
SERVER_2025 = "SERVER_2025"
|
|
39392
39913
|
SERVER_2022 = "SERVER_2022"
|
|
39393
39914
|
SERVER_2019 = "SERVER_2019"
|
|
39394
39915
|
SERVER_2016 = "SERVER_2016"
|
|
@@ -42904,34 +43425,28 @@ class FargateService(
|
|
|
42904
43425
|
|
|
42905
43426
|
# cluster: ecs.Cluster
|
|
42906
43427
|
# task_definition: ecs.TaskDefinition
|
|
43428
|
+
# elb_alarm: cw.Alarm
|
|
43429
|
+
|
|
42907
43430
|
|
|
42908
|
-
service_name = "MyFargateService"
|
|
42909
43431
|
service = ecs.FargateService(self, "Service",
|
|
42910
|
-
service_name=service_name,
|
|
42911
43432
|
cluster=cluster,
|
|
42912
43433
|
task_definition=task_definition,
|
|
42913
|
-
min_healthy_percent=100
|
|
43434
|
+
min_healthy_percent=100,
|
|
43435
|
+
deployment_alarms=ecs.DeploymentAlarmConfig(
|
|
43436
|
+
alarm_names=[elb_alarm.alarm_name],
|
|
43437
|
+
behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
|
|
43438
|
+
)
|
|
42914
43439
|
)
|
|
42915
43440
|
|
|
42916
|
-
|
|
42917
|
-
|
|
42918
|
-
|
|
42919
|
-
|
|
42920
|
-
|
|
42921
|
-
dimensions_map={
|
|
42922
|
-
"ClusterName": cluster.cluster_name,
|
|
42923
|
-
# Using `service.serviceName` here will cause a circular dependency
|
|
42924
|
-
"ServiceName": service_name
|
|
42925
|
-
}
|
|
42926
|
-
)
|
|
42927
|
-
my_alarm = cw.Alarm(self, "CPUAlarm",
|
|
42928
|
-
alarm_name="cpuAlarmName",
|
|
42929
|
-
metric=cpu_metric,
|
|
43441
|
+
# Defining a deployment alarm after the service has been created
|
|
43442
|
+
cpu_alarm_name = "MyCpuMetricAlarm"
|
|
43443
|
+
cw.Alarm(self, "CPUAlarm",
|
|
43444
|
+
alarm_name=cpu_alarm_name,
|
|
43445
|
+
metric=service.metric_cpu_utilization(),
|
|
42930
43446
|
evaluation_periods=2,
|
|
42931
43447
|
threshold=80
|
|
42932
43448
|
)
|
|
42933
|
-
|
|
42934
|
-
service.enable_deployment_alarms([my_alarm.alarm_name],
|
|
43449
|
+
service.enable_deployment_alarms([cpu_alarm_name],
|
|
42935
43450
|
behavior=ecs.AlarmBehavior.FAIL_ON_ALARM
|
|
42936
43451
|
)
|
|
42937
43452
|
'''
|
|
@@ -44294,6 +44809,16 @@ def _typecheckingstub__e2af64fb9defca157f1246b9e5c27f87c21cd5930eb232ddeb8f17161
|
|
|
44294
44809
|
"""Type checking stubs"""
|
|
44295
44810
|
pass
|
|
44296
44811
|
|
|
44812
|
+
def _typecheckingstub__c3f25e48977935912f7b78499d7be554157bd31ec2fadc2d811e82880622bfdf(
|
|
44813
|
+
*,
|
|
44814
|
+
alternate_target_group_arn: builtins.str,
|
|
44815
|
+
production_listener_rule: typing.Optional[builtins.str] = None,
|
|
44816
|
+
role_arn: typing.Optional[builtins.str] = None,
|
|
44817
|
+
test_listener_rule: typing.Optional[builtins.str] = None,
|
|
44818
|
+
) -> None:
|
|
44819
|
+
"""Type checking stubs"""
|
|
44820
|
+
pass
|
|
44821
|
+
|
|
44297
44822
|
def _typecheckingstub__40010db1fb42b63f942b5b11b7277545c2a1bffc42369636da9c14f813a744c5(
|
|
44298
44823
|
*,
|
|
44299
44824
|
assign_public_ip: typing.Optional[builtins.str] = None,
|
|
@@ -44332,9 +44857,12 @@ def _typecheckingstub__b2dbcb552902e6050bf0a575d5654d1d6ff74c24d93692dd2b9a98d50
|
|
|
44332
44857
|
def _typecheckingstub__d809d14e704a11675cbface3b43579e5f8f2a29c9b48e27608c625a3f01cb3a6(
|
|
44333
44858
|
*,
|
|
44334
44859
|
alarms: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Union[CfnService.DeploymentAlarmsProperty, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
44860
|
+
bake_time_in_minutes: typing.Optional[jsii.Number] = None,
|
|
44335
44861
|
deployment_circuit_breaker: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Union[CfnService.DeploymentCircuitBreakerProperty, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
44862
|
+
lifecycle_hooks: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Sequence[typing.Union[_IResolvable_da3f097b, typing.Union[CfnService.DeploymentLifecycleHookProperty, typing.Dict[builtins.str, typing.Any]]]]]] = None,
|
|
44336
44863
|
maximum_percent: typing.Optional[jsii.Number] = None,
|
|
44337
44864
|
minimum_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
44865
|
+
strategy: typing.Optional[builtins.str] = None,
|
|
44338
44866
|
) -> None:
|
|
44339
44867
|
"""Type checking stubs"""
|
|
44340
44868
|
pass
|
|
@@ -44346,6 +44874,15 @@ def _typecheckingstub__e9921934df7686d8808e649b9ab979d2747a6f8cba336af2424f59783
|
|
|
44346
44874
|
"""Type checking stubs"""
|
|
44347
44875
|
pass
|
|
44348
44876
|
|
|
44877
|
+
def _typecheckingstub__81d51cf744a434ad2ba13fc9f3dea23611c28b28f4a9414d8324cf57768cea5e(
|
|
44878
|
+
*,
|
|
44879
|
+
hook_target_arn: builtins.str,
|
|
44880
|
+
lifecycle_stages: typing.Sequence[builtins.str],
|
|
44881
|
+
role_arn: builtins.str,
|
|
44882
|
+
) -> None:
|
|
44883
|
+
"""Type checking stubs"""
|
|
44884
|
+
pass
|
|
44885
|
+
|
|
44349
44886
|
def _typecheckingstub__ac73ec1d9d94d0e545ad276e88baeb61d67c664fed33ac2082b94f93d579944d(
|
|
44350
44887
|
*,
|
|
44351
44888
|
resource_type: builtins.str,
|
|
@@ -44357,6 +44894,7 @@ def _typecheckingstub__ac73ec1d9d94d0e545ad276e88baeb61d67c664fed33ac2082b94f93d
|
|
|
44357
44894
|
|
|
44358
44895
|
def _typecheckingstub__251c3999c1586967f7c9091782e6a113831e05b5f853b910cad8c8e75f654def(
|
|
44359
44896
|
*,
|
|
44897
|
+
advanced_configuration: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Union[CfnService.AdvancedConfigurationProperty, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
44360
44898
|
container_name: typing.Optional[builtins.str] = None,
|
|
44361
44899
|
container_port: typing.Optional[jsii.Number] = None,
|
|
44362
44900
|
load_balancer_name: typing.Optional[builtins.str] = None,
|
|
@@ -44409,6 +44947,7 @@ def _typecheckingstub__7552e3d2b970cfb26552bec096b0680acf8bc8c7b59096bbf5a210dd3
|
|
|
44409
44947
|
*,
|
|
44410
44948
|
port: jsii.Number,
|
|
44411
44949
|
dns_name: typing.Optional[builtins.str] = None,
|
|
44950
|
+
test_traffic_rules: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Union[CfnService.ServiceConnectTestTrafficRulesProperty, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
44412
44951
|
) -> None:
|
|
44413
44952
|
"""Type checking stubs"""
|
|
44414
44953
|
pass
|
|
@@ -44435,6 +44974,28 @@ def _typecheckingstub__047411a3798b037ac5ad218c8ed5492e98c896db58ad86ac1acde082c
|
|
|
44435
44974
|
"""Type checking stubs"""
|
|
44436
44975
|
pass
|
|
44437
44976
|
|
|
44977
|
+
def _typecheckingstub__95be6c123aaeddaea0658f43268bed3cd0c9fdafbb6f8eb86f2cfa3ece72131e(
|
|
44978
|
+
*,
|
|
44979
|
+
name: builtins.str,
|
|
44980
|
+
value: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Union[CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
44981
|
+
) -> None:
|
|
44982
|
+
"""Type checking stubs"""
|
|
44983
|
+
pass
|
|
44984
|
+
|
|
44985
|
+
def _typecheckingstub__00399c48ee323c2a3961b9504adf57d82b84cf123d2dd023433fc918ac78282f(
|
|
44986
|
+
*,
|
|
44987
|
+
exact: builtins.str,
|
|
44988
|
+
) -> None:
|
|
44989
|
+
"""Type checking stubs"""
|
|
44990
|
+
pass
|
|
44991
|
+
|
|
44992
|
+
def _typecheckingstub__38ae0ce4b02d72c8b4b7583b571baf645aed5c2d7b9e970baefceb7ffc5abed3(
|
|
44993
|
+
*,
|
|
44994
|
+
header: typing.Union[_IResolvable_da3f097b, typing.Union[CfnService.ServiceConnectTestTrafficRulesHeaderProperty, typing.Dict[builtins.str, typing.Any]]],
|
|
44995
|
+
) -> None:
|
|
44996
|
+
"""Type checking stubs"""
|
|
44997
|
+
pass
|
|
44998
|
+
|
|
44438
44999
|
def _typecheckingstub__aced8e4b81fd8cb9c6f67cef173bec4d0f64dc88e3c16ebc23350b833639b2e1(
|
|
44439
45000
|
*,
|
|
44440
45001
|
aws_pca_authority_arn: typing.Optional[builtins.str] = None,
|