aws-cdk-lib 2.210.0__py3-none-any.whl → 2.212.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 +404 -54
- aws_cdk/_jsii/__init__.py +1 -1
- aws_cdk/_jsii/{aws-cdk-lib@2.210.0.jsii.tgz → aws-cdk-lib@2.212.0.jsii.tgz} +0 -0
- aws_cdk/aws_amazonmq/__init__.py +2 -1
- aws_cdk/aws_apigateway/__init__.py +2 -0
- aws_cdk/aws_apigatewayv2/__init__.py +1798 -74
- aws_cdk/aws_appconfig/__init__.py +9 -0
- aws_cdk/aws_appintegrations/__init__.py +395 -0
- aws_cdk/aws_arcregionswitch/__init__.py +5080 -0
- aws_cdk/aws_athena/__init__.py +23 -19
- aws_cdk/aws_autoscaling/__init__.py +6 -6
- aws_cdk/aws_batch/__init__.py +725 -55
- aws_cdk/aws_bedrock/__init__.py +18 -0
- aws_cdk/aws_billingconductor/__init__.py +3 -3
- aws_cdk/aws_cassandra/__init__.py +28 -1
- aws_cdk/aws_cloudfront/__init__.py +39 -8
- aws_cdk/aws_codebuild/__init__.py +122 -0
- aws_cdk/aws_codepipeline/__init__.py +51 -50
- aws_cdk/aws_cognito/__init__.py +9 -2
- aws_cdk/aws_connect/__init__.py +40 -15
- aws_cdk/aws_datazone/__init__.py +118 -77
- aws_cdk/aws_dax/__init__.py +39 -0
- aws_cdk/aws_deadline/__init__.py +166 -7
- aws_cdk/aws_docdb/__init__.py +20 -11
- aws_cdk/aws_dynamodb/__init__.py +246 -36
- aws_cdk/aws_ec2/__init__.py +1044 -111
- aws_cdk/aws_ecr/__init__.py +274 -0
- aws_cdk/aws_ecs/__init__.py +1637 -137
- aws_cdk/aws_eks/__init__.py +53 -3
- aws_cdk/aws_elasticloadbalancingv2/__init__.py +31 -17
- aws_cdk/aws_entityresolution/__init__.py +240 -45
- aws_cdk/aws_evs/__init__.py +20 -45
- aws_cdk/aws_gameliftstreams/__init__.py +7 -6
- aws_cdk/aws_glue/__init__.py +18 -9
- aws_cdk/aws_guardduty/__init__.py +1233 -113
- aws_cdk/aws_imagebuilder/__init__.py +34 -20
- aws_cdk/aws_inspectorv2/__init__.py +1516 -0
- aws_cdk/aws_iot/__init__.py +387 -0
- aws_cdk/aws_iotsitewise/__init__.py +1247 -139
- aws_cdk/aws_ivs/__init__.py +443 -33
- aws_cdk/aws_kinesisfirehose/__init__.py +2 -0
- aws_cdk/aws_lakeformation/__init__.py +1 -1
- aws_cdk/aws_lambda/__init__.py +9 -9
- aws_cdk/aws_lightsail/__init__.py +590 -0
- aws_cdk/aws_logs/__init__.py +97 -3
- aws_cdk/aws_medialive/__init__.py +270 -7
- aws_cdk/aws_mediapackagev2/__init__.py +204 -6
- aws_cdk/aws_neptune/__init__.py +41 -2
- aws_cdk/aws_networkfirewall/__init__.py +490 -134
- aws_cdk/aws_observabilityadmin/__init__.py +1468 -0
- aws_cdk/aws_omics/__init__.py +1 -1
- aws_cdk/aws_opensearchserverless/__init__.py +2 -2
- aws_cdk/aws_opensearchservice/__init__.py +128 -0
- aws_cdk/aws_opsworks/__init__.py +125 -125
- aws_cdk/aws_opsworkscm/__init__.py +1 -53
- aws_cdk/aws_pcs/__init__.py +49 -5
- aws_cdk/aws_qbusiness/__init__.py +3 -3
- aws_cdk/aws_quicksight/__init__.py +188 -83
- aws_cdk/aws_rds/__init__.py +245 -103
- aws_cdk/aws_s3/__init__.py +56 -1
- aws_cdk/aws_s3express/__init__.py +56 -1
- aws_cdk/aws_s3tables/__init__.py +2 -2
- aws_cdk/aws_sagemaker/__init__.py +4080 -223
- aws_cdk/aws_ses/__init__.py +172 -9
- aws_cdk/aws_sqs/__init__.py +4 -3
- aws_cdk/aws_ssm/__init__.py +8 -4
- aws_cdk/aws_stepfunctions_tasks/__init__.py +16 -9
- aws_cdk/aws_synthetics/__init__.py +116 -0
- aws_cdk/aws_verifiedpermissions/__init__.py +23 -2
- aws_cdk/aws_wisdom/__init__.py +2 -2
- aws_cdk/aws_workspacesweb/__init__.py +949 -157
- aws_cdk/cx_api/__init__.py +22 -0
- {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/METADATA +335 -15
- {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/RECORD +78 -76
- {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/LICENSE +0 -0
- {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/NOTICE +0 -0
- {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/WHEEL +0 -0
- {aws_cdk_lib-2.210.0.dist-info → aws_cdk_lib-2.212.0.dist-info}/top_level.txt +0 -0
aws_cdk/aws_ecs/__init__.py
CHANGED
|
@@ -2118,87 +2118,38 @@ Amazon ECS supports native blue/green deployments that allow you to deploy new v
|
|
|
2118
2118
|
|
|
2119
2119
|
[Amazon ECS blue/green deployments](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-blue-green.html)
|
|
2120
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
2121
|
```python
|
|
2152
|
-
|
|
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
|
|
2122
|
+
import aws_cdk.aws_lambda as lambda_
|
|
2170
2123
|
|
|
2171
|
-
Configure test traffic routing for Service Connect during blue/green deployments:
|
|
2172
|
-
|
|
2173
|
-
```python
|
|
2174
2124
|
# cluster: ecs.Cluster
|
|
2175
2125
|
# task_definition: ecs.TaskDefinition
|
|
2126
|
+
# lambda_hook: lambda.Function
|
|
2127
|
+
# blue_target_group: elbv2.ApplicationTargetGroup
|
|
2128
|
+
# green_target_group: elbv2.ApplicationTargetGroup
|
|
2129
|
+
# prod_listener_rule: elbv2.ApplicationListenerRule
|
|
2176
2130
|
|
|
2177
2131
|
|
|
2178
2132
|
service = ecs.FargateService(self, "Service",
|
|
2179
2133
|
cluster=cluster,
|
|
2180
|
-
task_definition=task_definition
|
|
2134
|
+
task_definition=task_definition,
|
|
2135
|
+
deployment_strategy=ecs.DeploymentStrategy.BLUE_GREEN
|
|
2181
2136
|
)
|
|
2182
2137
|
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
exact="beta-version"
|
|
2196
|
-
)
|
|
2197
|
-
)
|
|
2198
|
-
)
|
|
2199
|
-
)]
|
|
2200
|
-
)]
|
|
2138
|
+
service.add_lifecycle_hook(ecs.DeploymentLifecycleLambdaTarget(lambda_hook, "PreScaleHook",
|
|
2139
|
+
lifecycle_stages=[ecs.DeploymentLifecycleStage.PRE_SCALE_UP]
|
|
2140
|
+
))
|
|
2141
|
+
|
|
2142
|
+
target = service.load_balancer_target(
|
|
2143
|
+
container_name="nginx",
|
|
2144
|
+
container_port=80,
|
|
2145
|
+
protocol=ecs.Protocol.TCP,
|
|
2146
|
+
alternate_target=ecs.AlternateTarget("AlternateTarget",
|
|
2147
|
+
alternate_target_group=green_target_group,
|
|
2148
|
+
production_listener=ecs.ListenerRuleConfiguration.application_listener_rule(prod_listener_rule)
|
|
2149
|
+
)
|
|
2201
2150
|
)
|
|
2151
|
+
|
|
2152
|
+
target.attach_to_application_target_group(blue_target_group)
|
|
2202
2153
|
```
|
|
2203
2154
|
|
|
2204
2155
|
## Daemon Scheduling Strategy
|
|
@@ -2338,6 +2289,7 @@ from ..aws_elasticloadbalancingv2 import (
|
|
|
2338
2289
|
AddApplicationTargetsProps as _AddApplicationTargetsProps_76c7d190,
|
|
2339
2290
|
AddNetworkTargetsProps as _AddNetworkTargetsProps_ce6bdf17,
|
|
2340
2291
|
ApplicationListener as _ApplicationListener_e0620bf5,
|
|
2292
|
+
ApplicationListenerRule as _ApplicationListenerRule_f93ff606,
|
|
2341
2293
|
ApplicationProtocol as _ApplicationProtocol_aa5e9f29,
|
|
2342
2294
|
ApplicationProtocolVersion as _ApplicationProtocolVersion_dddfe47b,
|
|
2343
2295
|
ApplicationTargetGroup as _ApplicationTargetGroup_906fe365,
|
|
@@ -2346,6 +2298,7 @@ from ..aws_elasticloadbalancingv2 import (
|
|
|
2346
2298
|
IApplicationTargetGroup as _IApplicationTargetGroup_57799827,
|
|
2347
2299
|
INetworkLoadBalancerTarget as _INetworkLoadBalancerTarget_688b169f,
|
|
2348
2300
|
INetworkTargetGroup as _INetworkTargetGroup_abca2df7,
|
|
2301
|
+
ITargetGroup as _ITargetGroup_83c6f8c4,
|
|
2349
2302
|
ListenerCondition as _ListenerCondition_e8416430,
|
|
2350
2303
|
LoadBalancerTargetProps as _LoadBalancerTargetProps_4c30a73c,
|
|
2351
2304
|
NetworkListener as _NetworkListener_539c17bf,
|
|
@@ -2359,6 +2312,7 @@ from ..aws_iam import (
|
|
|
2359
2312
|
PolicyStatement as _PolicyStatement_0fe33853,
|
|
2360
2313
|
)
|
|
2361
2314
|
from ..aws_kms import IKey as _IKey_5f11635f
|
|
2315
|
+
from ..aws_lambda import IFunction as _IFunction_6adb0ab8
|
|
2362
2316
|
from ..aws_logs import (
|
|
2363
2317
|
ILogGroup as _ILogGroup_3c4fa718, RetentionDays as _RetentionDays_070f99f0
|
|
2364
2318
|
)
|
|
@@ -2605,7 +2559,7 @@ class AddCapacityOptions(
|
|
|
2605
2559
|
:param key_name: (deprecated) Name of SSH keypair to grant access to instances. ``launchTemplate`` and ``mixedInstancesPolicy`` must not be specified when this property is specified You can either specify ``keyPair`` or ``keyName``, not both. Default: - No SSH access will be possible.
|
|
2606
2560
|
:param key_pair: The SSH keypair to grant access to the instance. Feature flag ``AUTOSCALING_GENERATE_LAUNCH_TEMPLATE`` must be enabled to use this property. ``launchTemplate`` and ``mixedInstancesPolicy`` must not be specified when this property is specified. You can either specify ``keyPair`` or ``keyName``, not both. Default: - No SSH access will be possible.
|
|
2607
2561
|
:param max_capacity: Maximum number of instances in the fleet. Default: desiredCapacity
|
|
2608
|
-
:param max_instance_lifetime: The maximum amount of time that an instance can be in service. The maximum duration applies to all current and future instances in the group. As an instance approaches its maximum duration, it is terminated and replaced, and cannot be used again. You must specify a value of at least
|
|
2562
|
+
:param max_instance_lifetime: The maximum amount of time that an instance can be in service. The maximum duration applies to all current and future instances in the group. As an instance approaches its maximum duration, it is terminated and replaced, and cannot be used again. You must specify a value of at least 86,400 seconds (one day). To clear a previously set value, leave this property undefined. Default: none
|
|
2609
2563
|
:param min_capacity: Minimum number of instances in the fleet. Default: 1
|
|
2610
2564
|
:param new_instances_protected_from_scale_in: Whether newly-launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. By default, Auto Scaling can terminate an instance at any time after launch when scaling in an Auto Scaling Group, subject to the group's termination policy. However, you may wish to protect newly-launched instances from being scaled in if they are going to run critical applications that should not be prematurely terminated. This flag must be enabled if the Auto Scaling Group will be associated with an ECS Capacity Provider with managed termination protection. Default: false
|
|
2611
2565
|
:param notifications: Configure autoscaling group to send notifications about fleet changes to an SNS topic(s). Default: - No fleet change notifications will be sent.
|
|
@@ -3027,7 +2981,7 @@ class AddCapacityOptions(
|
|
|
3027
2981
|
to all current and future instances in the group. As an instance approaches its maximum duration,
|
|
3028
2982
|
it is terminated and replaced, and cannot be used again.
|
|
3029
2983
|
|
|
3030
|
-
You must specify a value of at least
|
|
2984
|
+
You must specify a value of at least 86,400 seconds (one day). To clear a previously set value,
|
|
3031
2985
|
leave this property undefined.
|
|
3032
2986
|
|
|
3033
2987
|
:default: none
|
|
@@ -3286,6 +3240,306 @@ class AlarmBehavior(enum.Enum):
|
|
|
3286
3240
|
'''
|
|
3287
3241
|
|
|
3288
3242
|
|
|
3243
|
+
@jsii.data_type(
|
|
3244
|
+
jsii_type="aws-cdk-lib.aws_ecs.AlternateTargetConfig",
|
|
3245
|
+
jsii_struct_bases=[],
|
|
3246
|
+
name_mapping={
|
|
3247
|
+
"alternate_target_group_arn": "alternateTargetGroupArn",
|
|
3248
|
+
"role_arn": "roleArn",
|
|
3249
|
+
"production_listener_rule": "productionListenerRule",
|
|
3250
|
+
"test_listener_rule": "testListenerRule",
|
|
3251
|
+
},
|
|
3252
|
+
)
|
|
3253
|
+
class AlternateTargetConfig:
|
|
3254
|
+
def __init__(
|
|
3255
|
+
self,
|
|
3256
|
+
*,
|
|
3257
|
+
alternate_target_group_arn: builtins.str,
|
|
3258
|
+
role_arn: builtins.str,
|
|
3259
|
+
production_listener_rule: typing.Optional[builtins.str] = None,
|
|
3260
|
+
test_listener_rule: typing.Optional[builtins.str] = None,
|
|
3261
|
+
) -> None:
|
|
3262
|
+
'''Configuration returned by AlternateTargetConfiguration.bind().
|
|
3263
|
+
|
|
3264
|
+
:param alternate_target_group_arn: The ARN of the alternate target group.
|
|
3265
|
+
:param role_arn: The IAM role ARN for the configuration. Default: - a new role will be created
|
|
3266
|
+
:param production_listener_rule: The production listener rule ARN (ALB) or listener ARN (NLB). Default: - none
|
|
3267
|
+
:param test_listener_rule: The test listener rule ARN (ALB) or listener ARN (NLB). Default: - none
|
|
3268
|
+
|
|
3269
|
+
:exampleMetadata: fixture=_generated
|
|
3270
|
+
|
|
3271
|
+
Example::
|
|
3272
|
+
|
|
3273
|
+
# The code below shows an example of how to instantiate this type.
|
|
3274
|
+
# The values are placeholders you should change.
|
|
3275
|
+
from aws_cdk import aws_ecs as ecs
|
|
3276
|
+
|
|
3277
|
+
alternate_target_config = ecs.AlternateTargetConfig(
|
|
3278
|
+
alternate_target_group_arn="alternateTargetGroupArn",
|
|
3279
|
+
role_arn="roleArn",
|
|
3280
|
+
|
|
3281
|
+
# the properties below are optional
|
|
3282
|
+
production_listener_rule="productionListenerRule",
|
|
3283
|
+
test_listener_rule="testListenerRule"
|
|
3284
|
+
)
|
|
3285
|
+
'''
|
|
3286
|
+
if __debug__:
|
|
3287
|
+
type_hints = typing.get_type_hints(_typecheckingstub__792a358f64361d957b07e1ed7f1116dd993837c77bffc674ebb1385615159cd7)
|
|
3288
|
+
check_type(argname="argument alternate_target_group_arn", value=alternate_target_group_arn, expected_type=type_hints["alternate_target_group_arn"])
|
|
3289
|
+
check_type(argname="argument role_arn", value=role_arn, expected_type=type_hints["role_arn"])
|
|
3290
|
+
check_type(argname="argument production_listener_rule", value=production_listener_rule, expected_type=type_hints["production_listener_rule"])
|
|
3291
|
+
check_type(argname="argument test_listener_rule", value=test_listener_rule, expected_type=type_hints["test_listener_rule"])
|
|
3292
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
3293
|
+
"alternate_target_group_arn": alternate_target_group_arn,
|
|
3294
|
+
"role_arn": role_arn,
|
|
3295
|
+
}
|
|
3296
|
+
if production_listener_rule is not None:
|
|
3297
|
+
self._values["production_listener_rule"] = production_listener_rule
|
|
3298
|
+
if test_listener_rule is not None:
|
|
3299
|
+
self._values["test_listener_rule"] = test_listener_rule
|
|
3300
|
+
|
|
3301
|
+
@builtins.property
|
|
3302
|
+
def alternate_target_group_arn(self) -> builtins.str:
|
|
3303
|
+
'''The ARN of the alternate target group.'''
|
|
3304
|
+
result = self._values.get("alternate_target_group_arn")
|
|
3305
|
+
assert result is not None, "Required property 'alternate_target_group_arn' is missing"
|
|
3306
|
+
return typing.cast(builtins.str, result)
|
|
3307
|
+
|
|
3308
|
+
@builtins.property
|
|
3309
|
+
def role_arn(self) -> builtins.str:
|
|
3310
|
+
'''The IAM role ARN for the configuration.
|
|
3311
|
+
|
|
3312
|
+
:default: - a new role will be created
|
|
3313
|
+
'''
|
|
3314
|
+
result = self._values.get("role_arn")
|
|
3315
|
+
assert result is not None, "Required property 'role_arn' is missing"
|
|
3316
|
+
return typing.cast(builtins.str, result)
|
|
3317
|
+
|
|
3318
|
+
@builtins.property
|
|
3319
|
+
def production_listener_rule(self) -> typing.Optional[builtins.str]:
|
|
3320
|
+
'''The production listener rule ARN (ALB) or listener ARN (NLB).
|
|
3321
|
+
|
|
3322
|
+
:default: - none
|
|
3323
|
+
'''
|
|
3324
|
+
result = self._values.get("production_listener_rule")
|
|
3325
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
3326
|
+
|
|
3327
|
+
@builtins.property
|
|
3328
|
+
def test_listener_rule(self) -> typing.Optional[builtins.str]:
|
|
3329
|
+
'''The test listener rule ARN (ALB) or listener ARN (NLB).
|
|
3330
|
+
|
|
3331
|
+
:default: - none
|
|
3332
|
+
'''
|
|
3333
|
+
result = self._values.get("test_listener_rule")
|
|
3334
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
3335
|
+
|
|
3336
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
3337
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
3338
|
+
|
|
3339
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
3340
|
+
return not (rhs == self)
|
|
3341
|
+
|
|
3342
|
+
def __repr__(self) -> str:
|
|
3343
|
+
return "AlternateTargetConfig(%s)" % ", ".join(
|
|
3344
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
3345
|
+
)
|
|
3346
|
+
|
|
3347
|
+
|
|
3348
|
+
@jsii.data_type(
|
|
3349
|
+
jsii_type="aws-cdk-lib.aws_ecs.AlternateTargetOptions",
|
|
3350
|
+
jsii_struct_bases=[],
|
|
3351
|
+
name_mapping={"role": "role", "test_listener": "testListener"},
|
|
3352
|
+
)
|
|
3353
|
+
class AlternateTargetOptions:
|
|
3354
|
+
def __init__(
|
|
3355
|
+
self,
|
|
3356
|
+
*,
|
|
3357
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
3358
|
+
test_listener: typing.Optional["ListenerRuleConfiguration"] = None,
|
|
3359
|
+
) -> None:
|
|
3360
|
+
'''Options for AlternateTarget configuration.
|
|
3361
|
+
|
|
3362
|
+
:param role: The IAM role for the configuration. Default: - a new role will be created
|
|
3363
|
+
:param test_listener: The test listener configuration. Default: - none
|
|
3364
|
+
|
|
3365
|
+
:exampleMetadata: fixture=_generated
|
|
3366
|
+
|
|
3367
|
+
Example::
|
|
3368
|
+
|
|
3369
|
+
# The code below shows an example of how to instantiate this type.
|
|
3370
|
+
# The values are placeholders you should change.
|
|
3371
|
+
from aws_cdk import aws_ecs as ecs
|
|
3372
|
+
from aws_cdk import aws_iam as iam
|
|
3373
|
+
|
|
3374
|
+
# listener_rule_configuration: ecs.ListenerRuleConfiguration
|
|
3375
|
+
# role: iam.Role
|
|
3376
|
+
|
|
3377
|
+
alternate_target_options = ecs.AlternateTargetOptions(
|
|
3378
|
+
role=role,
|
|
3379
|
+
test_listener=listener_rule_configuration
|
|
3380
|
+
)
|
|
3381
|
+
'''
|
|
3382
|
+
if __debug__:
|
|
3383
|
+
type_hints = typing.get_type_hints(_typecheckingstub__419cc917bedbbd0a41ca044bcc54720f5a35bdc4f2dca6e11ae40da3ed05758d)
|
|
3384
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
3385
|
+
check_type(argname="argument test_listener", value=test_listener, expected_type=type_hints["test_listener"])
|
|
3386
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
3387
|
+
if role is not None:
|
|
3388
|
+
self._values["role"] = role
|
|
3389
|
+
if test_listener is not None:
|
|
3390
|
+
self._values["test_listener"] = test_listener
|
|
3391
|
+
|
|
3392
|
+
@builtins.property
|
|
3393
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
3394
|
+
'''The IAM role for the configuration.
|
|
3395
|
+
|
|
3396
|
+
:default: - a new role will be created
|
|
3397
|
+
'''
|
|
3398
|
+
result = self._values.get("role")
|
|
3399
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
3400
|
+
|
|
3401
|
+
@builtins.property
|
|
3402
|
+
def test_listener(self) -> typing.Optional["ListenerRuleConfiguration"]:
|
|
3403
|
+
'''The test listener configuration.
|
|
3404
|
+
|
|
3405
|
+
:default: - none
|
|
3406
|
+
'''
|
|
3407
|
+
result = self._values.get("test_listener")
|
|
3408
|
+
return typing.cast(typing.Optional["ListenerRuleConfiguration"], result)
|
|
3409
|
+
|
|
3410
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
3411
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
3412
|
+
|
|
3413
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
3414
|
+
return not (rhs == self)
|
|
3415
|
+
|
|
3416
|
+
def __repr__(self) -> str:
|
|
3417
|
+
return "AlternateTargetOptions(%s)" % ", ".join(
|
|
3418
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
3419
|
+
)
|
|
3420
|
+
|
|
3421
|
+
|
|
3422
|
+
@jsii.data_type(
|
|
3423
|
+
jsii_type="aws-cdk-lib.aws_ecs.AlternateTargetProps",
|
|
3424
|
+
jsii_struct_bases=[AlternateTargetOptions],
|
|
3425
|
+
name_mapping={
|
|
3426
|
+
"role": "role",
|
|
3427
|
+
"test_listener": "testListener",
|
|
3428
|
+
"alternate_target_group": "alternateTargetGroup",
|
|
3429
|
+
"production_listener": "productionListener",
|
|
3430
|
+
},
|
|
3431
|
+
)
|
|
3432
|
+
class AlternateTargetProps(AlternateTargetOptions):
|
|
3433
|
+
def __init__(
|
|
3434
|
+
self,
|
|
3435
|
+
*,
|
|
3436
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
3437
|
+
test_listener: typing.Optional["ListenerRuleConfiguration"] = None,
|
|
3438
|
+
alternate_target_group: _ITargetGroup_83c6f8c4,
|
|
3439
|
+
production_listener: "ListenerRuleConfiguration",
|
|
3440
|
+
) -> None:
|
|
3441
|
+
'''Properties for AlternateTarget configuration.
|
|
3442
|
+
|
|
3443
|
+
:param role: The IAM role for the configuration. Default: - a new role will be created
|
|
3444
|
+
:param test_listener: The test listener configuration. Default: - none
|
|
3445
|
+
:param alternate_target_group: The alternate target group.
|
|
3446
|
+
:param production_listener: The production listener rule ARN (ALB) or listener ARN (NLB).
|
|
3447
|
+
|
|
3448
|
+
:exampleMetadata: infused
|
|
3449
|
+
|
|
3450
|
+
Example::
|
|
3451
|
+
|
|
3452
|
+
import aws_cdk.aws_lambda as lambda_
|
|
3453
|
+
|
|
3454
|
+
# cluster: ecs.Cluster
|
|
3455
|
+
# task_definition: ecs.TaskDefinition
|
|
3456
|
+
# lambda_hook: lambda.Function
|
|
3457
|
+
# blue_target_group: elbv2.ApplicationTargetGroup
|
|
3458
|
+
# green_target_group: elbv2.ApplicationTargetGroup
|
|
3459
|
+
# prod_listener_rule: elbv2.ApplicationListenerRule
|
|
3460
|
+
|
|
3461
|
+
|
|
3462
|
+
service = ecs.FargateService(self, "Service",
|
|
3463
|
+
cluster=cluster,
|
|
3464
|
+
task_definition=task_definition,
|
|
3465
|
+
deployment_strategy=ecs.DeploymentStrategy.BLUE_GREEN
|
|
3466
|
+
)
|
|
3467
|
+
|
|
3468
|
+
service.add_lifecycle_hook(ecs.DeploymentLifecycleLambdaTarget(lambda_hook, "PreScaleHook",
|
|
3469
|
+
lifecycle_stages=[ecs.DeploymentLifecycleStage.PRE_SCALE_UP]
|
|
3470
|
+
))
|
|
3471
|
+
|
|
3472
|
+
target = service.load_balancer_target(
|
|
3473
|
+
container_name="nginx",
|
|
3474
|
+
container_port=80,
|
|
3475
|
+
protocol=ecs.Protocol.TCP,
|
|
3476
|
+
alternate_target=ecs.AlternateTarget("AlternateTarget",
|
|
3477
|
+
alternate_target_group=green_target_group,
|
|
3478
|
+
production_listener=ecs.ListenerRuleConfiguration.application_listener_rule(prod_listener_rule)
|
|
3479
|
+
)
|
|
3480
|
+
)
|
|
3481
|
+
|
|
3482
|
+
target.attach_to_application_target_group(blue_target_group)
|
|
3483
|
+
'''
|
|
3484
|
+
if __debug__:
|
|
3485
|
+
type_hints = typing.get_type_hints(_typecheckingstub__308a285b9e7be7ba49d4d78caf88537a973f5504d7b7519fb1fe4ab1c987b690)
|
|
3486
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
3487
|
+
check_type(argname="argument test_listener", value=test_listener, expected_type=type_hints["test_listener"])
|
|
3488
|
+
check_type(argname="argument alternate_target_group", value=alternate_target_group, expected_type=type_hints["alternate_target_group"])
|
|
3489
|
+
check_type(argname="argument production_listener", value=production_listener, expected_type=type_hints["production_listener"])
|
|
3490
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
3491
|
+
"alternate_target_group": alternate_target_group,
|
|
3492
|
+
"production_listener": production_listener,
|
|
3493
|
+
}
|
|
3494
|
+
if role is not None:
|
|
3495
|
+
self._values["role"] = role
|
|
3496
|
+
if test_listener is not None:
|
|
3497
|
+
self._values["test_listener"] = test_listener
|
|
3498
|
+
|
|
3499
|
+
@builtins.property
|
|
3500
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
3501
|
+
'''The IAM role for the configuration.
|
|
3502
|
+
|
|
3503
|
+
:default: - a new role will be created
|
|
3504
|
+
'''
|
|
3505
|
+
result = self._values.get("role")
|
|
3506
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
3507
|
+
|
|
3508
|
+
@builtins.property
|
|
3509
|
+
def test_listener(self) -> typing.Optional["ListenerRuleConfiguration"]:
|
|
3510
|
+
'''The test listener configuration.
|
|
3511
|
+
|
|
3512
|
+
:default: - none
|
|
3513
|
+
'''
|
|
3514
|
+
result = self._values.get("test_listener")
|
|
3515
|
+
return typing.cast(typing.Optional["ListenerRuleConfiguration"], result)
|
|
3516
|
+
|
|
3517
|
+
@builtins.property
|
|
3518
|
+
def alternate_target_group(self) -> _ITargetGroup_83c6f8c4:
|
|
3519
|
+
'''The alternate target group.'''
|
|
3520
|
+
result = self._values.get("alternate_target_group")
|
|
3521
|
+
assert result is not None, "Required property 'alternate_target_group' is missing"
|
|
3522
|
+
return typing.cast(_ITargetGroup_83c6f8c4, result)
|
|
3523
|
+
|
|
3524
|
+
@builtins.property
|
|
3525
|
+
def production_listener(self) -> "ListenerRuleConfiguration":
|
|
3526
|
+
'''The production listener rule ARN (ALB) or listener ARN (NLB).'''
|
|
3527
|
+
result = self._values.get("production_listener")
|
|
3528
|
+
assert result is not None, "Required property 'production_listener' is missing"
|
|
3529
|
+
return typing.cast("ListenerRuleConfiguration", result)
|
|
3530
|
+
|
|
3531
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
3532
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
3533
|
+
|
|
3534
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
3535
|
+
return not (rhs == self)
|
|
3536
|
+
|
|
3537
|
+
def __repr__(self) -> str:
|
|
3538
|
+
return "AlternateTargetProps(%s)" % ", ".join(
|
|
3539
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
3540
|
+
)
|
|
3541
|
+
|
|
3542
|
+
|
|
3289
3543
|
@jsii.enum(jsii_type="aws-cdk-lib.aws_ecs.AmiHardwareType")
|
|
3290
3544
|
class AmiHardwareType(enum.Enum):
|
|
3291
3545
|
'''The ECS-optimized AMI variant to use.
|
|
@@ -5097,15 +5351,18 @@ class BaseMountPoint:
|
|
|
5097
5351
|
jsii_struct_bases=[],
|
|
5098
5352
|
name_mapping={
|
|
5099
5353
|
"cluster": "cluster",
|
|
5354
|
+
"bake_time": "bakeTime",
|
|
5100
5355
|
"capacity_provider_strategies": "capacityProviderStrategies",
|
|
5101
5356
|
"circuit_breaker": "circuitBreaker",
|
|
5102
5357
|
"cloud_map_options": "cloudMapOptions",
|
|
5103
5358
|
"deployment_alarms": "deploymentAlarms",
|
|
5104
5359
|
"deployment_controller": "deploymentController",
|
|
5360
|
+
"deployment_strategy": "deploymentStrategy",
|
|
5105
5361
|
"desired_count": "desiredCount",
|
|
5106
5362
|
"enable_ecs_managed_tags": "enableECSManagedTags",
|
|
5107
5363
|
"enable_execute_command": "enableExecuteCommand",
|
|
5108
5364
|
"health_check_grace_period": "healthCheckGracePeriod",
|
|
5365
|
+
"lifecycle_hooks": "lifecycleHooks",
|
|
5109
5366
|
"max_healthy_percent": "maxHealthyPercent",
|
|
5110
5367
|
"min_healthy_percent": "minHealthyPercent",
|
|
5111
5368
|
"propagate_tags": "propagateTags",
|
|
@@ -5120,15 +5377,18 @@ class BaseServiceOptions:
|
|
|
5120
5377
|
self,
|
|
5121
5378
|
*,
|
|
5122
5379
|
cluster: "ICluster",
|
|
5380
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
5123
5381
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union["CapacityProviderStrategy", typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
5124
5382
|
circuit_breaker: typing.Optional[typing.Union["DeploymentCircuitBreaker", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
5125
5383
|
cloud_map_options: typing.Optional[typing.Union["CloudMapOptions", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
5126
5384
|
deployment_alarms: typing.Optional[typing.Union["DeploymentAlarmConfig", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
5127
5385
|
deployment_controller: typing.Optional[typing.Union["DeploymentController", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
5386
|
+
deployment_strategy: typing.Optional["DeploymentStrategy"] = None,
|
|
5128
5387
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
5129
5388
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
5130
5389
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
5131
5390
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
5391
|
+
lifecycle_hooks: typing.Optional[typing.Sequence["IDeploymentLifecycleHookTarget"]] = None,
|
|
5132
5392
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
5133
5393
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
5134
5394
|
propagate_tags: typing.Optional["PropagatedTagSource"] = None,
|
|
@@ -5140,15 +5400,18 @@ class BaseServiceOptions:
|
|
|
5140
5400
|
'''The properties for the base Ec2Service or FargateService service.
|
|
5141
5401
|
|
|
5142
5402
|
:param cluster: The name of the cluster that hosts the service.
|
|
5403
|
+
:param bake_time: bake time minutes for service. Default: - none
|
|
5143
5404
|
:param capacity_provider_strategies: A list of Capacity Provider strategies used to place a service. Default: - undefined
|
|
5144
5405
|
:param circuit_breaker: Whether to enable the deployment circuit breaker. If this property is defined, circuit breaker will be implicitly enabled. Default: - disabled
|
|
5145
5406
|
:param cloud_map_options: The options for configuring an Amazon ECS service to use service discovery. Default: - AWS Cloud Map service discovery is not enabled.
|
|
5146
5407
|
:param deployment_alarms: The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. Default: - No alarms will be monitored during deployment.
|
|
5147
5408
|
:param deployment_controller: Specifies which deployment controller to use for the service. For more information, see `Amazon ECS Deployment Types <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html>`_ Default: - Rolling update (ECS)
|
|
5409
|
+
:param deployment_strategy: The deployment strategy to use for the service. Default: ROLLING
|
|
5148
5410
|
:param desired_count: The desired number of instantiations of the task definition to keep running on the service. Default: - When creating the service, default is 1; when updating the service, default uses the current task number.
|
|
5149
5411
|
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging Your Amazon ECS Resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ Default: false
|
|
5150
5412
|
:param enable_execute_command: Whether to enable the ability to execute into a container. Default: - undefined
|
|
5151
5413
|
:param health_check_grace_period: The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set
|
|
5414
|
+
:param lifecycle_hooks: The lifecycle hooks to execute during deployment stages. Default: - none;
|
|
5152
5415
|
:param max_healthy_percent: The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. Default: - 100 if daemon, otherwise 200
|
|
5153
5416
|
:param min_healthy_percent: The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. Default: - 0 if daemon, otherwise 50
|
|
5154
5417
|
:param propagate_tags: Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE Default: PropagatedTagSource.NONE
|
|
@@ -5171,6 +5434,7 @@ class BaseServiceOptions:
|
|
|
5171
5434
|
|
|
5172
5435
|
# cluster: ecs.Cluster
|
|
5173
5436
|
# container_definition: ecs.ContainerDefinition
|
|
5437
|
+
# deployment_lifecycle_hook_target: ecs.IDeploymentLifecycleHookTarget
|
|
5174
5438
|
# key: kms.Key
|
|
5175
5439
|
# log_driver: ecs.LogDriver
|
|
5176
5440
|
# namespace: servicediscovery.INamespace
|
|
@@ -5182,6 +5446,7 @@ class BaseServiceOptions:
|
|
|
5182
5446
|
cluster=cluster,
|
|
5183
5447
|
|
|
5184
5448
|
# the properties below are optional
|
|
5449
|
+
bake_time=cdk.Duration.minutes(30),
|
|
5185
5450
|
capacity_provider_strategies=[ecs.CapacityProviderStrategy(
|
|
5186
5451
|
capacity_provider="capacityProvider",
|
|
5187
5452
|
|
|
@@ -5211,10 +5476,12 @@ class BaseServiceOptions:
|
|
|
5211
5476
|
deployment_controller=ecs.DeploymentController(
|
|
5212
5477
|
type=ecs.DeploymentControllerType.ECS
|
|
5213
5478
|
),
|
|
5479
|
+
deployment_strategy=ecs.DeploymentStrategy.ROLLING,
|
|
5214
5480
|
desired_count=123,
|
|
5215
5481
|
enable_eCSManaged_tags=False,
|
|
5216
5482
|
enable_execute_command=False,
|
|
5217
5483
|
health_check_grace_period=cdk.Duration.minutes(30),
|
|
5484
|
+
lifecycle_hooks=[deployment_lifecycle_hook_target],
|
|
5218
5485
|
max_healthy_percent=123,
|
|
5219
5486
|
min_healthy_percent=123,
|
|
5220
5487
|
propagate_tags=ecs.PropagatedTagSource.SERVICE,
|
|
@@ -5256,15 +5523,18 @@ class BaseServiceOptions:
|
|
|
5256
5523
|
if __debug__:
|
|
5257
5524
|
type_hints = typing.get_type_hints(_typecheckingstub__c2e0ba28c74987301a54b0d197b791a6a94084b5f40d15304ffabf113b3f7daa)
|
|
5258
5525
|
check_type(argname="argument cluster", value=cluster, expected_type=type_hints["cluster"])
|
|
5526
|
+
check_type(argname="argument bake_time", value=bake_time, expected_type=type_hints["bake_time"])
|
|
5259
5527
|
check_type(argname="argument capacity_provider_strategies", value=capacity_provider_strategies, expected_type=type_hints["capacity_provider_strategies"])
|
|
5260
5528
|
check_type(argname="argument circuit_breaker", value=circuit_breaker, expected_type=type_hints["circuit_breaker"])
|
|
5261
5529
|
check_type(argname="argument cloud_map_options", value=cloud_map_options, expected_type=type_hints["cloud_map_options"])
|
|
5262
5530
|
check_type(argname="argument deployment_alarms", value=deployment_alarms, expected_type=type_hints["deployment_alarms"])
|
|
5263
5531
|
check_type(argname="argument deployment_controller", value=deployment_controller, expected_type=type_hints["deployment_controller"])
|
|
5532
|
+
check_type(argname="argument deployment_strategy", value=deployment_strategy, expected_type=type_hints["deployment_strategy"])
|
|
5264
5533
|
check_type(argname="argument desired_count", value=desired_count, expected_type=type_hints["desired_count"])
|
|
5265
5534
|
check_type(argname="argument enable_ecs_managed_tags", value=enable_ecs_managed_tags, expected_type=type_hints["enable_ecs_managed_tags"])
|
|
5266
5535
|
check_type(argname="argument enable_execute_command", value=enable_execute_command, expected_type=type_hints["enable_execute_command"])
|
|
5267
5536
|
check_type(argname="argument health_check_grace_period", value=health_check_grace_period, expected_type=type_hints["health_check_grace_period"])
|
|
5537
|
+
check_type(argname="argument lifecycle_hooks", value=lifecycle_hooks, expected_type=type_hints["lifecycle_hooks"])
|
|
5268
5538
|
check_type(argname="argument max_healthy_percent", value=max_healthy_percent, expected_type=type_hints["max_healthy_percent"])
|
|
5269
5539
|
check_type(argname="argument min_healthy_percent", value=min_healthy_percent, expected_type=type_hints["min_healthy_percent"])
|
|
5270
5540
|
check_type(argname="argument propagate_tags", value=propagate_tags, expected_type=type_hints["propagate_tags"])
|
|
@@ -5275,6 +5545,8 @@ class BaseServiceOptions:
|
|
|
5275
5545
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
5276
5546
|
"cluster": cluster,
|
|
5277
5547
|
}
|
|
5548
|
+
if bake_time is not None:
|
|
5549
|
+
self._values["bake_time"] = bake_time
|
|
5278
5550
|
if capacity_provider_strategies is not None:
|
|
5279
5551
|
self._values["capacity_provider_strategies"] = capacity_provider_strategies
|
|
5280
5552
|
if circuit_breaker is not None:
|
|
@@ -5285,6 +5557,8 @@ class BaseServiceOptions:
|
|
|
5285
5557
|
self._values["deployment_alarms"] = deployment_alarms
|
|
5286
5558
|
if deployment_controller is not None:
|
|
5287
5559
|
self._values["deployment_controller"] = deployment_controller
|
|
5560
|
+
if deployment_strategy is not None:
|
|
5561
|
+
self._values["deployment_strategy"] = deployment_strategy
|
|
5288
5562
|
if desired_count is not None:
|
|
5289
5563
|
self._values["desired_count"] = desired_count
|
|
5290
5564
|
if enable_ecs_managed_tags is not None:
|
|
@@ -5293,6 +5567,8 @@ class BaseServiceOptions:
|
|
|
5293
5567
|
self._values["enable_execute_command"] = enable_execute_command
|
|
5294
5568
|
if health_check_grace_period is not None:
|
|
5295
5569
|
self._values["health_check_grace_period"] = health_check_grace_period
|
|
5570
|
+
if lifecycle_hooks is not None:
|
|
5571
|
+
self._values["lifecycle_hooks"] = lifecycle_hooks
|
|
5296
5572
|
if max_healthy_percent is not None:
|
|
5297
5573
|
self._values["max_healthy_percent"] = max_healthy_percent
|
|
5298
5574
|
if min_healthy_percent is not None:
|
|
@@ -5315,6 +5591,15 @@ class BaseServiceOptions:
|
|
|
5315
5591
|
assert result is not None, "Required property 'cluster' is missing"
|
|
5316
5592
|
return typing.cast("ICluster", result)
|
|
5317
5593
|
|
|
5594
|
+
@builtins.property
|
|
5595
|
+
def bake_time(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
5596
|
+
'''bake time minutes for service.
|
|
5597
|
+
|
|
5598
|
+
:default: - none
|
|
5599
|
+
'''
|
|
5600
|
+
result = self._values.get("bake_time")
|
|
5601
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
5602
|
+
|
|
5318
5603
|
@builtins.property
|
|
5319
5604
|
def capacity_provider_strategies(
|
|
5320
5605
|
self,
|
|
@@ -5368,6 +5653,15 @@ class BaseServiceOptions:
|
|
|
5368
5653
|
result = self._values.get("deployment_controller")
|
|
5369
5654
|
return typing.cast(typing.Optional["DeploymentController"], result)
|
|
5370
5655
|
|
|
5656
|
+
@builtins.property
|
|
5657
|
+
def deployment_strategy(self) -> typing.Optional["DeploymentStrategy"]:
|
|
5658
|
+
'''The deployment strategy to use for the service.
|
|
5659
|
+
|
|
5660
|
+
:default: ROLLING
|
|
5661
|
+
'''
|
|
5662
|
+
result = self._values.get("deployment_strategy")
|
|
5663
|
+
return typing.cast(typing.Optional["DeploymentStrategy"], result)
|
|
5664
|
+
|
|
5371
5665
|
@builtins.property
|
|
5372
5666
|
def desired_count(self) -> typing.Optional[jsii.Number]:
|
|
5373
5667
|
'''The desired number of instantiations of the task definition to keep running on the service.
|
|
@@ -5410,6 +5704,17 @@ class BaseServiceOptions:
|
|
|
5410
5704
|
result = self._values.get("health_check_grace_period")
|
|
5411
5705
|
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
5412
5706
|
|
|
5707
|
+
@builtins.property
|
|
5708
|
+
def lifecycle_hooks(
|
|
5709
|
+
self,
|
|
5710
|
+
) -> typing.Optional[typing.List["IDeploymentLifecycleHookTarget"]]:
|
|
5711
|
+
'''The lifecycle hooks to execute during deployment stages.
|
|
5712
|
+
|
|
5713
|
+
:default: - none;
|
|
5714
|
+
'''
|
|
5715
|
+
result = self._values.get("lifecycle_hooks")
|
|
5716
|
+
return typing.cast(typing.Optional[typing.List["IDeploymentLifecycleHookTarget"]], result)
|
|
5717
|
+
|
|
5413
5718
|
@builtins.property
|
|
5414
5719
|
def max_healthy_percent(self) -> typing.Optional[jsii.Number]:
|
|
5415
5720
|
'''The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.
|
|
@@ -5500,15 +5805,18 @@ class BaseServiceOptions:
|
|
|
5500
5805
|
jsii_struct_bases=[BaseServiceOptions],
|
|
5501
5806
|
name_mapping={
|
|
5502
5807
|
"cluster": "cluster",
|
|
5808
|
+
"bake_time": "bakeTime",
|
|
5503
5809
|
"capacity_provider_strategies": "capacityProviderStrategies",
|
|
5504
5810
|
"circuit_breaker": "circuitBreaker",
|
|
5505
5811
|
"cloud_map_options": "cloudMapOptions",
|
|
5506
5812
|
"deployment_alarms": "deploymentAlarms",
|
|
5507
5813
|
"deployment_controller": "deploymentController",
|
|
5814
|
+
"deployment_strategy": "deploymentStrategy",
|
|
5508
5815
|
"desired_count": "desiredCount",
|
|
5509
5816
|
"enable_ecs_managed_tags": "enableECSManagedTags",
|
|
5510
5817
|
"enable_execute_command": "enableExecuteCommand",
|
|
5511
5818
|
"health_check_grace_period": "healthCheckGracePeriod",
|
|
5819
|
+
"lifecycle_hooks": "lifecycleHooks",
|
|
5512
5820
|
"max_healthy_percent": "maxHealthyPercent",
|
|
5513
5821
|
"min_healthy_percent": "minHealthyPercent",
|
|
5514
5822
|
"propagate_tags": "propagateTags",
|
|
@@ -5524,15 +5832,18 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5524
5832
|
self,
|
|
5525
5833
|
*,
|
|
5526
5834
|
cluster: "ICluster",
|
|
5835
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
5527
5836
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union["CapacityProviderStrategy", typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
5528
5837
|
circuit_breaker: typing.Optional[typing.Union["DeploymentCircuitBreaker", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
5529
5838
|
cloud_map_options: typing.Optional[typing.Union["CloudMapOptions", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
5530
5839
|
deployment_alarms: typing.Optional[typing.Union["DeploymentAlarmConfig", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
5531
5840
|
deployment_controller: typing.Optional[typing.Union["DeploymentController", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
5841
|
+
deployment_strategy: typing.Optional["DeploymentStrategy"] = None,
|
|
5532
5842
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
5533
5843
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
5534
5844
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
5535
5845
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
5846
|
+
lifecycle_hooks: typing.Optional[typing.Sequence["IDeploymentLifecycleHookTarget"]] = None,
|
|
5536
5847
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
5537
5848
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
5538
5849
|
propagate_tags: typing.Optional["PropagatedTagSource"] = None,
|
|
@@ -5545,15 +5856,18 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5545
5856
|
'''Complete base service properties that are required to be supplied by the implementation of the BaseService class.
|
|
5546
5857
|
|
|
5547
5858
|
:param cluster: The name of the cluster that hosts the service.
|
|
5859
|
+
:param bake_time: bake time minutes for service. Default: - none
|
|
5548
5860
|
:param capacity_provider_strategies: A list of Capacity Provider strategies used to place a service. Default: - undefined
|
|
5549
5861
|
:param circuit_breaker: Whether to enable the deployment circuit breaker. If this property is defined, circuit breaker will be implicitly enabled. Default: - disabled
|
|
5550
5862
|
:param cloud_map_options: The options for configuring an Amazon ECS service to use service discovery. Default: - AWS Cloud Map service discovery is not enabled.
|
|
5551
5863
|
:param deployment_alarms: The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. Default: - No alarms will be monitored during deployment.
|
|
5552
5864
|
:param deployment_controller: Specifies which deployment controller to use for the service. For more information, see `Amazon ECS Deployment Types <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html>`_ Default: - Rolling update (ECS)
|
|
5865
|
+
:param deployment_strategy: The deployment strategy to use for the service. Default: ROLLING
|
|
5553
5866
|
:param desired_count: The desired number of instantiations of the task definition to keep running on the service. Default: - When creating the service, default is 1; when updating the service, default uses the current task number.
|
|
5554
5867
|
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging Your Amazon ECS Resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ Default: false
|
|
5555
5868
|
:param enable_execute_command: Whether to enable the ability to execute into a container. Default: - undefined
|
|
5556
5869
|
:param health_check_grace_period: The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set
|
|
5870
|
+
:param lifecycle_hooks: The lifecycle hooks to execute during deployment stages. Default: - none;
|
|
5557
5871
|
:param max_healthy_percent: The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. Default: - 100 if daemon, otherwise 200
|
|
5558
5872
|
:param min_healthy_percent: The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. Default: - 0 if daemon, otherwise 50
|
|
5559
5873
|
:param propagate_tags: Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE Default: PropagatedTagSource.NONE
|
|
@@ -5577,6 +5891,7 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5577
5891
|
|
|
5578
5892
|
# cluster: ecs.Cluster
|
|
5579
5893
|
# container_definition: ecs.ContainerDefinition
|
|
5894
|
+
# deployment_lifecycle_hook_target: ecs.IDeploymentLifecycleHookTarget
|
|
5580
5895
|
# key: kms.Key
|
|
5581
5896
|
# log_driver: ecs.LogDriver
|
|
5582
5897
|
# namespace: servicediscovery.INamespace
|
|
@@ -5589,6 +5904,7 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5589
5904
|
launch_type=ecs.LaunchType.EC2,
|
|
5590
5905
|
|
|
5591
5906
|
# the properties below are optional
|
|
5907
|
+
bake_time=cdk.Duration.minutes(30),
|
|
5592
5908
|
capacity_provider_strategies=[ecs.CapacityProviderStrategy(
|
|
5593
5909
|
capacity_provider="capacityProvider",
|
|
5594
5910
|
|
|
@@ -5618,10 +5934,12 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5618
5934
|
deployment_controller=ecs.DeploymentController(
|
|
5619
5935
|
type=ecs.DeploymentControllerType.ECS
|
|
5620
5936
|
),
|
|
5937
|
+
deployment_strategy=ecs.DeploymentStrategy.ROLLING,
|
|
5621
5938
|
desired_count=123,
|
|
5622
5939
|
enable_eCSManaged_tags=False,
|
|
5623
5940
|
enable_execute_command=False,
|
|
5624
5941
|
health_check_grace_period=cdk.Duration.minutes(30),
|
|
5942
|
+
lifecycle_hooks=[deployment_lifecycle_hook_target],
|
|
5625
5943
|
max_healthy_percent=123,
|
|
5626
5944
|
min_healthy_percent=123,
|
|
5627
5945
|
propagate_tags=ecs.PropagatedTagSource.SERVICE,
|
|
@@ -5663,15 +5981,18 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5663
5981
|
if __debug__:
|
|
5664
5982
|
type_hints = typing.get_type_hints(_typecheckingstub__3ecfd95265b873c2042a9d5cb8465a48f9e325e2271c18461e2b266333563d84)
|
|
5665
5983
|
check_type(argname="argument cluster", value=cluster, expected_type=type_hints["cluster"])
|
|
5984
|
+
check_type(argname="argument bake_time", value=bake_time, expected_type=type_hints["bake_time"])
|
|
5666
5985
|
check_type(argname="argument capacity_provider_strategies", value=capacity_provider_strategies, expected_type=type_hints["capacity_provider_strategies"])
|
|
5667
5986
|
check_type(argname="argument circuit_breaker", value=circuit_breaker, expected_type=type_hints["circuit_breaker"])
|
|
5668
5987
|
check_type(argname="argument cloud_map_options", value=cloud_map_options, expected_type=type_hints["cloud_map_options"])
|
|
5669
5988
|
check_type(argname="argument deployment_alarms", value=deployment_alarms, expected_type=type_hints["deployment_alarms"])
|
|
5670
5989
|
check_type(argname="argument deployment_controller", value=deployment_controller, expected_type=type_hints["deployment_controller"])
|
|
5990
|
+
check_type(argname="argument deployment_strategy", value=deployment_strategy, expected_type=type_hints["deployment_strategy"])
|
|
5671
5991
|
check_type(argname="argument desired_count", value=desired_count, expected_type=type_hints["desired_count"])
|
|
5672
5992
|
check_type(argname="argument enable_ecs_managed_tags", value=enable_ecs_managed_tags, expected_type=type_hints["enable_ecs_managed_tags"])
|
|
5673
5993
|
check_type(argname="argument enable_execute_command", value=enable_execute_command, expected_type=type_hints["enable_execute_command"])
|
|
5674
5994
|
check_type(argname="argument health_check_grace_period", value=health_check_grace_period, expected_type=type_hints["health_check_grace_period"])
|
|
5995
|
+
check_type(argname="argument lifecycle_hooks", value=lifecycle_hooks, expected_type=type_hints["lifecycle_hooks"])
|
|
5675
5996
|
check_type(argname="argument max_healthy_percent", value=max_healthy_percent, expected_type=type_hints["max_healthy_percent"])
|
|
5676
5997
|
check_type(argname="argument min_healthy_percent", value=min_healthy_percent, expected_type=type_hints["min_healthy_percent"])
|
|
5677
5998
|
check_type(argname="argument propagate_tags", value=propagate_tags, expected_type=type_hints["propagate_tags"])
|
|
@@ -5684,6 +6005,8 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5684
6005
|
"cluster": cluster,
|
|
5685
6006
|
"launch_type": launch_type,
|
|
5686
6007
|
}
|
|
6008
|
+
if bake_time is not None:
|
|
6009
|
+
self._values["bake_time"] = bake_time
|
|
5687
6010
|
if capacity_provider_strategies is not None:
|
|
5688
6011
|
self._values["capacity_provider_strategies"] = capacity_provider_strategies
|
|
5689
6012
|
if circuit_breaker is not None:
|
|
@@ -5694,6 +6017,8 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5694
6017
|
self._values["deployment_alarms"] = deployment_alarms
|
|
5695
6018
|
if deployment_controller is not None:
|
|
5696
6019
|
self._values["deployment_controller"] = deployment_controller
|
|
6020
|
+
if deployment_strategy is not None:
|
|
6021
|
+
self._values["deployment_strategy"] = deployment_strategy
|
|
5697
6022
|
if desired_count is not None:
|
|
5698
6023
|
self._values["desired_count"] = desired_count
|
|
5699
6024
|
if enable_ecs_managed_tags is not None:
|
|
@@ -5702,6 +6027,8 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5702
6027
|
self._values["enable_execute_command"] = enable_execute_command
|
|
5703
6028
|
if health_check_grace_period is not None:
|
|
5704
6029
|
self._values["health_check_grace_period"] = health_check_grace_period
|
|
6030
|
+
if lifecycle_hooks is not None:
|
|
6031
|
+
self._values["lifecycle_hooks"] = lifecycle_hooks
|
|
5705
6032
|
if max_healthy_percent is not None:
|
|
5706
6033
|
self._values["max_healthy_percent"] = max_healthy_percent
|
|
5707
6034
|
if min_healthy_percent is not None:
|
|
@@ -5724,6 +6051,15 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5724
6051
|
assert result is not None, "Required property 'cluster' is missing"
|
|
5725
6052
|
return typing.cast("ICluster", result)
|
|
5726
6053
|
|
|
6054
|
+
@builtins.property
|
|
6055
|
+
def bake_time(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
6056
|
+
'''bake time minutes for service.
|
|
6057
|
+
|
|
6058
|
+
:default: - none
|
|
6059
|
+
'''
|
|
6060
|
+
result = self._values.get("bake_time")
|
|
6061
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
6062
|
+
|
|
5727
6063
|
@builtins.property
|
|
5728
6064
|
def capacity_provider_strategies(
|
|
5729
6065
|
self,
|
|
@@ -5777,6 +6113,15 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5777
6113
|
result = self._values.get("deployment_controller")
|
|
5778
6114
|
return typing.cast(typing.Optional["DeploymentController"], result)
|
|
5779
6115
|
|
|
6116
|
+
@builtins.property
|
|
6117
|
+
def deployment_strategy(self) -> typing.Optional["DeploymentStrategy"]:
|
|
6118
|
+
'''The deployment strategy to use for the service.
|
|
6119
|
+
|
|
6120
|
+
:default: ROLLING
|
|
6121
|
+
'''
|
|
6122
|
+
result = self._values.get("deployment_strategy")
|
|
6123
|
+
return typing.cast(typing.Optional["DeploymentStrategy"], result)
|
|
6124
|
+
|
|
5780
6125
|
@builtins.property
|
|
5781
6126
|
def desired_count(self) -> typing.Optional[jsii.Number]:
|
|
5782
6127
|
'''The desired number of instantiations of the task definition to keep running on the service.
|
|
@@ -5819,6 +6164,17 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
5819
6164
|
result = self._values.get("health_check_grace_period")
|
|
5820
6165
|
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
5821
6166
|
|
|
6167
|
+
@builtins.property
|
|
6168
|
+
def lifecycle_hooks(
|
|
6169
|
+
self,
|
|
6170
|
+
) -> typing.Optional[typing.List["IDeploymentLifecycleHookTarget"]]:
|
|
6171
|
+
'''The lifecycle hooks to execute during deployment stages.
|
|
6172
|
+
|
|
6173
|
+
:default: - none;
|
|
6174
|
+
'''
|
|
6175
|
+
result = self._values.get("lifecycle_hooks")
|
|
6176
|
+
return typing.cast(typing.Optional[typing.List["IDeploymentLifecycleHookTarget"]], result)
|
|
6177
|
+
|
|
5822
6178
|
@builtins.property
|
|
5823
6179
|
def max_healthy_percent(self) -> typing.Optional[jsii.Number]:
|
|
5824
6180
|
'''The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.
|
|
@@ -6656,7 +7012,7 @@ class CfnCapacityProvider(
|
|
|
6656
7012
|
|
|
6657
7013
|
:param instance_warmup_period: The period of time, in seconds, after a newly launched Amazon EC2 instance can contribute to CloudWatch metrics for Auto Scaling group. If this parameter is omitted, the default value of ``300`` seconds is used.
|
|
6658
7014
|
:param maximum_scaling_step_size: The maximum number of Amazon EC2 instances that Amazon ECS will scale out at one time. If this parameter is omitted, the default value of ``10000`` is used.
|
|
6659
|
-
:param minimum_scaling_step_size: The minimum number of Amazon EC2 instances that Amazon ECS will scale out at one time. The scale in process is not affected by this parameter If this parameter is omitted, the default value of ``1`` is used. When additional capacity is required, Amazon ECS will scale up the minimum scaling step size even if the actual demand is less than the minimum scaling step size.
|
|
7015
|
+
:param minimum_scaling_step_size: The minimum number of Amazon EC2 instances that Amazon ECS will scale out at one time. The scale in process is not affected by this parameter If this parameter is omitted, the default value of ``1`` is used. When additional capacity is required, Amazon ECS will scale up the minimum scaling step size even if the actual demand is less than the minimum scaling step size.
|
|
6660
7016
|
:param status: Determines whether to use managed scaling for the capacity provider.
|
|
6661
7017
|
:param target_capacity: The target capacity utilization as a percentage for the capacity provider. The specified value must be greater than ``0`` and less than or equal to ``100`` . For example, if you want the capacity provider to maintain 10% spare capacity, then that means the utilization is 90%, so use a ``targetCapacity`` of ``90`` . The default value of ``100`` percent results in the Amazon EC2 instances in your Auto Scaling group being completely used.
|
|
6662
7018
|
|
|
@@ -6726,8 +7082,6 @@ class CfnCapacityProvider(
|
|
|
6726
7082
|
|
|
6727
7083
|
When additional capacity is required, Amazon ECS will scale up the minimum scaling step size even if the actual demand is less than the minimum scaling step size.
|
|
6728
7084
|
|
|
6729
|
-
If you use a capacity provider with an Auto Scaling group configured with more than one Amazon EC2 instance type or Availability Zone, Amazon ECS will scale up by the exact minimum scaling step size value and will ignore both the maximum scaling step size as well as the capacity demand.
|
|
6730
|
-
|
|
6731
7085
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-capacityprovider-managedscaling.html#cfn-ecs-capacityprovider-managedscaling-minimumscalingstepsize
|
|
6732
7086
|
'''
|
|
6733
7087
|
result = self._values.get("minimum_scaling_step_size")
|
|
@@ -8642,23 +8996,184 @@ class CfnService(
|
|
|
8642
8996
|
|
|
8643
8997
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html
|
|
8644
8998
|
:cloudformationResource: AWS::ECS::Service
|
|
8645
|
-
:exampleMetadata:
|
|
8999
|
+
:exampleMetadata: fixture=_generated
|
|
8646
9000
|
|
|
8647
9001
|
Example::
|
|
8648
9002
|
|
|
8649
|
-
#
|
|
9003
|
+
# The code below shows an example of how to instantiate this type.
|
|
9004
|
+
# The values are placeholders you should change.
|
|
9005
|
+
from aws_cdk import aws_ecs as ecs
|
|
8650
9006
|
|
|
9007
|
+
cfn_service = ecs.CfnService(self, "MyCfnService",
|
|
9008
|
+
availability_zone_rebalancing="availabilityZoneRebalancing",
|
|
9009
|
+
capacity_provider_strategy=[ecs.CfnService.CapacityProviderStrategyItemProperty(
|
|
9010
|
+
base=123,
|
|
9011
|
+
capacity_provider="capacityProvider",
|
|
9012
|
+
weight=123
|
|
9013
|
+
)],
|
|
9014
|
+
cluster="cluster",
|
|
9015
|
+
deployment_configuration=ecs.CfnService.DeploymentConfigurationProperty(
|
|
9016
|
+
alarms=ecs.CfnService.DeploymentAlarmsProperty(
|
|
9017
|
+
alarm_names=["alarmNames"],
|
|
9018
|
+
enable=False,
|
|
9019
|
+
rollback=False
|
|
9020
|
+
),
|
|
9021
|
+
bake_time_in_minutes=123,
|
|
9022
|
+
deployment_circuit_breaker=ecs.CfnService.DeploymentCircuitBreakerProperty(
|
|
9023
|
+
enable=False,
|
|
9024
|
+
rollback=False
|
|
9025
|
+
),
|
|
9026
|
+
lifecycle_hooks=[ecs.CfnService.DeploymentLifecycleHookProperty(
|
|
9027
|
+
hook_target_arn="hookTargetArn",
|
|
9028
|
+
lifecycle_stages=["lifecycleStages"],
|
|
9029
|
+
role_arn="roleArn"
|
|
9030
|
+
)],
|
|
9031
|
+
maximum_percent=123,
|
|
9032
|
+
minimum_healthy_percent=123,
|
|
9033
|
+
strategy="strategy"
|
|
9034
|
+
),
|
|
9035
|
+
deployment_controller=ecs.CfnService.DeploymentControllerProperty(
|
|
9036
|
+
type="type"
|
|
9037
|
+
),
|
|
9038
|
+
desired_count=123,
|
|
9039
|
+
enable_ecs_managed_tags=False,
|
|
9040
|
+
enable_execute_command=False,
|
|
9041
|
+
health_check_grace_period_seconds=123,
|
|
9042
|
+
launch_type="launchType",
|
|
9043
|
+
load_balancers=[ecs.CfnService.LoadBalancerProperty(
|
|
9044
|
+
advanced_configuration=ecs.CfnService.AdvancedConfigurationProperty(
|
|
9045
|
+
alternate_target_group_arn="alternateTargetGroupArn",
|
|
9046
|
+
|
|
9047
|
+
# the properties below are optional
|
|
9048
|
+
production_listener_rule="productionListenerRule",
|
|
9049
|
+
role_arn="roleArn",
|
|
9050
|
+
test_listener_rule="testListenerRule"
|
|
9051
|
+
),
|
|
9052
|
+
container_name="containerName",
|
|
9053
|
+
container_port=123,
|
|
9054
|
+
load_balancer_name="loadBalancerName",
|
|
9055
|
+
target_group_arn="targetGroupArn"
|
|
9056
|
+
)],
|
|
9057
|
+
network_configuration=ecs.CfnService.NetworkConfigurationProperty(
|
|
9058
|
+
awsvpc_configuration=ecs.CfnService.AwsVpcConfigurationProperty(
|
|
9059
|
+
assign_public_ip="assignPublicIp",
|
|
9060
|
+
security_groups=["securityGroups"],
|
|
9061
|
+
subnets=["subnets"]
|
|
9062
|
+
)
|
|
9063
|
+
),
|
|
9064
|
+
placement_constraints=[ecs.CfnService.PlacementConstraintProperty(
|
|
9065
|
+
type="type",
|
|
8651
9066
|
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
9067
|
+
# the properties below are optional
|
|
9068
|
+
expression="expression"
|
|
9069
|
+
)],
|
|
9070
|
+
placement_strategies=[ecs.CfnService.PlacementStrategyProperty(
|
|
9071
|
+
type="type",
|
|
9072
|
+
|
|
9073
|
+
# the properties below are optional
|
|
9074
|
+
field="field"
|
|
9075
|
+
)],
|
|
9076
|
+
platform_version="platformVersion",
|
|
9077
|
+
propagate_tags="propagateTags",
|
|
9078
|
+
role="role",
|
|
9079
|
+
scheduling_strategy="schedulingStrategy",
|
|
9080
|
+
service_connect_configuration=ecs.CfnService.ServiceConnectConfigurationProperty(
|
|
9081
|
+
enabled=False,
|
|
9082
|
+
|
|
9083
|
+
# the properties below are optional
|
|
9084
|
+
log_configuration=ecs.CfnService.LogConfigurationProperty(
|
|
9085
|
+
log_driver="logDriver",
|
|
9086
|
+
options={
|
|
9087
|
+
"options_key": "options"
|
|
9088
|
+
},
|
|
9089
|
+
secret_options=[ecs.CfnService.SecretProperty(
|
|
9090
|
+
name="name",
|
|
9091
|
+
value_from="valueFrom"
|
|
9092
|
+
)]
|
|
9093
|
+
),
|
|
9094
|
+
namespace="namespace",
|
|
9095
|
+
services=[ecs.CfnService.ServiceConnectServiceProperty(
|
|
9096
|
+
port_name="portName",
|
|
9097
|
+
|
|
9098
|
+
# the properties below are optional
|
|
9099
|
+
client_aliases=[ecs.CfnService.ServiceConnectClientAliasProperty(
|
|
9100
|
+
port=123,
|
|
9101
|
+
|
|
9102
|
+
# the properties below are optional
|
|
9103
|
+
dns_name="dnsName",
|
|
9104
|
+
test_traffic_rules=ecs.CfnService.ServiceConnectTestTrafficRulesProperty(
|
|
9105
|
+
header=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderProperty(
|
|
9106
|
+
name="name",
|
|
9107
|
+
|
|
9108
|
+
# the properties below are optional
|
|
9109
|
+
value=ecs.CfnService.ServiceConnectTestTrafficRulesHeaderValueProperty(
|
|
9110
|
+
exact="exact"
|
|
9111
|
+
)
|
|
9112
|
+
)
|
|
9113
|
+
)
|
|
9114
|
+
)],
|
|
9115
|
+
discovery_name="discoveryName",
|
|
9116
|
+
ingress_port_override=123,
|
|
9117
|
+
timeout=ecs.CfnService.TimeoutConfigurationProperty(
|
|
9118
|
+
idle_timeout_seconds=123,
|
|
9119
|
+
per_request_timeout_seconds=123
|
|
9120
|
+
),
|
|
9121
|
+
tls=ecs.CfnService.ServiceConnectTlsConfigurationProperty(
|
|
9122
|
+
issuer_certificate_authority=ecs.CfnService.ServiceConnectTlsCertificateAuthorityProperty(
|
|
9123
|
+
aws_pca_authority_arn="awsPcaAuthorityArn"
|
|
9124
|
+
),
|
|
9125
|
+
|
|
9126
|
+
# the properties below are optional
|
|
9127
|
+
kms_key="kmsKey",
|
|
9128
|
+
role_arn="roleArn"
|
|
9129
|
+
)
|
|
9130
|
+
)]
|
|
9131
|
+
),
|
|
9132
|
+
service_name="serviceName",
|
|
9133
|
+
service_registries=[ecs.CfnService.ServiceRegistryProperty(
|
|
9134
|
+
container_name="containerName",
|
|
9135
|
+
container_port=123,
|
|
9136
|
+
port=123,
|
|
9137
|
+
registry_arn="registryArn"
|
|
9138
|
+
)],
|
|
9139
|
+
tags=[CfnTag(
|
|
9140
|
+
key="key",
|
|
9141
|
+
value="value"
|
|
9142
|
+
)],
|
|
9143
|
+
task_definition="taskDefinition",
|
|
9144
|
+
volume_configurations=[ecs.CfnService.ServiceVolumeConfigurationProperty(
|
|
9145
|
+
name="name",
|
|
9146
|
+
|
|
9147
|
+
# the properties below are optional
|
|
9148
|
+
managed_ebs_volume=ecs.CfnService.ServiceManagedEBSVolumeConfigurationProperty(
|
|
9149
|
+
role_arn="roleArn",
|
|
9150
|
+
|
|
9151
|
+
# the properties below are optional
|
|
9152
|
+
encrypted=False,
|
|
9153
|
+
filesystem_type="filesystemType",
|
|
9154
|
+
iops=123,
|
|
9155
|
+
kms_key_id="kmsKeyId",
|
|
9156
|
+
size_in_gi_b=123,
|
|
9157
|
+
snapshot_id="snapshotId",
|
|
9158
|
+
tag_specifications=[ecs.CfnService.EBSTagSpecificationProperty(
|
|
9159
|
+
resource_type="resourceType",
|
|
9160
|
+
|
|
9161
|
+
# the properties below are optional
|
|
9162
|
+
propagate_tags="propagateTags",
|
|
9163
|
+
tags=[CfnTag(
|
|
9164
|
+
key="key",
|
|
9165
|
+
value="value"
|
|
9166
|
+
)]
|
|
9167
|
+
)],
|
|
9168
|
+
throughput=123,
|
|
9169
|
+
volume_initialization_rate=123,
|
|
9170
|
+
volume_type="volumeType"
|
|
9171
|
+
)
|
|
9172
|
+
)],
|
|
9173
|
+
vpc_lattice_configurations=[ecs.CfnService.VpcLatticeConfigurationProperty(
|
|
9174
|
+
port_name="portName",
|
|
9175
|
+
role_arn="roleArn",
|
|
9176
|
+
target_group_arn="targetGroupArn"
|
|
8662
9177
|
)]
|
|
8663
9178
|
)
|
|
8664
9179
|
'''
|
|
@@ -8697,7 +9212,7 @@ class CfnService(
|
|
|
8697
9212
|
'''
|
|
8698
9213
|
:param scope: Scope in which this resource is defined.
|
|
8699
9214
|
:param id: Construct identifier for this resource (unique in its scope).
|
|
8700
|
-
:param availability_zone_rebalancing: Indicates whether to use Availability Zone rebalancing for the service. For more information, see `Balancing an Amazon ECS service across Availability Zones <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html>`_ in the **Amazon Elastic Container Service Developer Guide** . Default: - "
|
|
9215
|
+
:param availability_zone_rebalancing: Indicates whether to use Availability Zone rebalancing for the service. For more information, see `Balancing an Amazon ECS service across Availability Zones <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html>`_ in the **Amazon Elastic Container Service Developer Guide** . Default: - "ENABLED"
|
|
8701
9216
|
: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.
|
|
8702
9217
|
: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.
|
|
8703
9218
|
:param deployment_configuration: Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.
|
|
@@ -12556,7 +13071,7 @@ class CfnServiceProps:
|
|
|
12556
13071
|
) -> None:
|
|
12557
13072
|
'''Properties for defining a ``CfnService``.
|
|
12558
13073
|
|
|
12559
|
-
:param availability_zone_rebalancing: Indicates whether to use Availability Zone rebalancing for the service. For more information, see `Balancing an Amazon ECS service across Availability Zones <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html>`_ in the **Amazon Elastic Container Service Developer Guide** . Default: - "
|
|
13074
|
+
:param availability_zone_rebalancing: Indicates whether to use Availability Zone rebalancing for the service. For more information, see `Balancing an Amazon ECS service across Availability Zones <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html>`_ in the **Amazon Elastic Container Service Developer Guide** . Default: - "ENABLED"
|
|
12560
13075
|
: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.
|
|
12561
13076
|
: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.
|
|
12562
13077
|
:param deployment_configuration: Optional deployment parameters that control how many tasks run during the deployment and the ordering of stopping and starting tasks.
|
|
@@ -12849,7 +13364,7 @@ class CfnServiceProps:
|
|
|
12849
13364
|
|
|
12850
13365
|
For more information, see `Balancing an Amazon ECS service across Availability Zones <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html>`_ in the **Amazon Elastic Container Service Developer Guide** .
|
|
12851
13366
|
|
|
12852
|
-
:default: - "
|
|
13367
|
+
:default: - "ENABLED"
|
|
12853
13368
|
|
|
12854
13369
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-availabilityzonerebalancing
|
|
12855
13370
|
'''
|
|
@@ -24421,6 +24936,290 @@ class DeploymentControllerType(enum.Enum):
|
|
|
24421
24936
|
'''The external (EXTERNAL) deployment type enables you to use any third-party deployment controller.'''
|
|
24422
24937
|
|
|
24423
24938
|
|
|
24939
|
+
@jsii.data_type(
|
|
24940
|
+
jsii_type="aws-cdk-lib.aws_ecs.DeploymentLifecycleHookTargetConfig",
|
|
24941
|
+
jsii_struct_bases=[],
|
|
24942
|
+
name_mapping={
|
|
24943
|
+
"lifecycle_stages": "lifecycleStages",
|
|
24944
|
+
"target_arn": "targetArn",
|
|
24945
|
+
"role": "role",
|
|
24946
|
+
},
|
|
24947
|
+
)
|
|
24948
|
+
class DeploymentLifecycleHookTargetConfig:
|
|
24949
|
+
def __init__(
|
|
24950
|
+
self,
|
|
24951
|
+
*,
|
|
24952
|
+
lifecycle_stages: typing.Sequence["DeploymentLifecycleStage"],
|
|
24953
|
+
target_arn: builtins.str,
|
|
24954
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
24955
|
+
) -> None:
|
|
24956
|
+
'''Configuration for a deployment lifecycle hook target.
|
|
24957
|
+
|
|
24958
|
+
:param lifecycle_stages: The lifecycle stages when this hook should be executed.
|
|
24959
|
+
:param target_arn: The ARN of the target resource.
|
|
24960
|
+
:param role: The IAM role that grants permissions to invoke the target. Default: - a role will be created automatically
|
|
24961
|
+
|
|
24962
|
+
:exampleMetadata: fixture=_generated
|
|
24963
|
+
|
|
24964
|
+
Example::
|
|
24965
|
+
|
|
24966
|
+
# The code below shows an example of how to instantiate this type.
|
|
24967
|
+
# The values are placeholders you should change.
|
|
24968
|
+
from aws_cdk import aws_ecs as ecs
|
|
24969
|
+
from aws_cdk import aws_iam as iam
|
|
24970
|
+
|
|
24971
|
+
# role: iam.Role
|
|
24972
|
+
|
|
24973
|
+
deployment_lifecycle_hook_target_config = ecs.DeploymentLifecycleHookTargetConfig(
|
|
24974
|
+
lifecycle_stages=[ecs.DeploymentLifecycleStage.RECONCILE_SERVICE],
|
|
24975
|
+
target_arn="targetArn",
|
|
24976
|
+
|
|
24977
|
+
# the properties below are optional
|
|
24978
|
+
role=role
|
|
24979
|
+
)
|
|
24980
|
+
'''
|
|
24981
|
+
if __debug__:
|
|
24982
|
+
type_hints = typing.get_type_hints(_typecheckingstub__58b105a4a38be4fd4e5d81c3d78a7d0fc4d3120086f0f1235d58be7e964bf172)
|
|
24983
|
+
check_type(argname="argument lifecycle_stages", value=lifecycle_stages, expected_type=type_hints["lifecycle_stages"])
|
|
24984
|
+
check_type(argname="argument target_arn", value=target_arn, expected_type=type_hints["target_arn"])
|
|
24985
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
24986
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
24987
|
+
"lifecycle_stages": lifecycle_stages,
|
|
24988
|
+
"target_arn": target_arn,
|
|
24989
|
+
}
|
|
24990
|
+
if role is not None:
|
|
24991
|
+
self._values["role"] = role
|
|
24992
|
+
|
|
24993
|
+
@builtins.property
|
|
24994
|
+
def lifecycle_stages(self) -> typing.List["DeploymentLifecycleStage"]:
|
|
24995
|
+
'''The lifecycle stages when this hook should be executed.'''
|
|
24996
|
+
result = self._values.get("lifecycle_stages")
|
|
24997
|
+
assert result is not None, "Required property 'lifecycle_stages' is missing"
|
|
24998
|
+
return typing.cast(typing.List["DeploymentLifecycleStage"], result)
|
|
24999
|
+
|
|
25000
|
+
@builtins.property
|
|
25001
|
+
def target_arn(self) -> builtins.str:
|
|
25002
|
+
'''The ARN of the target resource.'''
|
|
25003
|
+
result = self._values.get("target_arn")
|
|
25004
|
+
assert result is not None, "Required property 'target_arn' is missing"
|
|
25005
|
+
return typing.cast(builtins.str, result)
|
|
25006
|
+
|
|
25007
|
+
@builtins.property
|
|
25008
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
25009
|
+
'''The IAM role that grants permissions to invoke the target.
|
|
25010
|
+
|
|
25011
|
+
:default: - a role will be created automatically
|
|
25012
|
+
'''
|
|
25013
|
+
result = self._values.get("role")
|
|
25014
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
25015
|
+
|
|
25016
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
25017
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
25018
|
+
|
|
25019
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
25020
|
+
return not (rhs == self)
|
|
25021
|
+
|
|
25022
|
+
def __repr__(self) -> str:
|
|
25023
|
+
return "DeploymentLifecycleHookTargetConfig(%s)" % ", ".join(
|
|
25024
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
25025
|
+
)
|
|
25026
|
+
|
|
25027
|
+
|
|
25028
|
+
@jsii.data_type(
|
|
25029
|
+
jsii_type="aws-cdk-lib.aws_ecs.DeploymentLifecycleLambdaTargetProps",
|
|
25030
|
+
jsii_struct_bases=[],
|
|
25031
|
+
name_mapping={"lifecycle_stages": "lifecycleStages", "role": "role"},
|
|
25032
|
+
)
|
|
25033
|
+
class DeploymentLifecycleLambdaTargetProps:
|
|
25034
|
+
def __init__(
|
|
25035
|
+
self,
|
|
25036
|
+
*,
|
|
25037
|
+
lifecycle_stages: typing.Sequence["DeploymentLifecycleStage"],
|
|
25038
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
25039
|
+
) -> None:
|
|
25040
|
+
'''Configuration for a lambda deployment lifecycle hook.
|
|
25041
|
+
|
|
25042
|
+
:param lifecycle_stages: The lifecycle stages when this hook should be executed.
|
|
25043
|
+
:param role: The IAM role that grants permissions to invoke the lambda target. Default: - A unique role will be generated for this lambda function.
|
|
25044
|
+
|
|
25045
|
+
:exampleMetadata: infused
|
|
25046
|
+
|
|
25047
|
+
Example::
|
|
25048
|
+
|
|
25049
|
+
import aws_cdk.aws_lambda as lambda_
|
|
25050
|
+
|
|
25051
|
+
# cluster: ecs.Cluster
|
|
25052
|
+
# task_definition: ecs.TaskDefinition
|
|
25053
|
+
# lambda_hook: lambda.Function
|
|
25054
|
+
# blue_target_group: elbv2.ApplicationTargetGroup
|
|
25055
|
+
# green_target_group: elbv2.ApplicationTargetGroup
|
|
25056
|
+
# prod_listener_rule: elbv2.ApplicationListenerRule
|
|
25057
|
+
|
|
25058
|
+
|
|
25059
|
+
service = ecs.FargateService(self, "Service",
|
|
25060
|
+
cluster=cluster,
|
|
25061
|
+
task_definition=task_definition,
|
|
25062
|
+
deployment_strategy=ecs.DeploymentStrategy.BLUE_GREEN
|
|
25063
|
+
)
|
|
25064
|
+
|
|
25065
|
+
service.add_lifecycle_hook(ecs.DeploymentLifecycleLambdaTarget(lambda_hook, "PreScaleHook",
|
|
25066
|
+
lifecycle_stages=[ecs.DeploymentLifecycleStage.PRE_SCALE_UP]
|
|
25067
|
+
))
|
|
25068
|
+
|
|
25069
|
+
target = service.load_balancer_target(
|
|
25070
|
+
container_name="nginx",
|
|
25071
|
+
container_port=80,
|
|
25072
|
+
protocol=ecs.Protocol.TCP,
|
|
25073
|
+
alternate_target=ecs.AlternateTarget("AlternateTarget",
|
|
25074
|
+
alternate_target_group=green_target_group,
|
|
25075
|
+
production_listener=ecs.ListenerRuleConfiguration.application_listener_rule(prod_listener_rule)
|
|
25076
|
+
)
|
|
25077
|
+
)
|
|
25078
|
+
|
|
25079
|
+
target.attach_to_application_target_group(blue_target_group)
|
|
25080
|
+
'''
|
|
25081
|
+
if __debug__:
|
|
25082
|
+
type_hints = typing.get_type_hints(_typecheckingstub__e812b4c257c9817fdc66c09cfbc9ed6c2dae75feb52fdb91c33339837dbb883c)
|
|
25083
|
+
check_type(argname="argument lifecycle_stages", value=lifecycle_stages, expected_type=type_hints["lifecycle_stages"])
|
|
25084
|
+
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
25085
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
25086
|
+
"lifecycle_stages": lifecycle_stages,
|
|
25087
|
+
}
|
|
25088
|
+
if role is not None:
|
|
25089
|
+
self._values["role"] = role
|
|
25090
|
+
|
|
25091
|
+
@builtins.property
|
|
25092
|
+
def lifecycle_stages(self) -> typing.List["DeploymentLifecycleStage"]:
|
|
25093
|
+
'''The lifecycle stages when this hook should be executed.'''
|
|
25094
|
+
result = self._values.get("lifecycle_stages")
|
|
25095
|
+
assert result is not None, "Required property 'lifecycle_stages' is missing"
|
|
25096
|
+
return typing.cast(typing.List["DeploymentLifecycleStage"], result)
|
|
25097
|
+
|
|
25098
|
+
@builtins.property
|
|
25099
|
+
def role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
25100
|
+
'''The IAM role that grants permissions to invoke the lambda target.
|
|
25101
|
+
|
|
25102
|
+
:default: - A unique role will be generated for this lambda function.
|
|
25103
|
+
'''
|
|
25104
|
+
result = self._values.get("role")
|
|
25105
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
25106
|
+
|
|
25107
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
25108
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
25109
|
+
|
|
25110
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
25111
|
+
return not (rhs == self)
|
|
25112
|
+
|
|
25113
|
+
def __repr__(self) -> str:
|
|
25114
|
+
return "DeploymentLifecycleLambdaTargetProps(%s)" % ", ".join(
|
|
25115
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
25116
|
+
)
|
|
25117
|
+
|
|
25118
|
+
|
|
25119
|
+
@jsii.enum(jsii_type="aws-cdk-lib.aws_ecs.DeploymentLifecycleStage")
|
|
25120
|
+
class DeploymentLifecycleStage(enum.Enum):
|
|
25121
|
+
'''Deployment lifecycle stages where hooks can be executed.
|
|
25122
|
+
|
|
25123
|
+
:exampleMetadata: infused
|
|
25124
|
+
|
|
25125
|
+
Example::
|
|
25126
|
+
|
|
25127
|
+
import aws_cdk.aws_lambda as lambda_
|
|
25128
|
+
|
|
25129
|
+
# cluster: ecs.Cluster
|
|
25130
|
+
# task_definition: ecs.TaskDefinition
|
|
25131
|
+
# lambda_hook: lambda.Function
|
|
25132
|
+
# blue_target_group: elbv2.ApplicationTargetGroup
|
|
25133
|
+
# green_target_group: elbv2.ApplicationTargetGroup
|
|
25134
|
+
# prod_listener_rule: elbv2.ApplicationListenerRule
|
|
25135
|
+
|
|
25136
|
+
|
|
25137
|
+
service = ecs.FargateService(self, "Service",
|
|
25138
|
+
cluster=cluster,
|
|
25139
|
+
task_definition=task_definition,
|
|
25140
|
+
deployment_strategy=ecs.DeploymentStrategy.BLUE_GREEN
|
|
25141
|
+
)
|
|
25142
|
+
|
|
25143
|
+
service.add_lifecycle_hook(ecs.DeploymentLifecycleLambdaTarget(lambda_hook, "PreScaleHook",
|
|
25144
|
+
lifecycle_stages=[ecs.DeploymentLifecycleStage.PRE_SCALE_UP]
|
|
25145
|
+
))
|
|
25146
|
+
|
|
25147
|
+
target = service.load_balancer_target(
|
|
25148
|
+
container_name="nginx",
|
|
25149
|
+
container_port=80,
|
|
25150
|
+
protocol=ecs.Protocol.TCP,
|
|
25151
|
+
alternate_target=ecs.AlternateTarget("AlternateTarget",
|
|
25152
|
+
alternate_target_group=green_target_group,
|
|
25153
|
+
production_listener=ecs.ListenerRuleConfiguration.application_listener_rule(prod_listener_rule)
|
|
25154
|
+
)
|
|
25155
|
+
)
|
|
25156
|
+
|
|
25157
|
+
target.attach_to_application_target_group(blue_target_group)
|
|
25158
|
+
'''
|
|
25159
|
+
|
|
25160
|
+
RECONCILE_SERVICE = "RECONCILE_SERVICE"
|
|
25161
|
+
'''Execute during service reconciliation.'''
|
|
25162
|
+
PRE_SCALE_UP = "PRE_SCALE_UP"
|
|
25163
|
+
'''Execute before scaling up tasks.'''
|
|
25164
|
+
POST_SCALE_UP = "POST_SCALE_UP"
|
|
25165
|
+
'''Execute after scaling up tasks.'''
|
|
25166
|
+
TEST_TRAFFIC_SHIFT = "TEST_TRAFFIC_SHIFT"
|
|
25167
|
+
'''Execute during test traffic shift.'''
|
|
25168
|
+
POST_TEST_TRAFFIC_SHIFT = "POST_TEST_TRAFFIC_SHIFT"
|
|
25169
|
+
'''Execute after test traffic shift.'''
|
|
25170
|
+
PRODUCTION_TRAFFIC_SHIFT = "PRODUCTION_TRAFFIC_SHIFT"
|
|
25171
|
+
'''Execute during production traffic shift.'''
|
|
25172
|
+
POST_PRODUCTION_TRAFFIC_SHIFT = "POST_PRODUCTION_TRAFFIC_SHIFT"
|
|
25173
|
+
'''Execute after production traffic shift.'''
|
|
25174
|
+
|
|
25175
|
+
|
|
25176
|
+
@jsii.enum(jsii_type="aws-cdk-lib.aws_ecs.DeploymentStrategy")
|
|
25177
|
+
class DeploymentStrategy(enum.Enum):
|
|
25178
|
+
'''The deployment stratergy to use for ECS controller.
|
|
25179
|
+
|
|
25180
|
+
:exampleMetadata: infused
|
|
25181
|
+
|
|
25182
|
+
Example::
|
|
25183
|
+
|
|
25184
|
+
import aws_cdk.aws_lambda as lambda_
|
|
25185
|
+
|
|
25186
|
+
# cluster: ecs.Cluster
|
|
25187
|
+
# task_definition: ecs.TaskDefinition
|
|
25188
|
+
# lambda_hook: lambda.Function
|
|
25189
|
+
# blue_target_group: elbv2.ApplicationTargetGroup
|
|
25190
|
+
# green_target_group: elbv2.ApplicationTargetGroup
|
|
25191
|
+
# prod_listener_rule: elbv2.ApplicationListenerRule
|
|
25192
|
+
|
|
25193
|
+
|
|
25194
|
+
service = ecs.FargateService(self, "Service",
|
|
25195
|
+
cluster=cluster,
|
|
25196
|
+
task_definition=task_definition,
|
|
25197
|
+
deployment_strategy=ecs.DeploymentStrategy.BLUE_GREEN
|
|
25198
|
+
)
|
|
25199
|
+
|
|
25200
|
+
service.add_lifecycle_hook(ecs.DeploymentLifecycleLambdaTarget(lambda_hook, "PreScaleHook",
|
|
25201
|
+
lifecycle_stages=[ecs.DeploymentLifecycleStage.PRE_SCALE_UP]
|
|
25202
|
+
))
|
|
25203
|
+
|
|
25204
|
+
target = service.load_balancer_target(
|
|
25205
|
+
container_name="nginx",
|
|
25206
|
+
container_port=80,
|
|
25207
|
+
protocol=ecs.Protocol.TCP,
|
|
25208
|
+
alternate_target=ecs.AlternateTarget("AlternateTarget",
|
|
25209
|
+
alternate_target_group=green_target_group,
|
|
25210
|
+
production_listener=ecs.ListenerRuleConfiguration.application_listener_rule(prod_listener_rule)
|
|
25211
|
+
)
|
|
25212
|
+
)
|
|
25213
|
+
|
|
25214
|
+
target.attach_to_application_target_group(blue_target_group)
|
|
25215
|
+
'''
|
|
25216
|
+
|
|
25217
|
+
ROLLING = "ROLLING"
|
|
25218
|
+
'''Rolling update deployment.'''
|
|
25219
|
+
BLUE_GREEN = "BLUE_GREEN"
|
|
25220
|
+
'''Blue/green deployment.'''
|
|
25221
|
+
|
|
25222
|
+
|
|
24424
25223
|
@jsii.data_type(
|
|
24425
25224
|
jsii_type="aws-cdk-lib.aws_ecs.Device",
|
|
24426
25225
|
jsii_struct_bases=[],
|
|
@@ -25023,15 +25822,18 @@ class Ec2ServiceAttributes:
|
|
|
25023
25822
|
jsii_struct_bases=[BaseServiceOptions],
|
|
25024
25823
|
name_mapping={
|
|
25025
25824
|
"cluster": "cluster",
|
|
25825
|
+
"bake_time": "bakeTime",
|
|
25026
25826
|
"capacity_provider_strategies": "capacityProviderStrategies",
|
|
25027
25827
|
"circuit_breaker": "circuitBreaker",
|
|
25028
25828
|
"cloud_map_options": "cloudMapOptions",
|
|
25029
25829
|
"deployment_alarms": "deploymentAlarms",
|
|
25030
25830
|
"deployment_controller": "deploymentController",
|
|
25831
|
+
"deployment_strategy": "deploymentStrategy",
|
|
25031
25832
|
"desired_count": "desiredCount",
|
|
25032
25833
|
"enable_ecs_managed_tags": "enableECSManagedTags",
|
|
25033
25834
|
"enable_execute_command": "enableExecuteCommand",
|
|
25034
25835
|
"health_check_grace_period": "healthCheckGracePeriod",
|
|
25836
|
+
"lifecycle_hooks": "lifecycleHooks",
|
|
25035
25837
|
"max_healthy_percent": "maxHealthyPercent",
|
|
25036
25838
|
"min_healthy_percent": "minHealthyPercent",
|
|
25037
25839
|
"propagate_tags": "propagateTags",
|
|
@@ -25054,15 +25856,18 @@ class Ec2ServiceProps(BaseServiceOptions):
|
|
|
25054
25856
|
self,
|
|
25055
25857
|
*,
|
|
25056
25858
|
cluster: "ICluster",
|
|
25859
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
25057
25860
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
25058
25861
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
25059
25862
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
25060
25863
|
deployment_alarms: typing.Optional[typing.Union["DeploymentAlarmConfig", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
25061
25864
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
25865
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
25062
25866
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
25063
25867
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
25064
25868
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
25065
25869
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
25870
|
+
lifecycle_hooks: typing.Optional[typing.Sequence["IDeploymentLifecycleHookTarget"]] = None,
|
|
25066
25871
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
25067
25872
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
25068
25873
|
propagate_tags: typing.Optional["PropagatedTagSource"] = None,
|
|
@@ -25082,15 +25887,18 @@ class Ec2ServiceProps(BaseServiceOptions):
|
|
|
25082
25887
|
'''The properties for defining a service using the EC2 launch type.
|
|
25083
25888
|
|
|
25084
25889
|
:param cluster: The name of the cluster that hosts the service.
|
|
25890
|
+
:param bake_time: bake time minutes for service. Default: - none
|
|
25085
25891
|
:param capacity_provider_strategies: A list of Capacity Provider strategies used to place a service. Default: - undefined
|
|
25086
25892
|
:param circuit_breaker: Whether to enable the deployment circuit breaker. If this property is defined, circuit breaker will be implicitly enabled. Default: - disabled
|
|
25087
25893
|
:param cloud_map_options: The options for configuring an Amazon ECS service to use service discovery. Default: - AWS Cloud Map service discovery is not enabled.
|
|
25088
25894
|
:param deployment_alarms: The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. Default: - No alarms will be monitored during deployment.
|
|
25089
25895
|
:param deployment_controller: Specifies which deployment controller to use for the service. For more information, see `Amazon ECS Deployment Types <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html>`_ Default: - Rolling update (ECS)
|
|
25896
|
+
:param deployment_strategy: The deployment strategy to use for the service. Default: ROLLING
|
|
25090
25897
|
:param desired_count: The desired number of instantiations of the task definition to keep running on the service. Default: - When creating the service, default is 1; when updating the service, default uses the current task number.
|
|
25091
25898
|
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging Your Amazon ECS Resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ Default: false
|
|
25092
25899
|
:param enable_execute_command: Whether to enable the ability to execute into a container. Default: - undefined
|
|
25093
25900
|
:param health_check_grace_period: The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set
|
|
25901
|
+
:param lifecycle_hooks: The lifecycle hooks to execute during deployment stages. Default: - none;
|
|
25094
25902
|
:param max_healthy_percent: The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. Default: - 100 if daemon, otherwise 200
|
|
25095
25903
|
:param min_healthy_percent: The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. Default: - 0 if daemon, otherwise 50
|
|
25096
25904
|
:param propagate_tags: Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE Default: PropagatedTagSource.NONE
|
|
@@ -25152,15 +25960,18 @@ class Ec2ServiceProps(BaseServiceOptions):
|
|
|
25152
25960
|
if __debug__:
|
|
25153
25961
|
type_hints = typing.get_type_hints(_typecheckingstub__95634258086aa3448fbdfd9896017a2cbeb858f382deb61186bb9e22b1ccd366)
|
|
25154
25962
|
check_type(argname="argument cluster", value=cluster, expected_type=type_hints["cluster"])
|
|
25963
|
+
check_type(argname="argument bake_time", value=bake_time, expected_type=type_hints["bake_time"])
|
|
25155
25964
|
check_type(argname="argument capacity_provider_strategies", value=capacity_provider_strategies, expected_type=type_hints["capacity_provider_strategies"])
|
|
25156
25965
|
check_type(argname="argument circuit_breaker", value=circuit_breaker, expected_type=type_hints["circuit_breaker"])
|
|
25157
25966
|
check_type(argname="argument cloud_map_options", value=cloud_map_options, expected_type=type_hints["cloud_map_options"])
|
|
25158
25967
|
check_type(argname="argument deployment_alarms", value=deployment_alarms, expected_type=type_hints["deployment_alarms"])
|
|
25159
25968
|
check_type(argname="argument deployment_controller", value=deployment_controller, expected_type=type_hints["deployment_controller"])
|
|
25969
|
+
check_type(argname="argument deployment_strategy", value=deployment_strategy, expected_type=type_hints["deployment_strategy"])
|
|
25160
25970
|
check_type(argname="argument desired_count", value=desired_count, expected_type=type_hints["desired_count"])
|
|
25161
25971
|
check_type(argname="argument enable_ecs_managed_tags", value=enable_ecs_managed_tags, expected_type=type_hints["enable_ecs_managed_tags"])
|
|
25162
25972
|
check_type(argname="argument enable_execute_command", value=enable_execute_command, expected_type=type_hints["enable_execute_command"])
|
|
25163
25973
|
check_type(argname="argument health_check_grace_period", value=health_check_grace_period, expected_type=type_hints["health_check_grace_period"])
|
|
25974
|
+
check_type(argname="argument lifecycle_hooks", value=lifecycle_hooks, expected_type=type_hints["lifecycle_hooks"])
|
|
25164
25975
|
check_type(argname="argument max_healthy_percent", value=max_healthy_percent, expected_type=type_hints["max_healthy_percent"])
|
|
25165
25976
|
check_type(argname="argument min_healthy_percent", value=min_healthy_percent, expected_type=type_hints["min_healthy_percent"])
|
|
25166
25977
|
check_type(argname="argument propagate_tags", value=propagate_tags, expected_type=type_hints["propagate_tags"])
|
|
@@ -25180,6 +25991,8 @@ class Ec2ServiceProps(BaseServiceOptions):
|
|
|
25180
25991
|
"cluster": cluster,
|
|
25181
25992
|
"task_definition": task_definition,
|
|
25182
25993
|
}
|
|
25994
|
+
if bake_time is not None:
|
|
25995
|
+
self._values["bake_time"] = bake_time
|
|
25183
25996
|
if capacity_provider_strategies is not None:
|
|
25184
25997
|
self._values["capacity_provider_strategies"] = capacity_provider_strategies
|
|
25185
25998
|
if circuit_breaker is not None:
|
|
@@ -25190,6 +26003,8 @@ class Ec2ServiceProps(BaseServiceOptions):
|
|
|
25190
26003
|
self._values["deployment_alarms"] = deployment_alarms
|
|
25191
26004
|
if deployment_controller is not None:
|
|
25192
26005
|
self._values["deployment_controller"] = deployment_controller
|
|
26006
|
+
if deployment_strategy is not None:
|
|
26007
|
+
self._values["deployment_strategy"] = deployment_strategy
|
|
25193
26008
|
if desired_count is not None:
|
|
25194
26009
|
self._values["desired_count"] = desired_count
|
|
25195
26010
|
if enable_ecs_managed_tags is not None:
|
|
@@ -25198,6 +26013,8 @@ class Ec2ServiceProps(BaseServiceOptions):
|
|
|
25198
26013
|
self._values["enable_execute_command"] = enable_execute_command
|
|
25199
26014
|
if health_check_grace_period is not None:
|
|
25200
26015
|
self._values["health_check_grace_period"] = health_check_grace_period
|
|
26016
|
+
if lifecycle_hooks is not None:
|
|
26017
|
+
self._values["lifecycle_hooks"] = lifecycle_hooks
|
|
25201
26018
|
if max_healthy_percent is not None:
|
|
25202
26019
|
self._values["max_healthy_percent"] = max_healthy_percent
|
|
25203
26020
|
if min_healthy_percent is not None:
|
|
@@ -25234,6 +26051,15 @@ class Ec2ServiceProps(BaseServiceOptions):
|
|
|
25234
26051
|
assert result is not None, "Required property 'cluster' is missing"
|
|
25235
26052
|
return typing.cast("ICluster", result)
|
|
25236
26053
|
|
|
26054
|
+
@builtins.property
|
|
26055
|
+
def bake_time(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
26056
|
+
'''bake time minutes for service.
|
|
26057
|
+
|
|
26058
|
+
:default: - none
|
|
26059
|
+
'''
|
|
26060
|
+
result = self._values.get("bake_time")
|
|
26061
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
26062
|
+
|
|
25237
26063
|
@builtins.property
|
|
25238
26064
|
def capacity_provider_strategies(
|
|
25239
26065
|
self,
|
|
@@ -25287,6 +26113,15 @@ class Ec2ServiceProps(BaseServiceOptions):
|
|
|
25287
26113
|
result = self._values.get("deployment_controller")
|
|
25288
26114
|
return typing.cast(typing.Optional[DeploymentController], result)
|
|
25289
26115
|
|
|
26116
|
+
@builtins.property
|
|
26117
|
+
def deployment_strategy(self) -> typing.Optional[DeploymentStrategy]:
|
|
26118
|
+
'''The deployment strategy to use for the service.
|
|
26119
|
+
|
|
26120
|
+
:default: ROLLING
|
|
26121
|
+
'''
|
|
26122
|
+
result = self._values.get("deployment_strategy")
|
|
26123
|
+
return typing.cast(typing.Optional[DeploymentStrategy], result)
|
|
26124
|
+
|
|
25290
26125
|
@builtins.property
|
|
25291
26126
|
def desired_count(self) -> typing.Optional[jsii.Number]:
|
|
25292
26127
|
'''The desired number of instantiations of the task definition to keep running on the service.
|
|
@@ -25329,6 +26164,17 @@ class Ec2ServiceProps(BaseServiceOptions):
|
|
|
25329
26164
|
result = self._values.get("health_check_grace_period")
|
|
25330
26165
|
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
25331
26166
|
|
|
26167
|
+
@builtins.property
|
|
26168
|
+
def lifecycle_hooks(
|
|
26169
|
+
self,
|
|
26170
|
+
) -> typing.Optional[typing.List["IDeploymentLifecycleHookTarget"]]:
|
|
26171
|
+
'''The lifecycle hooks to execute during deployment stages.
|
|
26172
|
+
|
|
26173
|
+
:default: - none;
|
|
26174
|
+
'''
|
|
26175
|
+
result = self._values.get("lifecycle_hooks")
|
|
26176
|
+
return typing.cast(typing.Optional[typing.List["IDeploymentLifecycleHookTarget"]], result)
|
|
26177
|
+
|
|
25332
26178
|
@builtins.property
|
|
25333
26179
|
def max_healthy_percent(self) -> typing.Optional[jsii.Number]:
|
|
25334
26180
|
'''The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.
|
|
@@ -27044,15 +27890,18 @@ class ExternalServiceAttributes:
|
|
|
27044
27890
|
jsii_struct_bases=[BaseServiceOptions],
|
|
27045
27891
|
name_mapping={
|
|
27046
27892
|
"cluster": "cluster",
|
|
27893
|
+
"bake_time": "bakeTime",
|
|
27047
27894
|
"capacity_provider_strategies": "capacityProviderStrategies",
|
|
27048
27895
|
"circuit_breaker": "circuitBreaker",
|
|
27049
27896
|
"cloud_map_options": "cloudMapOptions",
|
|
27050
27897
|
"deployment_alarms": "deploymentAlarms",
|
|
27051
27898
|
"deployment_controller": "deploymentController",
|
|
27899
|
+
"deployment_strategy": "deploymentStrategy",
|
|
27052
27900
|
"desired_count": "desiredCount",
|
|
27053
27901
|
"enable_ecs_managed_tags": "enableECSManagedTags",
|
|
27054
27902
|
"enable_execute_command": "enableExecuteCommand",
|
|
27055
27903
|
"health_check_grace_period": "healthCheckGracePeriod",
|
|
27904
|
+
"lifecycle_hooks": "lifecycleHooks",
|
|
27056
27905
|
"max_healthy_percent": "maxHealthyPercent",
|
|
27057
27906
|
"min_healthy_percent": "minHealthyPercent",
|
|
27058
27907
|
"propagate_tags": "propagateTags",
|
|
@@ -27070,15 +27919,18 @@ class ExternalServiceProps(BaseServiceOptions):
|
|
|
27070
27919
|
self,
|
|
27071
27920
|
*,
|
|
27072
27921
|
cluster: "ICluster",
|
|
27922
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
27073
27923
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
27074
27924
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
27075
27925
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
27076
27926
|
deployment_alarms: typing.Optional[typing.Union["DeploymentAlarmConfig", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
27077
27927
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
27928
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
27078
27929
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
27079
27930
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
27080
27931
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
27081
27932
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
27933
|
+
lifecycle_hooks: typing.Optional[typing.Sequence["IDeploymentLifecycleHookTarget"]] = None,
|
|
27082
27934
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
27083
27935
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
27084
27936
|
propagate_tags: typing.Optional["PropagatedTagSource"] = None,
|
|
@@ -27093,15 +27945,18 @@ class ExternalServiceProps(BaseServiceOptions):
|
|
|
27093
27945
|
'''The properties for defining a service using the External launch type.
|
|
27094
27946
|
|
|
27095
27947
|
:param cluster: The name of the cluster that hosts the service.
|
|
27948
|
+
:param bake_time: bake time minutes for service. Default: - none
|
|
27096
27949
|
:param capacity_provider_strategies: A list of Capacity Provider strategies used to place a service. Default: - undefined
|
|
27097
27950
|
:param circuit_breaker: Whether to enable the deployment circuit breaker. If this property is defined, circuit breaker will be implicitly enabled. Default: - disabled
|
|
27098
27951
|
:param cloud_map_options: The options for configuring an Amazon ECS service to use service discovery. Default: - AWS Cloud Map service discovery is not enabled.
|
|
27099
27952
|
:param deployment_alarms: The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. Default: - No alarms will be monitored during deployment.
|
|
27100
27953
|
:param deployment_controller: Specifies which deployment controller to use for the service. For more information, see `Amazon ECS Deployment Types <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html>`_ Default: - Rolling update (ECS)
|
|
27954
|
+
:param deployment_strategy: The deployment strategy to use for the service. Default: ROLLING
|
|
27101
27955
|
:param desired_count: The desired number of instantiations of the task definition to keep running on the service. Default: - When creating the service, default is 1; when updating the service, default uses the current task number.
|
|
27102
27956
|
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging Your Amazon ECS Resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ Default: false
|
|
27103
27957
|
:param enable_execute_command: Whether to enable the ability to execute into a container. Default: - undefined
|
|
27104
27958
|
:param health_check_grace_period: The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set
|
|
27959
|
+
:param lifecycle_hooks: The lifecycle hooks to execute during deployment stages. Default: - none;
|
|
27105
27960
|
:param max_healthy_percent: The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. Default: - 100 if daemon, otherwise 200
|
|
27106
27961
|
:param min_healthy_percent: The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. Default: - 0 if daemon, otherwise 50
|
|
27107
27962
|
:param propagate_tags: Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE Default: PropagatedTagSource.NONE
|
|
@@ -27146,15 +28001,18 @@ class ExternalServiceProps(BaseServiceOptions):
|
|
|
27146
28001
|
if __debug__:
|
|
27147
28002
|
type_hints = typing.get_type_hints(_typecheckingstub__3cc413964caae89bfcfbcabff8356ffe5c054f46824be99731a77b64ec052a8a)
|
|
27148
28003
|
check_type(argname="argument cluster", value=cluster, expected_type=type_hints["cluster"])
|
|
28004
|
+
check_type(argname="argument bake_time", value=bake_time, expected_type=type_hints["bake_time"])
|
|
27149
28005
|
check_type(argname="argument capacity_provider_strategies", value=capacity_provider_strategies, expected_type=type_hints["capacity_provider_strategies"])
|
|
27150
28006
|
check_type(argname="argument circuit_breaker", value=circuit_breaker, expected_type=type_hints["circuit_breaker"])
|
|
27151
28007
|
check_type(argname="argument cloud_map_options", value=cloud_map_options, expected_type=type_hints["cloud_map_options"])
|
|
27152
28008
|
check_type(argname="argument deployment_alarms", value=deployment_alarms, expected_type=type_hints["deployment_alarms"])
|
|
27153
28009
|
check_type(argname="argument deployment_controller", value=deployment_controller, expected_type=type_hints["deployment_controller"])
|
|
28010
|
+
check_type(argname="argument deployment_strategy", value=deployment_strategy, expected_type=type_hints["deployment_strategy"])
|
|
27154
28011
|
check_type(argname="argument desired_count", value=desired_count, expected_type=type_hints["desired_count"])
|
|
27155
28012
|
check_type(argname="argument enable_ecs_managed_tags", value=enable_ecs_managed_tags, expected_type=type_hints["enable_ecs_managed_tags"])
|
|
27156
28013
|
check_type(argname="argument enable_execute_command", value=enable_execute_command, expected_type=type_hints["enable_execute_command"])
|
|
27157
28014
|
check_type(argname="argument health_check_grace_period", value=health_check_grace_period, expected_type=type_hints["health_check_grace_period"])
|
|
28015
|
+
check_type(argname="argument lifecycle_hooks", value=lifecycle_hooks, expected_type=type_hints["lifecycle_hooks"])
|
|
27158
28016
|
check_type(argname="argument max_healthy_percent", value=max_healthy_percent, expected_type=type_hints["max_healthy_percent"])
|
|
27159
28017
|
check_type(argname="argument min_healthy_percent", value=min_healthy_percent, expected_type=type_hints["min_healthy_percent"])
|
|
27160
28018
|
check_type(argname="argument propagate_tags", value=propagate_tags, expected_type=type_hints["propagate_tags"])
|
|
@@ -27169,6 +28027,8 @@ class ExternalServiceProps(BaseServiceOptions):
|
|
|
27169
28027
|
"cluster": cluster,
|
|
27170
28028
|
"task_definition": task_definition,
|
|
27171
28029
|
}
|
|
28030
|
+
if bake_time is not None:
|
|
28031
|
+
self._values["bake_time"] = bake_time
|
|
27172
28032
|
if capacity_provider_strategies is not None:
|
|
27173
28033
|
self._values["capacity_provider_strategies"] = capacity_provider_strategies
|
|
27174
28034
|
if circuit_breaker is not None:
|
|
@@ -27179,6 +28039,8 @@ class ExternalServiceProps(BaseServiceOptions):
|
|
|
27179
28039
|
self._values["deployment_alarms"] = deployment_alarms
|
|
27180
28040
|
if deployment_controller is not None:
|
|
27181
28041
|
self._values["deployment_controller"] = deployment_controller
|
|
28042
|
+
if deployment_strategy is not None:
|
|
28043
|
+
self._values["deployment_strategy"] = deployment_strategy
|
|
27182
28044
|
if desired_count is not None:
|
|
27183
28045
|
self._values["desired_count"] = desired_count
|
|
27184
28046
|
if enable_ecs_managed_tags is not None:
|
|
@@ -27187,6 +28049,8 @@ class ExternalServiceProps(BaseServiceOptions):
|
|
|
27187
28049
|
self._values["enable_execute_command"] = enable_execute_command
|
|
27188
28050
|
if health_check_grace_period is not None:
|
|
27189
28051
|
self._values["health_check_grace_period"] = health_check_grace_period
|
|
28052
|
+
if lifecycle_hooks is not None:
|
|
28053
|
+
self._values["lifecycle_hooks"] = lifecycle_hooks
|
|
27190
28054
|
if max_healthy_percent is not None:
|
|
27191
28055
|
self._values["max_healthy_percent"] = max_healthy_percent
|
|
27192
28056
|
if min_healthy_percent is not None:
|
|
@@ -27213,6 +28077,15 @@ class ExternalServiceProps(BaseServiceOptions):
|
|
|
27213
28077
|
assert result is not None, "Required property 'cluster' is missing"
|
|
27214
28078
|
return typing.cast("ICluster", result)
|
|
27215
28079
|
|
|
28080
|
+
@builtins.property
|
|
28081
|
+
def bake_time(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
28082
|
+
'''bake time minutes for service.
|
|
28083
|
+
|
|
28084
|
+
:default: - none
|
|
28085
|
+
'''
|
|
28086
|
+
result = self._values.get("bake_time")
|
|
28087
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
28088
|
+
|
|
27216
28089
|
@builtins.property
|
|
27217
28090
|
def capacity_provider_strategies(
|
|
27218
28091
|
self,
|
|
@@ -27266,6 +28139,15 @@ class ExternalServiceProps(BaseServiceOptions):
|
|
|
27266
28139
|
result = self._values.get("deployment_controller")
|
|
27267
28140
|
return typing.cast(typing.Optional[DeploymentController], result)
|
|
27268
28141
|
|
|
28142
|
+
@builtins.property
|
|
28143
|
+
def deployment_strategy(self) -> typing.Optional[DeploymentStrategy]:
|
|
28144
|
+
'''The deployment strategy to use for the service.
|
|
28145
|
+
|
|
28146
|
+
:default: ROLLING
|
|
28147
|
+
'''
|
|
28148
|
+
result = self._values.get("deployment_strategy")
|
|
28149
|
+
return typing.cast(typing.Optional[DeploymentStrategy], result)
|
|
28150
|
+
|
|
27269
28151
|
@builtins.property
|
|
27270
28152
|
def desired_count(self) -> typing.Optional[jsii.Number]:
|
|
27271
28153
|
'''The desired number of instantiations of the task definition to keep running on the service.
|
|
@@ -27308,6 +28190,17 @@ class ExternalServiceProps(BaseServiceOptions):
|
|
|
27308
28190
|
result = self._values.get("health_check_grace_period")
|
|
27309
28191
|
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
27310
28192
|
|
|
28193
|
+
@builtins.property
|
|
28194
|
+
def lifecycle_hooks(
|
|
28195
|
+
self,
|
|
28196
|
+
) -> typing.Optional[typing.List["IDeploymentLifecycleHookTarget"]]:
|
|
28197
|
+
'''The lifecycle hooks to execute during deployment stages.
|
|
28198
|
+
|
|
28199
|
+
:default: - none;
|
|
28200
|
+
'''
|
|
28201
|
+
result = self._values.get("lifecycle_hooks")
|
|
28202
|
+
return typing.cast(typing.Optional[typing.List["IDeploymentLifecycleHookTarget"]], result)
|
|
28203
|
+
|
|
27311
28204
|
@builtins.property
|
|
27312
28205
|
def max_healthy_percent(self) -> typing.Optional[jsii.Number]:
|
|
27313
28206
|
'''The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.
|
|
@@ -27888,15 +28781,18 @@ class FargateServiceAttributes:
|
|
|
27888
28781
|
jsii_struct_bases=[BaseServiceOptions],
|
|
27889
28782
|
name_mapping={
|
|
27890
28783
|
"cluster": "cluster",
|
|
28784
|
+
"bake_time": "bakeTime",
|
|
27891
28785
|
"capacity_provider_strategies": "capacityProviderStrategies",
|
|
27892
28786
|
"circuit_breaker": "circuitBreaker",
|
|
27893
28787
|
"cloud_map_options": "cloudMapOptions",
|
|
27894
28788
|
"deployment_alarms": "deploymentAlarms",
|
|
27895
28789
|
"deployment_controller": "deploymentController",
|
|
28790
|
+
"deployment_strategy": "deploymentStrategy",
|
|
27896
28791
|
"desired_count": "desiredCount",
|
|
27897
28792
|
"enable_ecs_managed_tags": "enableECSManagedTags",
|
|
27898
28793
|
"enable_execute_command": "enableExecuteCommand",
|
|
27899
28794
|
"health_check_grace_period": "healthCheckGracePeriod",
|
|
28795
|
+
"lifecycle_hooks": "lifecycleHooks",
|
|
27900
28796
|
"max_healthy_percent": "maxHealthyPercent",
|
|
27901
28797
|
"min_healthy_percent": "minHealthyPercent",
|
|
27902
28798
|
"propagate_tags": "propagateTags",
|
|
@@ -27917,15 +28813,18 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
27917
28813
|
self,
|
|
27918
28814
|
*,
|
|
27919
28815
|
cluster: "ICluster",
|
|
28816
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
27920
28817
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
27921
28818
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
27922
28819
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
27923
28820
|
deployment_alarms: typing.Optional[typing.Union["DeploymentAlarmConfig", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
27924
28821
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
28822
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
27925
28823
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
27926
28824
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
27927
28825
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
27928
28826
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
28827
|
+
lifecycle_hooks: typing.Optional[typing.Sequence["IDeploymentLifecycleHookTarget"]] = None,
|
|
27929
28828
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
27930
28829
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
27931
28830
|
propagate_tags: typing.Optional["PropagatedTagSource"] = None,
|
|
@@ -27943,15 +28842,18 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
27943
28842
|
'''The properties for defining a service using the Fargate launch type.
|
|
27944
28843
|
|
|
27945
28844
|
:param cluster: The name of the cluster that hosts the service.
|
|
28845
|
+
:param bake_time: bake time minutes for service. Default: - none
|
|
27946
28846
|
:param capacity_provider_strategies: A list of Capacity Provider strategies used to place a service. Default: - undefined
|
|
27947
28847
|
:param circuit_breaker: Whether to enable the deployment circuit breaker. If this property is defined, circuit breaker will be implicitly enabled. Default: - disabled
|
|
27948
28848
|
:param cloud_map_options: The options for configuring an Amazon ECS service to use service discovery. Default: - AWS Cloud Map service discovery is not enabled.
|
|
27949
28849
|
:param deployment_alarms: The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. Default: - No alarms will be monitored during deployment.
|
|
27950
28850
|
:param deployment_controller: Specifies which deployment controller to use for the service. For more information, see `Amazon ECS Deployment Types <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html>`_ Default: - Rolling update (ECS)
|
|
28851
|
+
:param deployment_strategy: The deployment strategy to use for the service. Default: ROLLING
|
|
27951
28852
|
:param desired_count: The desired number of instantiations of the task definition to keep running on the service. Default: - When creating the service, default is 1; when updating the service, default uses the current task number.
|
|
27952
28853
|
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging Your Amazon ECS Resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ Default: false
|
|
27953
28854
|
:param enable_execute_command: Whether to enable the ability to execute into a container. Default: - undefined
|
|
27954
28855
|
:param health_check_grace_period: The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set
|
|
28856
|
+
:param lifecycle_hooks: The lifecycle hooks to execute during deployment stages. Default: - none;
|
|
27955
28857
|
:param max_healthy_percent: The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. Default: - 100 if daemon, otherwise 200
|
|
27956
28858
|
:param min_healthy_percent: The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. Default: - 0 if daemon, otherwise 50
|
|
27957
28859
|
:param propagate_tags: Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE Default: PropagatedTagSource.NONE
|
|
@@ -27974,28 +28876,34 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
27974
28876
|
|
|
27975
28877
|
# cluster: ecs.Cluster
|
|
27976
28878
|
# task_definition: ecs.TaskDefinition
|
|
27977
|
-
# elb_alarm: cw.Alarm
|
|
27978
|
-
|
|
27979
28879
|
|
|
28880
|
+
service_name = "MyFargateService"
|
|
27980
28881
|
service = ecs.FargateService(self, "Service",
|
|
28882
|
+
service_name=service_name,
|
|
27981
28883
|
cluster=cluster,
|
|
27982
28884
|
task_definition=task_definition,
|
|
27983
|
-
min_healthy_percent=100
|
|
27984
|
-
deployment_alarms=ecs.DeploymentAlarmConfig(
|
|
27985
|
-
alarm_names=[elb_alarm.alarm_name],
|
|
27986
|
-
behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
|
|
27987
|
-
)
|
|
28885
|
+
min_healthy_percent=100
|
|
27988
28886
|
)
|
|
27989
28887
|
|
|
27990
|
-
|
|
27991
|
-
|
|
27992
|
-
|
|
27993
|
-
|
|
27994
|
-
|
|
28888
|
+
cpu_metric = cw.Metric(
|
|
28889
|
+
metric_name="CPUUtilization",
|
|
28890
|
+
namespace="AWS/ECS",
|
|
28891
|
+
period=Duration.minutes(5),
|
|
28892
|
+
statistic="Average",
|
|
28893
|
+
dimensions_map={
|
|
28894
|
+
"ClusterName": cluster.cluster_name,
|
|
28895
|
+
# Using `service.serviceName` here will cause a circular dependency
|
|
28896
|
+
"ServiceName": service_name
|
|
28897
|
+
}
|
|
28898
|
+
)
|
|
28899
|
+
my_alarm = cw.Alarm(self, "CPUAlarm",
|
|
28900
|
+
alarm_name="cpuAlarmName",
|
|
28901
|
+
metric=cpu_metric,
|
|
27995
28902
|
evaluation_periods=2,
|
|
27996
28903
|
threshold=80
|
|
27997
28904
|
)
|
|
27998
|
-
|
|
28905
|
+
|
|
28906
|
+
service.enable_deployment_alarms([my_alarm.alarm_name],
|
|
27999
28907
|
behavior=ecs.AlarmBehavior.FAIL_ON_ALARM
|
|
28000
28908
|
)
|
|
28001
28909
|
'''
|
|
@@ -28014,15 +28922,18 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
28014
28922
|
if __debug__:
|
|
28015
28923
|
type_hints = typing.get_type_hints(_typecheckingstub__8290283f61f3e2d289b7e7f81cad1a5d1e9ed9dbc07ccce2b57604682a42ded7)
|
|
28016
28924
|
check_type(argname="argument cluster", value=cluster, expected_type=type_hints["cluster"])
|
|
28925
|
+
check_type(argname="argument bake_time", value=bake_time, expected_type=type_hints["bake_time"])
|
|
28017
28926
|
check_type(argname="argument capacity_provider_strategies", value=capacity_provider_strategies, expected_type=type_hints["capacity_provider_strategies"])
|
|
28018
28927
|
check_type(argname="argument circuit_breaker", value=circuit_breaker, expected_type=type_hints["circuit_breaker"])
|
|
28019
28928
|
check_type(argname="argument cloud_map_options", value=cloud_map_options, expected_type=type_hints["cloud_map_options"])
|
|
28020
28929
|
check_type(argname="argument deployment_alarms", value=deployment_alarms, expected_type=type_hints["deployment_alarms"])
|
|
28021
28930
|
check_type(argname="argument deployment_controller", value=deployment_controller, expected_type=type_hints["deployment_controller"])
|
|
28931
|
+
check_type(argname="argument deployment_strategy", value=deployment_strategy, expected_type=type_hints["deployment_strategy"])
|
|
28022
28932
|
check_type(argname="argument desired_count", value=desired_count, expected_type=type_hints["desired_count"])
|
|
28023
28933
|
check_type(argname="argument enable_ecs_managed_tags", value=enable_ecs_managed_tags, expected_type=type_hints["enable_ecs_managed_tags"])
|
|
28024
28934
|
check_type(argname="argument enable_execute_command", value=enable_execute_command, expected_type=type_hints["enable_execute_command"])
|
|
28025
28935
|
check_type(argname="argument health_check_grace_period", value=health_check_grace_period, expected_type=type_hints["health_check_grace_period"])
|
|
28936
|
+
check_type(argname="argument lifecycle_hooks", value=lifecycle_hooks, expected_type=type_hints["lifecycle_hooks"])
|
|
28026
28937
|
check_type(argname="argument max_healthy_percent", value=max_healthy_percent, expected_type=type_hints["max_healthy_percent"])
|
|
28027
28938
|
check_type(argname="argument min_healthy_percent", value=min_healthy_percent, expected_type=type_hints["min_healthy_percent"])
|
|
28028
28939
|
check_type(argname="argument propagate_tags", value=propagate_tags, expected_type=type_hints["propagate_tags"])
|
|
@@ -28040,6 +28951,8 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
28040
28951
|
"cluster": cluster,
|
|
28041
28952
|
"task_definition": task_definition,
|
|
28042
28953
|
}
|
|
28954
|
+
if bake_time is not None:
|
|
28955
|
+
self._values["bake_time"] = bake_time
|
|
28043
28956
|
if capacity_provider_strategies is not None:
|
|
28044
28957
|
self._values["capacity_provider_strategies"] = capacity_provider_strategies
|
|
28045
28958
|
if circuit_breaker is not None:
|
|
@@ -28050,6 +28963,8 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
28050
28963
|
self._values["deployment_alarms"] = deployment_alarms
|
|
28051
28964
|
if deployment_controller is not None:
|
|
28052
28965
|
self._values["deployment_controller"] = deployment_controller
|
|
28966
|
+
if deployment_strategy is not None:
|
|
28967
|
+
self._values["deployment_strategy"] = deployment_strategy
|
|
28053
28968
|
if desired_count is not None:
|
|
28054
28969
|
self._values["desired_count"] = desired_count
|
|
28055
28970
|
if enable_ecs_managed_tags is not None:
|
|
@@ -28058,6 +28973,8 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
28058
28973
|
self._values["enable_execute_command"] = enable_execute_command
|
|
28059
28974
|
if health_check_grace_period is not None:
|
|
28060
28975
|
self._values["health_check_grace_period"] = health_check_grace_period
|
|
28976
|
+
if lifecycle_hooks is not None:
|
|
28977
|
+
self._values["lifecycle_hooks"] = lifecycle_hooks
|
|
28061
28978
|
if max_healthy_percent is not None:
|
|
28062
28979
|
self._values["max_healthy_percent"] = max_healthy_percent
|
|
28063
28980
|
if min_healthy_percent is not None:
|
|
@@ -28090,6 +29007,15 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
28090
29007
|
assert result is not None, "Required property 'cluster' is missing"
|
|
28091
29008
|
return typing.cast("ICluster", result)
|
|
28092
29009
|
|
|
29010
|
+
@builtins.property
|
|
29011
|
+
def bake_time(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
29012
|
+
'''bake time minutes for service.
|
|
29013
|
+
|
|
29014
|
+
:default: - none
|
|
29015
|
+
'''
|
|
29016
|
+
result = self._values.get("bake_time")
|
|
29017
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
29018
|
+
|
|
28093
29019
|
@builtins.property
|
|
28094
29020
|
def capacity_provider_strategies(
|
|
28095
29021
|
self,
|
|
@@ -28143,6 +29069,15 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
28143
29069
|
result = self._values.get("deployment_controller")
|
|
28144
29070
|
return typing.cast(typing.Optional[DeploymentController], result)
|
|
28145
29071
|
|
|
29072
|
+
@builtins.property
|
|
29073
|
+
def deployment_strategy(self) -> typing.Optional[DeploymentStrategy]:
|
|
29074
|
+
'''The deployment strategy to use for the service.
|
|
29075
|
+
|
|
29076
|
+
:default: ROLLING
|
|
29077
|
+
'''
|
|
29078
|
+
result = self._values.get("deployment_strategy")
|
|
29079
|
+
return typing.cast(typing.Optional[DeploymentStrategy], result)
|
|
29080
|
+
|
|
28146
29081
|
@builtins.property
|
|
28147
29082
|
def desired_count(self) -> typing.Optional[jsii.Number]:
|
|
28148
29083
|
'''The desired number of instantiations of the task definition to keep running on the service.
|
|
@@ -28185,6 +29120,17 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
28185
29120
|
result = self._values.get("health_check_grace_period")
|
|
28186
29121
|
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
28187
29122
|
|
|
29123
|
+
@builtins.property
|
|
29124
|
+
def lifecycle_hooks(
|
|
29125
|
+
self,
|
|
29126
|
+
) -> typing.Optional[typing.List["IDeploymentLifecycleHookTarget"]]:
|
|
29127
|
+
'''The lifecycle hooks to execute during deployment stages.
|
|
29128
|
+
|
|
29129
|
+
:default: - none;
|
|
29130
|
+
'''
|
|
29131
|
+
result = self._values.get("lifecycle_hooks")
|
|
29132
|
+
return typing.cast(typing.Optional[typing.List["IDeploymentLifecycleHookTarget"]], result)
|
|
29133
|
+
|
|
28188
29134
|
@builtins.property
|
|
28189
29135
|
def max_healthy_percent(self) -> typing.Optional[jsii.Number]:
|
|
28190
29136
|
'''The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment.
|
|
@@ -31828,6 +32774,43 @@ class Host:
|
|
|
31828
32774
|
)
|
|
31829
32775
|
|
|
31830
32776
|
|
|
32777
|
+
@jsii.interface(jsii_type="aws-cdk-lib.aws_ecs.IAlternateTarget")
|
|
32778
|
+
class IAlternateTarget(typing_extensions.Protocol):
|
|
32779
|
+
'''Interface for configuring alternate target groups for blue/green deployments.'''
|
|
32780
|
+
|
|
32781
|
+
@jsii.member(jsii_name="bind")
|
|
32782
|
+
def bind(self, scope: _constructs_77d1e7e8.IConstruct) -> AlternateTargetConfig:
|
|
32783
|
+
'''Bind this configuration to a service.
|
|
32784
|
+
|
|
32785
|
+
:param scope: The construct scope.
|
|
32786
|
+
|
|
32787
|
+
:return: The configuration to apply to the service
|
|
32788
|
+
'''
|
|
32789
|
+
...
|
|
32790
|
+
|
|
32791
|
+
|
|
32792
|
+
class _IAlternateTargetProxy:
|
|
32793
|
+
'''Interface for configuring alternate target groups for blue/green deployments.'''
|
|
32794
|
+
|
|
32795
|
+
__jsii_type__: typing.ClassVar[str] = "aws-cdk-lib.aws_ecs.IAlternateTarget"
|
|
32796
|
+
|
|
32797
|
+
@jsii.member(jsii_name="bind")
|
|
32798
|
+
def bind(self, scope: _constructs_77d1e7e8.IConstruct) -> AlternateTargetConfig:
|
|
32799
|
+
'''Bind this configuration to a service.
|
|
32800
|
+
|
|
32801
|
+
:param scope: The construct scope.
|
|
32802
|
+
|
|
32803
|
+
:return: The configuration to apply to the service
|
|
32804
|
+
'''
|
|
32805
|
+
if __debug__:
|
|
32806
|
+
type_hints = typing.get_type_hints(_typecheckingstub__1f10764be69e962209020c3a7e772567f1cbc3d3673cf209506562511ce9cd0a)
|
|
32807
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
32808
|
+
return typing.cast(AlternateTargetConfig, jsii.invoke(self, "bind", [scope]))
|
|
32809
|
+
|
|
32810
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
|
|
32811
|
+
typing.cast(typing.Any, IAlternateTarget).__jsii_proxy_class__ = lambda : _IAlternateTargetProxy
|
|
32812
|
+
|
|
32813
|
+
|
|
31831
32814
|
@jsii.interface(jsii_type="aws-cdk-lib.aws_ecs.ICluster")
|
|
31832
32815
|
class ICluster(_IResource_c80c4260, typing_extensions.Protocol):
|
|
31833
32816
|
'''A regional grouping of one or more container instances on which you can run tasks and services.'''
|
|
@@ -31956,6 +32939,45 @@ class _IClusterProxy(
|
|
|
31956
32939
|
typing.cast(typing.Any, ICluster).__jsii_proxy_class__ = lambda : _IClusterProxy
|
|
31957
32940
|
|
|
31958
32941
|
|
|
32942
|
+
@jsii.interface(jsii_type="aws-cdk-lib.aws_ecs.IDeploymentLifecycleHookTarget")
|
|
32943
|
+
class IDeploymentLifecycleHookTarget(typing_extensions.Protocol):
|
|
32944
|
+
'''Interface for deployment lifecycle hook targets.'''
|
|
32945
|
+
|
|
32946
|
+
@jsii.member(jsii_name="bind")
|
|
32947
|
+
def bind(
|
|
32948
|
+
self,
|
|
32949
|
+
scope: _constructs_77d1e7e8.IConstruct,
|
|
32950
|
+
) -> DeploymentLifecycleHookTargetConfig:
|
|
32951
|
+
'''Bind this target to a deployment lifecycle hook.
|
|
32952
|
+
|
|
32953
|
+
:param scope: The construct scope.
|
|
32954
|
+
'''
|
|
32955
|
+
...
|
|
32956
|
+
|
|
32957
|
+
|
|
32958
|
+
class _IDeploymentLifecycleHookTargetProxy:
|
|
32959
|
+
'''Interface for deployment lifecycle hook targets.'''
|
|
32960
|
+
|
|
32961
|
+
__jsii_type__: typing.ClassVar[str] = "aws-cdk-lib.aws_ecs.IDeploymentLifecycleHookTarget"
|
|
32962
|
+
|
|
32963
|
+
@jsii.member(jsii_name="bind")
|
|
32964
|
+
def bind(
|
|
32965
|
+
self,
|
|
32966
|
+
scope: _constructs_77d1e7e8.IConstruct,
|
|
32967
|
+
) -> DeploymentLifecycleHookTargetConfig:
|
|
32968
|
+
'''Bind this target to a deployment lifecycle hook.
|
|
32969
|
+
|
|
32970
|
+
:param scope: The construct scope.
|
|
32971
|
+
'''
|
|
32972
|
+
if __debug__:
|
|
32973
|
+
type_hints = typing.get_type_hints(_typecheckingstub__1cdcc51dc61399e62078243a225e42fd6901317236efebe039a9e3b36834d4b7)
|
|
32974
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
32975
|
+
return typing.cast(DeploymentLifecycleHookTargetConfig, jsii.invoke(self, "bind", [scope]))
|
|
32976
|
+
|
|
32977
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
|
|
32978
|
+
typing.cast(typing.Any, IDeploymentLifecycleHookTarget).__jsii_proxy_class__ = lambda : _IDeploymentLifecycleHookTargetProxy
|
|
32979
|
+
|
|
32980
|
+
|
|
31959
32981
|
@jsii.interface(jsii_type="aws-cdk-lib.aws_ecs.IEcsLoadBalancerTarget")
|
|
31960
32982
|
class IEcsLoadBalancerTarget(
|
|
31961
32983
|
_IApplicationLoadBalancerTarget_fabf9003,
|
|
@@ -33030,11 +34052,96 @@ class _ListenerConfigProxy(ListenerConfig):
|
|
|
33030
34052
|
typing.cast(typing.Any, ListenerConfig).__jsii_proxy_class__ = lambda : _ListenerConfigProxy
|
|
33031
34053
|
|
|
33032
34054
|
|
|
34055
|
+
class ListenerRuleConfiguration(
|
|
34056
|
+
metaclass=jsii.JSIIAbstractClass,
|
|
34057
|
+
jsii_type="aws-cdk-lib.aws_ecs.ListenerRuleConfiguration",
|
|
34058
|
+
):
|
|
34059
|
+
'''Represents a listener configuration for advanced load balancer settings.
|
|
34060
|
+
|
|
34061
|
+
:exampleMetadata: infused
|
|
34062
|
+
|
|
34063
|
+
Example::
|
|
34064
|
+
|
|
34065
|
+
import aws_cdk.aws_lambda as lambda_
|
|
34066
|
+
|
|
34067
|
+
# cluster: ecs.Cluster
|
|
34068
|
+
# task_definition: ecs.TaskDefinition
|
|
34069
|
+
# lambda_hook: lambda.Function
|
|
34070
|
+
# blue_target_group: elbv2.ApplicationTargetGroup
|
|
34071
|
+
# green_target_group: elbv2.ApplicationTargetGroup
|
|
34072
|
+
# prod_listener_rule: elbv2.ApplicationListenerRule
|
|
34073
|
+
|
|
34074
|
+
|
|
34075
|
+
service = ecs.FargateService(self, "Service",
|
|
34076
|
+
cluster=cluster,
|
|
34077
|
+
task_definition=task_definition,
|
|
34078
|
+
deployment_strategy=ecs.DeploymentStrategy.BLUE_GREEN
|
|
34079
|
+
)
|
|
34080
|
+
|
|
34081
|
+
service.add_lifecycle_hook(ecs.DeploymentLifecycleLambdaTarget(lambda_hook, "PreScaleHook",
|
|
34082
|
+
lifecycle_stages=[ecs.DeploymentLifecycleStage.PRE_SCALE_UP]
|
|
34083
|
+
))
|
|
34084
|
+
|
|
34085
|
+
target = service.load_balancer_target(
|
|
34086
|
+
container_name="nginx",
|
|
34087
|
+
container_port=80,
|
|
34088
|
+
protocol=ecs.Protocol.TCP,
|
|
34089
|
+
alternate_target=ecs.AlternateTarget("AlternateTarget",
|
|
34090
|
+
alternate_target_group=green_target_group,
|
|
34091
|
+
production_listener=ecs.ListenerRuleConfiguration.application_listener_rule(prod_listener_rule)
|
|
34092
|
+
)
|
|
34093
|
+
)
|
|
34094
|
+
|
|
34095
|
+
target.attach_to_application_target_group(blue_target_group)
|
|
34096
|
+
'''
|
|
34097
|
+
|
|
34098
|
+
def __init__(self) -> None:
|
|
34099
|
+
jsii.create(self.__class__, self, [])
|
|
34100
|
+
|
|
34101
|
+
@jsii.member(jsii_name="applicationListenerRule")
|
|
34102
|
+
@builtins.classmethod
|
|
34103
|
+
def application_listener_rule(
|
|
34104
|
+
cls,
|
|
34105
|
+
rule: _ApplicationListenerRule_f93ff606,
|
|
34106
|
+
) -> "ListenerRuleConfiguration":
|
|
34107
|
+
'''Use an Application Load Balancer listener rule.
|
|
34108
|
+
|
|
34109
|
+
:param rule: -
|
|
34110
|
+
'''
|
|
34111
|
+
if __debug__:
|
|
34112
|
+
type_hints = typing.get_type_hints(_typecheckingstub__e4bdbe1ec0e220912f9ff8b7769875a4eebd5168734b702329f9d4600ecdb318)
|
|
34113
|
+
check_type(argname="argument rule", value=rule, expected_type=type_hints["rule"])
|
|
34114
|
+
return typing.cast("ListenerRuleConfiguration", jsii.sinvoke(cls, "applicationListenerRule", [rule]))
|
|
34115
|
+
|
|
34116
|
+
@jsii.member(jsii_name="networkListener")
|
|
34117
|
+
@builtins.classmethod
|
|
34118
|
+
def network_listener(
|
|
34119
|
+
cls,
|
|
34120
|
+
listener: _NetworkListener_539c17bf,
|
|
34121
|
+
) -> "ListenerRuleConfiguration":
|
|
34122
|
+
'''Use a Network Load Balancer listener.
|
|
34123
|
+
|
|
34124
|
+
:param listener: -
|
|
34125
|
+
'''
|
|
34126
|
+
if __debug__:
|
|
34127
|
+
type_hints = typing.get_type_hints(_typecheckingstub__c964a7ba26c195318cd3937b823b36facecf4120aeb9196876feb206f6f9855a)
|
|
34128
|
+
check_type(argname="argument listener", value=listener, expected_type=type_hints["listener"])
|
|
34129
|
+
return typing.cast("ListenerRuleConfiguration", jsii.sinvoke(cls, "networkListener", [listener]))
|
|
34130
|
+
|
|
34131
|
+
|
|
34132
|
+
class _ListenerRuleConfigurationProxy(ListenerRuleConfiguration):
|
|
34133
|
+
pass
|
|
34134
|
+
|
|
34135
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class
|
|
34136
|
+
typing.cast(typing.Any, ListenerRuleConfiguration).__jsii_proxy_class__ = lambda : _ListenerRuleConfigurationProxy
|
|
34137
|
+
|
|
34138
|
+
|
|
33033
34139
|
@jsii.data_type(
|
|
33034
34140
|
jsii_type="aws-cdk-lib.aws_ecs.LoadBalancerTargetOptions",
|
|
33035
34141
|
jsii_struct_bases=[],
|
|
33036
34142
|
name_mapping={
|
|
33037
34143
|
"container_name": "containerName",
|
|
34144
|
+
"alternate_target": "alternateTarget",
|
|
33038
34145
|
"container_port": "containerPort",
|
|
33039
34146
|
"protocol": "protocol",
|
|
33040
34147
|
},
|
|
@@ -33044,6 +34151,7 @@ class LoadBalancerTargetOptions:
|
|
|
33044
34151
|
self,
|
|
33045
34152
|
*,
|
|
33046
34153
|
container_name: builtins.str,
|
|
34154
|
+
alternate_target: typing.Optional[IAlternateTarget] = None,
|
|
33047
34155
|
container_port: typing.Optional[jsii.Number] = None,
|
|
33048
34156
|
protocol: typing.Optional["Protocol"] = None,
|
|
33049
34157
|
) -> None:
|
|
@@ -33052,6 +34160,7 @@ class LoadBalancerTargetOptions:
|
|
|
33052
34160
|
The port mapping for it must already have been created through addPortMapping().
|
|
33053
34161
|
|
|
33054
34162
|
:param container_name: The name of the container.
|
|
34163
|
+
:param alternate_target: Alternate target configuration for blue/green deployments. Default: - No alternate target configuration
|
|
33055
34164
|
:param container_port: The port number of the container. Only applicable when using application/network load balancers. Default: - Container port of the first added port mapping.
|
|
33056
34165
|
:param protocol: The protocol used for the port mapping. Only applicable when using application load balancers. Default: Protocol.TCP
|
|
33057
34166
|
|
|
@@ -33075,11 +34184,14 @@ class LoadBalancerTargetOptions:
|
|
|
33075
34184
|
if __debug__:
|
|
33076
34185
|
type_hints = typing.get_type_hints(_typecheckingstub__5499166a691d3d9b788ba4a9808f921437da0987c4c4733332600e4e584bf30f)
|
|
33077
34186
|
check_type(argname="argument container_name", value=container_name, expected_type=type_hints["container_name"])
|
|
34187
|
+
check_type(argname="argument alternate_target", value=alternate_target, expected_type=type_hints["alternate_target"])
|
|
33078
34188
|
check_type(argname="argument container_port", value=container_port, expected_type=type_hints["container_port"])
|
|
33079
34189
|
check_type(argname="argument protocol", value=protocol, expected_type=type_hints["protocol"])
|
|
33080
34190
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
33081
34191
|
"container_name": container_name,
|
|
33082
34192
|
}
|
|
34193
|
+
if alternate_target is not None:
|
|
34194
|
+
self._values["alternate_target"] = alternate_target
|
|
33083
34195
|
if container_port is not None:
|
|
33084
34196
|
self._values["container_port"] = container_port
|
|
33085
34197
|
if protocol is not None:
|
|
@@ -33092,6 +34204,15 @@ class LoadBalancerTargetOptions:
|
|
|
33092
34204
|
assert result is not None, "Required property 'container_name' is missing"
|
|
33093
34205
|
return typing.cast(builtins.str, result)
|
|
33094
34206
|
|
|
34207
|
+
@builtins.property
|
|
34208
|
+
def alternate_target(self) -> typing.Optional[IAlternateTarget]:
|
|
34209
|
+
'''Alternate target configuration for blue/green deployments.
|
|
34210
|
+
|
|
34211
|
+
:default: - No alternate target configuration
|
|
34212
|
+
'''
|
|
34213
|
+
result = self._values.get("alternate_target")
|
|
34214
|
+
return typing.cast(typing.Optional[IAlternateTarget], result)
|
|
34215
|
+
|
|
33095
34216
|
@builtins.property
|
|
33096
34217
|
def container_port(self) -> typing.Optional[jsii.Number]:
|
|
33097
34218
|
'''The port number of the container.
|
|
@@ -34716,34 +35837,37 @@ class Protocol(enum.Enum):
|
|
|
34716
35837
|
|
|
34717
35838
|
Example::
|
|
34718
35839
|
|
|
34719
|
-
|
|
35840
|
+
import aws_cdk.aws_lambda as lambda_
|
|
35841
|
+
|
|
34720
35842
|
# cluster: ecs.Cluster
|
|
35843
|
+
# task_definition: ecs.TaskDefinition
|
|
35844
|
+
# lambda_hook: lambda.Function
|
|
35845
|
+
# blue_target_group: elbv2.ApplicationTargetGroup
|
|
35846
|
+
# green_target_group: elbv2.ApplicationTargetGroup
|
|
35847
|
+
# prod_listener_rule: elbv2.ApplicationListenerRule
|
|
34721
35848
|
|
|
34722
35849
|
|
|
34723
|
-
|
|
34724
|
-
|
|
34725
|
-
|
|
34726
|
-
|
|
35850
|
+
service = ecs.FargateService(self, "Service",
|
|
35851
|
+
cluster=cluster,
|
|
35852
|
+
task_definition=task_definition,
|
|
35853
|
+
deployment_strategy=ecs.DeploymentStrategy.BLUE_GREEN
|
|
34727
35854
|
)
|
|
34728
35855
|
|
|
34729
|
-
|
|
34730
|
-
|
|
34731
|
-
|
|
34732
|
-
protocol=ecs.Protocol.TCP
|
|
34733
|
-
)
|
|
35856
|
+
service.add_lifecycle_hook(ecs.DeploymentLifecycleLambdaTarget(lambda_hook, "PreScaleHook",
|
|
35857
|
+
lifecycle_stages=[ecs.DeploymentLifecycleStage.PRE_SCALE_UP]
|
|
35858
|
+
))
|
|
34734
35859
|
|
|
34735
|
-
|
|
34736
|
-
|
|
34737
|
-
|
|
34738
|
-
|
|
34739
|
-
|
|
34740
|
-
|
|
34741
|
-
|
|
34742
|
-
# Targets port TCP port 7600 `specificContainer`
|
|
34743
|
-
container=specific_container,
|
|
34744
|
-
container_port=7600
|
|
35860
|
+
target = service.load_balancer_target(
|
|
35861
|
+
container_name="nginx",
|
|
35862
|
+
container_port=80,
|
|
35863
|
+
protocol=ecs.Protocol.TCP,
|
|
35864
|
+
alternate_target=ecs.AlternateTarget("AlternateTarget",
|
|
35865
|
+
alternate_target_group=green_target_group,
|
|
35866
|
+
production_listener=ecs.ListenerRuleConfiguration.application_listener_rule(prod_listener_rule)
|
|
34745
35867
|
)
|
|
34746
35868
|
)
|
|
35869
|
+
|
|
35870
|
+
target.attach_to_application_target_group(blue_target_group)
|
|
34747
35871
|
'''
|
|
34748
35872
|
|
|
34749
35873
|
TCP = "TCP"
|
|
@@ -40004,6 +41128,90 @@ class WindowsOptimizedVersion(enum.Enum):
|
|
|
40004
41128
|
SERVER_2016 = "SERVER_2016"
|
|
40005
41129
|
|
|
40006
41130
|
|
|
41131
|
+
@jsii.implements(IAlternateTarget)
|
|
41132
|
+
class AlternateTarget(
|
|
41133
|
+
metaclass=jsii.JSIIMeta,
|
|
41134
|
+
jsii_type="aws-cdk-lib.aws_ecs.AlternateTarget",
|
|
41135
|
+
):
|
|
41136
|
+
'''Configuration for alternate target groups used in blue/green deployments with load balancers.
|
|
41137
|
+
|
|
41138
|
+
:exampleMetadata: infused
|
|
41139
|
+
|
|
41140
|
+
Example::
|
|
41141
|
+
|
|
41142
|
+
import aws_cdk.aws_lambda as lambda_
|
|
41143
|
+
|
|
41144
|
+
# cluster: ecs.Cluster
|
|
41145
|
+
# task_definition: ecs.TaskDefinition
|
|
41146
|
+
# lambda_hook: lambda.Function
|
|
41147
|
+
# blue_target_group: elbv2.ApplicationTargetGroup
|
|
41148
|
+
# green_target_group: elbv2.ApplicationTargetGroup
|
|
41149
|
+
# prod_listener_rule: elbv2.ApplicationListenerRule
|
|
41150
|
+
|
|
41151
|
+
|
|
41152
|
+
service = ecs.FargateService(self, "Service",
|
|
41153
|
+
cluster=cluster,
|
|
41154
|
+
task_definition=task_definition,
|
|
41155
|
+
deployment_strategy=ecs.DeploymentStrategy.BLUE_GREEN
|
|
41156
|
+
)
|
|
41157
|
+
|
|
41158
|
+
service.add_lifecycle_hook(ecs.DeploymentLifecycleLambdaTarget(lambda_hook, "PreScaleHook",
|
|
41159
|
+
lifecycle_stages=[ecs.DeploymentLifecycleStage.PRE_SCALE_UP]
|
|
41160
|
+
))
|
|
41161
|
+
|
|
41162
|
+
target = service.load_balancer_target(
|
|
41163
|
+
container_name="nginx",
|
|
41164
|
+
container_port=80,
|
|
41165
|
+
protocol=ecs.Protocol.TCP,
|
|
41166
|
+
alternate_target=ecs.AlternateTarget("AlternateTarget",
|
|
41167
|
+
alternate_target_group=green_target_group,
|
|
41168
|
+
production_listener=ecs.ListenerRuleConfiguration.application_listener_rule(prod_listener_rule)
|
|
41169
|
+
)
|
|
41170
|
+
)
|
|
41171
|
+
|
|
41172
|
+
target.attach_to_application_target_group(blue_target_group)
|
|
41173
|
+
'''
|
|
41174
|
+
|
|
41175
|
+
def __init__(
|
|
41176
|
+
self,
|
|
41177
|
+
id: builtins.str,
|
|
41178
|
+
*,
|
|
41179
|
+
alternate_target_group: _ITargetGroup_83c6f8c4,
|
|
41180
|
+
production_listener: ListenerRuleConfiguration,
|
|
41181
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
41182
|
+
test_listener: typing.Optional[ListenerRuleConfiguration] = None,
|
|
41183
|
+
) -> None:
|
|
41184
|
+
'''
|
|
41185
|
+
:param id: -
|
|
41186
|
+
:param alternate_target_group: The alternate target group.
|
|
41187
|
+
:param production_listener: The production listener rule ARN (ALB) or listener ARN (NLB).
|
|
41188
|
+
:param role: The IAM role for the configuration. Default: - a new role will be created
|
|
41189
|
+
:param test_listener: The test listener configuration. Default: - none
|
|
41190
|
+
'''
|
|
41191
|
+
if __debug__:
|
|
41192
|
+
type_hints = typing.get_type_hints(_typecheckingstub__aa25b044df0e4eef1817fd07bd799a88800df4e6bd79f283ca2657cfee9e4b29)
|
|
41193
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
41194
|
+
props = AlternateTargetProps(
|
|
41195
|
+
alternate_target_group=alternate_target_group,
|
|
41196
|
+
production_listener=production_listener,
|
|
41197
|
+
role=role,
|
|
41198
|
+
test_listener=test_listener,
|
|
41199
|
+
)
|
|
41200
|
+
|
|
41201
|
+
jsii.create(self.__class__, self, [id, props])
|
|
41202
|
+
|
|
41203
|
+
@jsii.member(jsii_name="bind")
|
|
41204
|
+
def bind(self, scope: _constructs_77d1e7e8.IConstruct) -> AlternateTargetConfig:
|
|
41205
|
+
'''Bind this configuration to a service.
|
|
41206
|
+
|
|
41207
|
+
:param scope: -
|
|
41208
|
+
'''
|
|
41209
|
+
if __debug__:
|
|
41210
|
+
type_hints = typing.get_type_hints(_typecheckingstub__147067753bcb82b7fc98e3b04dd99ea91c99dac8aec50a2f7076d3593aced862)
|
|
41211
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
41212
|
+
return typing.cast(AlternateTargetConfig, jsii.invoke(self, "bind", [scope]))
|
|
41213
|
+
|
|
41214
|
+
|
|
40007
41215
|
class AppMeshProxyConfiguration(
|
|
40008
41216
|
ProxyConfiguration,
|
|
40009
41217
|
metaclass=jsii.JSIIMeta,
|
|
@@ -40733,7 +41941,7 @@ class Cluster(
|
|
|
40733
41941
|
:param key_name: (deprecated) Name of SSH keypair to grant access to instances. ``launchTemplate`` and ``mixedInstancesPolicy`` must not be specified when this property is specified You can either specify ``keyPair`` or ``keyName``, not both. Default: - No SSH access will be possible.
|
|
40734
41942
|
:param key_pair: The SSH keypair to grant access to the instance. Feature flag ``AUTOSCALING_GENERATE_LAUNCH_TEMPLATE`` must be enabled to use this property. ``launchTemplate`` and ``mixedInstancesPolicy`` must not be specified when this property is specified. You can either specify ``keyPair`` or ``keyName``, not both. Default: - No SSH access will be possible.
|
|
40735
41943
|
:param max_capacity: Maximum number of instances in the fleet. Default: desiredCapacity
|
|
40736
|
-
:param max_instance_lifetime: The maximum amount of time that an instance can be in service. The maximum duration applies to all current and future instances in the group. As an instance approaches its maximum duration, it is terminated and replaced, and cannot be used again. You must specify a value of at least
|
|
41944
|
+
:param max_instance_lifetime: The maximum amount of time that an instance can be in service. The maximum duration applies to all current and future instances in the group. As an instance approaches its maximum duration, it is terminated and replaced, and cannot be used again. You must specify a value of at least 86,400 seconds (one day). To clear a previously set value, leave this property undefined. Default: none
|
|
40737
41945
|
:param min_capacity: Minimum number of instances in the fleet. Default: 1
|
|
40738
41946
|
:param new_instances_protected_from_scale_in: Whether newly-launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. By default, Auto Scaling can terminate an instance at any time after launch when scaling in an Auto Scaling Group, subject to the group's termination policy. However, you may wish to protect newly-launched instances from being scaled in if they are going to run critical applications that should not be prematurely terminated. This flag must be enabled if the Auto Scaling Group will be associated with an ECS Capacity Provider with managed termination protection. Default: false
|
|
40739
41947
|
:param notifications: Configure autoscaling group to send notifications about fleet changes to an SNS topic(s). Default: - No fleet change notifications will be sent.
|
|
@@ -41281,6 +42489,95 @@ class DeploymentAlarmConfig(DeploymentAlarmOptions):
|
|
|
41281
42489
|
)
|
|
41282
42490
|
|
|
41283
42491
|
|
|
42492
|
+
@jsii.implements(IDeploymentLifecycleHookTarget)
|
|
42493
|
+
class DeploymentLifecycleLambdaTarget(
|
|
42494
|
+
metaclass=jsii.JSIIMeta,
|
|
42495
|
+
jsii_type="aws-cdk-lib.aws_ecs.DeploymentLifecycleLambdaTarget",
|
|
42496
|
+
):
|
|
42497
|
+
'''Use an AWS Lambda function as a deployment lifecycle hook target.
|
|
42498
|
+
|
|
42499
|
+
:exampleMetadata: infused
|
|
42500
|
+
|
|
42501
|
+
Example::
|
|
42502
|
+
|
|
42503
|
+
import aws_cdk.aws_lambda as lambda_
|
|
42504
|
+
|
|
42505
|
+
# cluster: ecs.Cluster
|
|
42506
|
+
# task_definition: ecs.TaskDefinition
|
|
42507
|
+
# lambda_hook: lambda.Function
|
|
42508
|
+
# blue_target_group: elbv2.ApplicationTargetGroup
|
|
42509
|
+
# green_target_group: elbv2.ApplicationTargetGroup
|
|
42510
|
+
# prod_listener_rule: elbv2.ApplicationListenerRule
|
|
42511
|
+
|
|
42512
|
+
|
|
42513
|
+
service = ecs.FargateService(self, "Service",
|
|
42514
|
+
cluster=cluster,
|
|
42515
|
+
task_definition=task_definition,
|
|
42516
|
+
deployment_strategy=ecs.DeploymentStrategy.BLUE_GREEN
|
|
42517
|
+
)
|
|
42518
|
+
|
|
42519
|
+
service.add_lifecycle_hook(ecs.DeploymentLifecycleLambdaTarget(lambda_hook, "PreScaleHook",
|
|
42520
|
+
lifecycle_stages=[ecs.DeploymentLifecycleStage.PRE_SCALE_UP]
|
|
42521
|
+
))
|
|
42522
|
+
|
|
42523
|
+
target = service.load_balancer_target(
|
|
42524
|
+
container_name="nginx",
|
|
42525
|
+
container_port=80,
|
|
42526
|
+
protocol=ecs.Protocol.TCP,
|
|
42527
|
+
alternate_target=ecs.AlternateTarget("AlternateTarget",
|
|
42528
|
+
alternate_target_group=green_target_group,
|
|
42529
|
+
production_listener=ecs.ListenerRuleConfiguration.application_listener_rule(prod_listener_rule)
|
|
42530
|
+
)
|
|
42531
|
+
)
|
|
42532
|
+
|
|
42533
|
+
target.attach_to_application_target_group(blue_target_group)
|
|
42534
|
+
'''
|
|
42535
|
+
|
|
42536
|
+
def __init__(
|
|
42537
|
+
self,
|
|
42538
|
+
handler: _IFunction_6adb0ab8,
|
|
42539
|
+
id: builtins.str,
|
|
42540
|
+
*,
|
|
42541
|
+
lifecycle_stages: typing.Sequence[DeploymentLifecycleStage],
|
|
42542
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
42543
|
+
) -> None:
|
|
42544
|
+
'''
|
|
42545
|
+
:param handler: -
|
|
42546
|
+
:param id: -
|
|
42547
|
+
:param lifecycle_stages: The lifecycle stages when this hook should be executed.
|
|
42548
|
+
:param role: The IAM role that grants permissions to invoke the lambda target. Default: - A unique role will be generated for this lambda function.
|
|
42549
|
+
'''
|
|
42550
|
+
if __debug__:
|
|
42551
|
+
type_hints = typing.get_type_hints(_typecheckingstub__bddcf05621152ce6e8fd520b5a7bb98f63b4f5805beda123da1f9f542d66294e)
|
|
42552
|
+
check_type(argname="argument handler", value=handler, expected_type=type_hints["handler"])
|
|
42553
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
42554
|
+
props = DeploymentLifecycleLambdaTargetProps(
|
|
42555
|
+
lifecycle_stages=lifecycle_stages, role=role
|
|
42556
|
+
)
|
|
42557
|
+
|
|
42558
|
+
jsii.create(self.__class__, self, [handler, id, props])
|
|
42559
|
+
|
|
42560
|
+
@jsii.member(jsii_name="bind")
|
|
42561
|
+
def bind(
|
|
42562
|
+
self,
|
|
42563
|
+
scope: _constructs_77d1e7e8.IConstruct,
|
|
42564
|
+
) -> DeploymentLifecycleHookTargetConfig:
|
|
42565
|
+
'''Bind this target to a deployment lifecycle hook.
|
|
42566
|
+
|
|
42567
|
+
:param scope: -
|
|
42568
|
+
'''
|
|
42569
|
+
if __debug__:
|
|
42570
|
+
type_hints = typing.get_type_hints(_typecheckingstub__c6510372e5e0e0b1114c294538138af0f03ebd70441a76bddd8496eca40f2fe8)
|
|
42571
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
42572
|
+
return typing.cast(DeploymentLifecycleHookTargetConfig, jsii.invoke(self, "bind", [scope]))
|
|
42573
|
+
|
|
42574
|
+
@builtins.property
|
|
42575
|
+
@jsii.member(jsii_name="role")
|
|
42576
|
+
def role(self) -> _IRole_235f5d8e:
|
|
42577
|
+
'''The IAM role for the deployment lifecycle hook target.'''
|
|
42578
|
+
return typing.cast(_IRole_235f5d8e, jsii.get(self, "role"))
|
|
42579
|
+
|
|
42580
|
+
|
|
41284
42581
|
class FireLensLogDriver(
|
|
41285
42582
|
LogDriver,
|
|
41286
42583
|
metaclass=jsii.JSIIMeta,
|
|
@@ -41966,6 +43263,17 @@ class BaseService(
|
|
|
41966
43263
|
check_type(argname="argument service_arn", value=service_arn, expected_type=type_hints["service_arn"])
|
|
41967
43264
|
return typing.cast(IBaseService, jsii.sinvoke(cls, "fromServiceArnWithCluster", [scope, id, service_arn]))
|
|
41968
43265
|
|
|
43266
|
+
@jsii.member(jsii_name="addLifecycleHook")
|
|
43267
|
+
def add_lifecycle_hook(self, target: IDeploymentLifecycleHookTarget) -> None:
|
|
43268
|
+
'''Add a deployment lifecycle hook target.
|
|
43269
|
+
|
|
43270
|
+
:param target: The lifecycle hook target to add.
|
|
43271
|
+
'''
|
|
43272
|
+
if __debug__:
|
|
43273
|
+
type_hints = typing.get_type_hints(_typecheckingstub__480743d611a768bf60af18dc6a08c65385351ccd86b4290955b74d1541662389)
|
|
43274
|
+
check_type(argname="argument target", value=target, expected_type=type_hints["target"])
|
|
43275
|
+
return typing.cast(None, jsii.invoke(self, "addLifecycleHook", [target]))
|
|
43276
|
+
|
|
41969
43277
|
@jsii.member(jsii_name="addVolume")
|
|
41970
43278
|
def add_volume(self, volume: ServiceManagedVolume) -> None:
|
|
41971
43279
|
'''Adds a volume to the Service.
|
|
@@ -42173,11 +43481,20 @@ class BaseService(
|
|
|
42173
43481
|
|
|
42174
43482
|
return typing.cast(None, jsii.invoke(self, "enableServiceConnect", [config]))
|
|
42175
43483
|
|
|
43484
|
+
@jsii.member(jsii_name="isUsingECSDeploymentController")
|
|
43485
|
+
def is_using_ecs_deployment_controller(self) -> builtins.bool:
|
|
43486
|
+
'''Checks if the service is using the ECS deployment controller.
|
|
43487
|
+
|
|
43488
|
+
:return: true if the service is using the ECS deployment controller or if no deployment controller is specified (defaults to ECS)
|
|
43489
|
+
'''
|
|
43490
|
+
return typing.cast(builtins.bool, jsii.invoke(self, "isUsingECSDeploymentController", []))
|
|
43491
|
+
|
|
42176
43492
|
@jsii.member(jsii_name="loadBalancerTarget")
|
|
42177
43493
|
def load_balancer_target(
|
|
42178
43494
|
self,
|
|
42179
43495
|
*,
|
|
42180
43496
|
container_name: builtins.str,
|
|
43497
|
+
alternate_target: typing.Optional[IAlternateTarget] = None,
|
|
42181
43498
|
container_port: typing.Optional[jsii.Number] = None,
|
|
42182
43499
|
protocol: typing.Optional[Protocol] = None,
|
|
42183
43500
|
) -> IEcsLoadBalancerTarget:
|
|
@@ -42191,6 +43508,7 @@ class BaseService(
|
|
|
42191
43508
|
target, instead of the ``Service`` object itself.
|
|
42192
43509
|
|
|
42193
43510
|
:param container_name: The name of the container.
|
|
43511
|
+
:param alternate_target: Alternate target configuration for blue/green deployments. Default: - No alternate target configuration
|
|
42194
43512
|
:param container_port: The port number of the container. Only applicable when using application/network load balancers. Default: - Container port of the first added port mapping.
|
|
42195
43513
|
:param protocol: The protocol used for the port mapping. Only applicable when using application load balancers. Default: Protocol.TCP
|
|
42196
43514
|
|
|
@@ -42209,6 +43527,7 @@ class BaseService(
|
|
|
42209
43527
|
'''
|
|
42210
43528
|
options = LoadBalancerTargetOptions(
|
|
42211
43529
|
container_name=container_name,
|
|
43530
|
+
alternate_target=alternate_target,
|
|
42212
43531
|
container_port=container_port,
|
|
42213
43532
|
protocol=protocol,
|
|
42214
43533
|
)
|
|
@@ -42586,15 +43905,18 @@ class Ec2Service(
|
|
|
42586
43905
|
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
42587
43906
|
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
42588
43907
|
cluster: ICluster,
|
|
43908
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
42589
43909
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
42590
43910
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
42591
43911
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
42592
43912
|
deployment_alarms: typing.Optional[typing.Union[DeploymentAlarmConfig, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
42593
43913
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
43914
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
42594
43915
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
42595
43916
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
42596
43917
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
42597
43918
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
43919
|
+
lifecycle_hooks: typing.Optional[typing.Sequence[IDeploymentLifecycleHookTarget]] = None,
|
|
42598
43920
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
42599
43921
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
42600
43922
|
propagate_tags: typing.Optional[PropagatedTagSource] = None,
|
|
@@ -42616,15 +43938,18 @@ class Ec2Service(
|
|
|
42616
43938
|
:param security_groups: The security groups to associate with the service. If you do not specify a security group, a new security group is created. This property is only used for tasks that use the awsvpc network mode. Default: - A new security group is created.
|
|
42617
43939
|
:param vpc_subnets: The subnets to associate with the service. This property is only used for tasks that use the awsvpc network mode. Default: - Public subnets if ``assignPublicIp`` is set, otherwise the first available one of Private, Isolated, Public, in that order.
|
|
42618
43940
|
:param cluster: The name of the cluster that hosts the service.
|
|
43941
|
+
:param bake_time: bake time minutes for service. Default: - none
|
|
42619
43942
|
:param capacity_provider_strategies: A list of Capacity Provider strategies used to place a service. Default: - undefined
|
|
42620
43943
|
:param circuit_breaker: Whether to enable the deployment circuit breaker. If this property is defined, circuit breaker will be implicitly enabled. Default: - disabled
|
|
42621
43944
|
:param cloud_map_options: The options for configuring an Amazon ECS service to use service discovery. Default: - AWS Cloud Map service discovery is not enabled.
|
|
42622
43945
|
:param deployment_alarms: The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. Default: - No alarms will be monitored during deployment.
|
|
42623
43946
|
:param deployment_controller: Specifies which deployment controller to use for the service. For more information, see `Amazon ECS Deployment Types <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html>`_ Default: - Rolling update (ECS)
|
|
43947
|
+
:param deployment_strategy: The deployment strategy to use for the service. Default: ROLLING
|
|
42624
43948
|
:param desired_count: The desired number of instantiations of the task definition to keep running on the service. Default: - When creating the service, default is 1; when updating the service, default uses the current task number.
|
|
42625
43949
|
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging Your Amazon ECS Resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ Default: false
|
|
42626
43950
|
:param enable_execute_command: Whether to enable the ability to execute into a container. Default: - undefined
|
|
42627
43951
|
:param health_check_grace_period: The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set
|
|
43952
|
+
:param lifecycle_hooks: The lifecycle hooks to execute during deployment stages. Default: - none;
|
|
42628
43953
|
:param max_healthy_percent: The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. Default: - 100 if daemon, otherwise 200
|
|
42629
43954
|
:param min_healthy_percent: The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. Default: - 0 if daemon, otherwise 50
|
|
42630
43955
|
:param propagate_tags: Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE Default: PropagatedTagSource.NONE
|
|
@@ -42647,15 +43972,18 @@ class Ec2Service(
|
|
|
42647
43972
|
security_groups=security_groups,
|
|
42648
43973
|
vpc_subnets=vpc_subnets,
|
|
42649
43974
|
cluster=cluster,
|
|
43975
|
+
bake_time=bake_time,
|
|
42650
43976
|
capacity_provider_strategies=capacity_provider_strategies,
|
|
42651
43977
|
circuit_breaker=circuit_breaker,
|
|
42652
43978
|
cloud_map_options=cloud_map_options,
|
|
42653
43979
|
deployment_alarms=deployment_alarms,
|
|
42654
43980
|
deployment_controller=deployment_controller,
|
|
43981
|
+
deployment_strategy=deployment_strategy,
|
|
42655
43982
|
desired_count=desired_count,
|
|
42656
43983
|
enable_ecs_managed_tags=enable_ecs_managed_tags,
|
|
42657
43984
|
enable_execute_command=enable_execute_command,
|
|
42658
43985
|
health_check_grace_period=health_check_grace_period,
|
|
43986
|
+
lifecycle_hooks=lifecycle_hooks,
|
|
42659
43987
|
max_healthy_percent=max_healthy_percent,
|
|
42660
43988
|
min_healthy_percent=min_healthy_percent,
|
|
42661
43989
|
propagate_tags=propagate_tags,
|
|
@@ -43084,15 +44412,18 @@ class ExternalService(
|
|
|
43084
44412
|
daemon: typing.Optional[builtins.bool] = None,
|
|
43085
44413
|
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
43086
44414
|
cluster: ICluster,
|
|
44415
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
43087
44416
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
43088
44417
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
43089
44418
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
43090
44419
|
deployment_alarms: typing.Optional[typing.Union[DeploymentAlarmConfig, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
43091
44420
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
44421
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
43092
44422
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
43093
44423
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
43094
44424
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
43095
44425
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
44426
|
+
lifecycle_hooks: typing.Optional[typing.Sequence[IDeploymentLifecycleHookTarget]] = None,
|
|
43096
44427
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
43097
44428
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
43098
44429
|
propagate_tags: typing.Optional[PropagatedTagSource] = None,
|
|
@@ -43109,15 +44440,18 @@ class ExternalService(
|
|
|
43109
44440
|
:param daemon: By default, service use REPLICA scheduling strategy, this parameter enable DAEMON scheduling strategy. If true, the service scheduler deploys exactly one task on each container instance in your cluster. When you are using this strategy, do not specify a desired number of tasks or any task placement strategies. Tasks using the Fargate launch type or the CODE_DEPLOY or EXTERNAL deployment controller types don't support the DAEMON scheduling strategy. Default: false
|
|
43110
44441
|
:param security_groups: The security groups to associate with the service. If you do not specify a security group, a new security group is created. Default: - A new security group is created.
|
|
43111
44442
|
:param cluster: The name of the cluster that hosts the service.
|
|
44443
|
+
:param bake_time: bake time minutes for service. Default: - none
|
|
43112
44444
|
:param capacity_provider_strategies: A list of Capacity Provider strategies used to place a service. Default: - undefined
|
|
43113
44445
|
:param circuit_breaker: Whether to enable the deployment circuit breaker. If this property is defined, circuit breaker will be implicitly enabled. Default: - disabled
|
|
43114
44446
|
:param cloud_map_options: The options for configuring an Amazon ECS service to use service discovery. Default: - AWS Cloud Map service discovery is not enabled.
|
|
43115
44447
|
:param deployment_alarms: The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. Default: - No alarms will be monitored during deployment.
|
|
43116
44448
|
:param deployment_controller: Specifies which deployment controller to use for the service. For more information, see `Amazon ECS Deployment Types <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html>`_ Default: - Rolling update (ECS)
|
|
44449
|
+
:param deployment_strategy: The deployment strategy to use for the service. Default: ROLLING
|
|
43117
44450
|
:param desired_count: The desired number of instantiations of the task definition to keep running on the service. Default: - When creating the service, default is 1; when updating the service, default uses the current task number.
|
|
43118
44451
|
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging Your Amazon ECS Resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ Default: false
|
|
43119
44452
|
:param enable_execute_command: Whether to enable the ability to execute into a container. Default: - undefined
|
|
43120
44453
|
:param health_check_grace_period: The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set
|
|
44454
|
+
:param lifecycle_hooks: The lifecycle hooks to execute during deployment stages. Default: - none;
|
|
43121
44455
|
:param max_healthy_percent: The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. Default: - 100 if daemon, otherwise 200
|
|
43122
44456
|
:param min_healthy_percent: The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. Default: - 0 if daemon, otherwise 50
|
|
43123
44457
|
:param propagate_tags: Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE Default: PropagatedTagSource.NONE
|
|
@@ -43135,15 +44469,18 @@ class ExternalService(
|
|
|
43135
44469
|
daemon=daemon,
|
|
43136
44470
|
security_groups=security_groups,
|
|
43137
44471
|
cluster=cluster,
|
|
44472
|
+
bake_time=bake_time,
|
|
43138
44473
|
capacity_provider_strategies=capacity_provider_strategies,
|
|
43139
44474
|
circuit_breaker=circuit_breaker,
|
|
43140
44475
|
cloud_map_options=cloud_map_options,
|
|
43141
44476
|
deployment_alarms=deployment_alarms,
|
|
43142
44477
|
deployment_controller=deployment_controller,
|
|
44478
|
+
deployment_strategy=deployment_strategy,
|
|
43143
44479
|
desired_count=desired_count,
|
|
43144
44480
|
enable_ecs_managed_tags=enable_ecs_managed_tags,
|
|
43145
44481
|
enable_execute_command=enable_execute_command,
|
|
43146
44482
|
health_check_grace_period=health_check_grace_period,
|
|
44483
|
+
lifecycle_hooks=lifecycle_hooks,
|
|
43147
44484
|
max_healthy_percent=max_healthy_percent,
|
|
43148
44485
|
min_healthy_percent=min_healthy_percent,
|
|
43149
44486
|
propagate_tags=propagate_tags,
|
|
@@ -43319,17 +44656,20 @@ class ExternalService(
|
|
|
43319
44656
|
self,
|
|
43320
44657
|
*,
|
|
43321
44658
|
container_name: builtins.str,
|
|
44659
|
+
alternate_target: typing.Optional[IAlternateTarget] = None,
|
|
43322
44660
|
container_port: typing.Optional[jsii.Number] = None,
|
|
43323
44661
|
protocol: typing.Optional[Protocol] = None,
|
|
43324
44662
|
) -> IEcsLoadBalancerTarget:
|
|
43325
44663
|
'''Overridden method to throw error as ``loadBalancerTarget`` is not supported for external service.
|
|
43326
44664
|
|
|
43327
44665
|
:param container_name: The name of the container.
|
|
44666
|
+
:param alternate_target: Alternate target configuration for blue/green deployments. Default: - No alternate target configuration
|
|
43328
44667
|
:param container_port: The port number of the container. Only applicable when using application/network load balancers. Default: - Container port of the first added port mapping.
|
|
43329
44668
|
:param protocol: The protocol used for the port mapping. Only applicable when using application load balancers. Default: Protocol.TCP
|
|
43330
44669
|
'''
|
|
43331
44670
|
_options = LoadBalancerTargetOptions(
|
|
43332
44671
|
container_name=container_name,
|
|
44672
|
+
alternate_target=alternate_target,
|
|
43333
44673
|
container_port=container_port,
|
|
43334
44674
|
protocol=protocol,
|
|
43335
44675
|
)
|
|
@@ -43514,28 +44854,34 @@ class FargateService(
|
|
|
43514
44854
|
|
|
43515
44855
|
# cluster: ecs.Cluster
|
|
43516
44856
|
# task_definition: ecs.TaskDefinition
|
|
43517
|
-
# elb_alarm: cw.Alarm
|
|
43518
|
-
|
|
43519
44857
|
|
|
44858
|
+
service_name = "MyFargateService"
|
|
43520
44859
|
service = ecs.FargateService(self, "Service",
|
|
44860
|
+
service_name=service_name,
|
|
43521
44861
|
cluster=cluster,
|
|
43522
44862
|
task_definition=task_definition,
|
|
43523
|
-
min_healthy_percent=100
|
|
43524
|
-
deployment_alarms=ecs.DeploymentAlarmConfig(
|
|
43525
|
-
alarm_names=[elb_alarm.alarm_name],
|
|
43526
|
-
behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
|
|
43527
|
-
)
|
|
44863
|
+
min_healthy_percent=100
|
|
43528
44864
|
)
|
|
43529
44865
|
|
|
43530
|
-
|
|
43531
|
-
|
|
43532
|
-
|
|
43533
|
-
|
|
43534
|
-
|
|
44866
|
+
cpu_metric = cw.Metric(
|
|
44867
|
+
metric_name="CPUUtilization",
|
|
44868
|
+
namespace="AWS/ECS",
|
|
44869
|
+
period=Duration.minutes(5),
|
|
44870
|
+
statistic="Average",
|
|
44871
|
+
dimensions_map={
|
|
44872
|
+
"ClusterName": cluster.cluster_name,
|
|
44873
|
+
# Using `service.serviceName` here will cause a circular dependency
|
|
44874
|
+
"ServiceName": service_name
|
|
44875
|
+
}
|
|
44876
|
+
)
|
|
44877
|
+
my_alarm = cw.Alarm(self, "CPUAlarm",
|
|
44878
|
+
alarm_name="cpuAlarmName",
|
|
44879
|
+
metric=cpu_metric,
|
|
43535
44880
|
evaluation_periods=2,
|
|
43536
44881
|
threshold=80
|
|
43537
44882
|
)
|
|
43538
|
-
|
|
44883
|
+
|
|
44884
|
+
service.enable_deployment_alarms([my_alarm.alarm_name],
|
|
43539
44885
|
behavior=ecs.AlarmBehavior.FAIL_ON_ALARM
|
|
43540
44886
|
)
|
|
43541
44887
|
'''
|
|
@@ -43552,15 +44898,18 @@ class FargateService(
|
|
|
43552
44898
|
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
43553
44899
|
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
43554
44900
|
cluster: ICluster,
|
|
44901
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
43555
44902
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
43556
44903
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
43557
44904
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
43558
44905
|
deployment_alarms: typing.Optional[typing.Union[DeploymentAlarmConfig, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
43559
44906
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
44907
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
43560
44908
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
43561
44909
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
43562
44910
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
43563
44911
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
44912
|
+
lifecycle_hooks: typing.Optional[typing.Sequence[IDeploymentLifecycleHookTarget]] = None,
|
|
43564
44913
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
43565
44914
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
43566
44915
|
propagate_tags: typing.Optional[PropagatedTagSource] = None,
|
|
@@ -43580,15 +44929,18 @@ class FargateService(
|
|
|
43580
44929
|
:param security_groups: The security groups to associate with the service. If you do not specify a security group, a new security group is created. Default: - A new security group is created.
|
|
43581
44930
|
:param vpc_subnets: The subnets to associate with the service. Default: - Public subnets if ``assignPublicIp`` is set, otherwise the first available one of Private, Isolated, Public, in that order.
|
|
43582
44931
|
:param cluster: The name of the cluster that hosts the service.
|
|
44932
|
+
:param bake_time: bake time minutes for service. Default: - none
|
|
43583
44933
|
:param capacity_provider_strategies: A list of Capacity Provider strategies used to place a service. Default: - undefined
|
|
43584
44934
|
:param circuit_breaker: Whether to enable the deployment circuit breaker. If this property is defined, circuit breaker will be implicitly enabled. Default: - disabled
|
|
43585
44935
|
:param cloud_map_options: The options for configuring an Amazon ECS service to use service discovery. Default: - AWS Cloud Map service discovery is not enabled.
|
|
43586
44936
|
:param deployment_alarms: The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time. Default: - No alarms will be monitored during deployment.
|
|
43587
44937
|
:param deployment_controller: Specifies which deployment controller to use for the service. For more information, see `Amazon ECS Deployment Types <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html>`_ Default: - Rolling update (ECS)
|
|
44938
|
+
:param deployment_strategy: The deployment strategy to use for the service. Default: ROLLING
|
|
43588
44939
|
:param desired_count: The desired number of instantiations of the task definition to keep running on the service. Default: - When creating the service, default is 1; when updating the service, default uses the current task number.
|
|
43589
44940
|
:param enable_ecs_managed_tags: Specifies whether to enable Amazon ECS managed tags for the tasks within the service. For more information, see `Tagging Your Amazon ECS Resources <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html>`_ Default: false
|
|
43590
44941
|
:param enable_execute_command: Whether to enable the ability to execute into a container. Default: - undefined
|
|
43591
44942
|
:param health_check_grace_period: The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already set
|
|
44943
|
+
:param lifecycle_hooks: The lifecycle hooks to execute during deployment stages. Default: - none;
|
|
43592
44944
|
:param max_healthy_percent: The maximum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that can run in a service during a deployment. Default: - 100 if daemon, otherwise 200
|
|
43593
44945
|
:param min_healthy_percent: The minimum number of tasks, specified as a percentage of the Amazon ECS service's DesiredCount value, that must continue to run and remain healthy during a deployment. Default: - 0 if daemon, otherwise 50
|
|
43594
44946
|
:param propagate_tags: Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE Default: PropagatedTagSource.NONE
|
|
@@ -43609,15 +44961,18 @@ class FargateService(
|
|
|
43609
44961
|
security_groups=security_groups,
|
|
43610
44962
|
vpc_subnets=vpc_subnets,
|
|
43611
44963
|
cluster=cluster,
|
|
44964
|
+
bake_time=bake_time,
|
|
43612
44965
|
capacity_provider_strategies=capacity_provider_strategies,
|
|
43613
44966
|
circuit_breaker=circuit_breaker,
|
|
43614
44967
|
cloud_map_options=cloud_map_options,
|
|
43615
44968
|
deployment_alarms=deployment_alarms,
|
|
43616
44969
|
deployment_controller=deployment_controller,
|
|
44970
|
+
deployment_strategy=deployment_strategy,
|
|
43617
44971
|
desired_count=desired_count,
|
|
43618
44972
|
enable_ecs_managed_tags=enable_ecs_managed_tags,
|
|
43619
44973
|
enable_execute_command=enable_execute_command,
|
|
43620
44974
|
health_check_grace_period=health_check_grace_period,
|
|
44975
|
+
lifecycle_hooks=lifecycle_hooks,
|
|
43621
44976
|
max_healthy_percent=max_healthy_percent,
|
|
43622
44977
|
min_healthy_percent=min_healthy_percent,
|
|
43623
44978
|
propagate_tags=propagate_tags,
|
|
@@ -43889,6 +45244,10 @@ __all__ = [
|
|
|
43889
45244
|
"AddAutoScalingGroupCapacityOptions",
|
|
43890
45245
|
"AddCapacityOptions",
|
|
43891
45246
|
"AlarmBehavior",
|
|
45247
|
+
"AlternateTarget",
|
|
45248
|
+
"AlternateTargetConfig",
|
|
45249
|
+
"AlternateTargetOptions",
|
|
45250
|
+
"AlternateTargetProps",
|
|
43892
45251
|
"AmiHardwareType",
|
|
43893
45252
|
"AppMeshProxyConfiguration",
|
|
43894
45253
|
"AppMeshProxyConfigurationConfigProps",
|
|
@@ -43957,6 +45316,11 @@ __all__ = [
|
|
|
43957
45316
|
"DeploymentCircuitBreaker",
|
|
43958
45317
|
"DeploymentController",
|
|
43959
45318
|
"DeploymentControllerType",
|
|
45319
|
+
"DeploymentLifecycleHookTargetConfig",
|
|
45320
|
+
"DeploymentLifecycleLambdaTarget",
|
|
45321
|
+
"DeploymentLifecycleLambdaTargetProps",
|
|
45322
|
+
"DeploymentLifecycleStage",
|
|
45323
|
+
"DeploymentStrategy",
|
|
43960
45324
|
"Device",
|
|
43961
45325
|
"DevicePermission",
|
|
43962
45326
|
"DockerVolumeConfiguration",
|
|
@@ -44013,8 +45377,10 @@ __all__ = [
|
|
|
44013
45377
|
"GenericLogDriverProps",
|
|
44014
45378
|
"HealthCheck",
|
|
44015
45379
|
"Host",
|
|
45380
|
+
"IAlternateTarget",
|
|
44016
45381
|
"IBaseService",
|
|
44017
45382
|
"ICluster",
|
|
45383
|
+
"IDeploymentLifecycleHookTarget",
|
|
44018
45384
|
"IEc2Service",
|
|
44019
45385
|
"IEc2TaskDefinition",
|
|
44020
45386
|
"IEcsLoadBalancerTarget",
|
|
@@ -44035,6 +45401,7 @@ __all__ = [
|
|
|
44035
45401
|
"LinuxParameters",
|
|
44036
45402
|
"LinuxParametersProps",
|
|
44037
45403
|
"ListenerConfig",
|
|
45404
|
+
"ListenerRuleConfiguration",
|
|
44038
45405
|
"LoadBalancerTargetOptions",
|
|
44039
45406
|
"LogDriver",
|
|
44040
45407
|
"LogDriverConfig",
|
|
@@ -44146,6 +45513,34 @@ def _typecheckingstub__64f2d9b3495e3be78346f77d5ad90928968c8ce230e670b6279dc67ad
|
|
|
44146
45513
|
"""Type checking stubs"""
|
|
44147
45514
|
pass
|
|
44148
45515
|
|
|
45516
|
+
def _typecheckingstub__792a358f64361d957b07e1ed7f1116dd993837c77bffc674ebb1385615159cd7(
|
|
45517
|
+
*,
|
|
45518
|
+
alternate_target_group_arn: builtins.str,
|
|
45519
|
+
role_arn: builtins.str,
|
|
45520
|
+
production_listener_rule: typing.Optional[builtins.str] = None,
|
|
45521
|
+
test_listener_rule: typing.Optional[builtins.str] = None,
|
|
45522
|
+
) -> None:
|
|
45523
|
+
"""Type checking stubs"""
|
|
45524
|
+
pass
|
|
45525
|
+
|
|
45526
|
+
def _typecheckingstub__419cc917bedbbd0a41ca044bcc54720f5a35bdc4f2dca6e11ae40da3ed05758d(
|
|
45527
|
+
*,
|
|
45528
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
45529
|
+
test_listener: typing.Optional[ListenerRuleConfiguration] = None,
|
|
45530
|
+
) -> None:
|
|
45531
|
+
"""Type checking stubs"""
|
|
45532
|
+
pass
|
|
45533
|
+
|
|
45534
|
+
def _typecheckingstub__308a285b9e7be7ba49d4d78caf88537a973f5504d7b7519fb1fe4ab1c987b690(
|
|
45535
|
+
*,
|
|
45536
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
45537
|
+
test_listener: typing.Optional[ListenerRuleConfiguration] = None,
|
|
45538
|
+
alternate_target_group: _ITargetGroup_83c6f8c4,
|
|
45539
|
+
production_listener: ListenerRuleConfiguration,
|
|
45540
|
+
) -> None:
|
|
45541
|
+
"""Type checking stubs"""
|
|
45542
|
+
pass
|
|
45543
|
+
|
|
44149
45544
|
def _typecheckingstub__0405fe235aadd4430faf2b963e8de52a23bd867724c74f1f76995c5f208aa3e6(
|
|
44150
45545
|
*,
|
|
44151
45546
|
container_name: builtins.str,
|
|
@@ -44306,15 +45701,18 @@ def _typecheckingstub__47c51bc38319f21956164fb0fbe2257a72cb1269d763f8a2bf334788b
|
|
|
44306
45701
|
def _typecheckingstub__c2e0ba28c74987301a54b0d197b791a6a94084b5f40d15304ffabf113b3f7daa(
|
|
44307
45702
|
*,
|
|
44308
45703
|
cluster: ICluster,
|
|
45704
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
44309
45705
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
44310
45706
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
44311
45707
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
44312
45708
|
deployment_alarms: typing.Optional[typing.Union[DeploymentAlarmConfig, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
44313
45709
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
45710
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
44314
45711
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
44315
45712
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
44316
45713
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
44317
45714
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
45715
|
+
lifecycle_hooks: typing.Optional[typing.Sequence[IDeploymentLifecycleHookTarget]] = None,
|
|
44318
45716
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
44319
45717
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
44320
45718
|
propagate_tags: typing.Optional[PropagatedTagSource] = None,
|
|
@@ -44329,15 +45727,18 @@ def _typecheckingstub__c2e0ba28c74987301a54b0d197b791a6a94084b5f40d15304ffabf113
|
|
|
44329
45727
|
def _typecheckingstub__3ecfd95265b873c2042a9d5cb8465a48f9e325e2271c18461e2b266333563d84(
|
|
44330
45728
|
*,
|
|
44331
45729
|
cluster: ICluster,
|
|
45730
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
44332
45731
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
44333
45732
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
44334
45733
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
44335
45734
|
deployment_alarms: typing.Optional[typing.Union[DeploymentAlarmConfig, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
44336
45735
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
45736
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
44337
45737
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
44338
45738
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
44339
45739
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
44340
45740
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
45741
|
+
lifecycle_hooks: typing.Optional[typing.Sequence[IDeploymentLifecycleHookTarget]] = None,
|
|
44341
45742
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
44342
45743
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
44343
45744
|
propagate_tags: typing.Optional[PropagatedTagSource] = None,
|
|
@@ -46311,6 +47712,23 @@ def _typecheckingstub__919598d1dc3ec32befe4a81bbf3a26a387685443884de6cb597180866
|
|
|
46311
47712
|
"""Type checking stubs"""
|
|
46312
47713
|
pass
|
|
46313
47714
|
|
|
47715
|
+
def _typecheckingstub__58b105a4a38be4fd4e5d81c3d78a7d0fc4d3120086f0f1235d58be7e964bf172(
|
|
47716
|
+
*,
|
|
47717
|
+
lifecycle_stages: typing.Sequence[DeploymentLifecycleStage],
|
|
47718
|
+
target_arn: builtins.str,
|
|
47719
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
47720
|
+
) -> None:
|
|
47721
|
+
"""Type checking stubs"""
|
|
47722
|
+
pass
|
|
47723
|
+
|
|
47724
|
+
def _typecheckingstub__e812b4c257c9817fdc66c09cfbc9ed6c2dae75feb52fdb91c33339837dbb883c(
|
|
47725
|
+
*,
|
|
47726
|
+
lifecycle_stages: typing.Sequence[DeploymentLifecycleStage],
|
|
47727
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
47728
|
+
) -> None:
|
|
47729
|
+
"""Type checking stubs"""
|
|
47730
|
+
pass
|
|
47731
|
+
|
|
46314
47732
|
def _typecheckingstub__9cd1dbc2946a0873c593d44d008c4c102f3994a3cd94676ec1816b39d1b46931(
|
|
46315
47733
|
*,
|
|
46316
47734
|
host_path: builtins.str,
|
|
@@ -46389,15 +47807,18 @@ def _typecheckingstub__ec9bd820dae60c0be34ffc5a5dd28bccc87947dc35dff1502ce12b80a
|
|
|
46389
47807
|
def _typecheckingstub__95634258086aa3448fbdfd9896017a2cbeb858f382deb61186bb9e22b1ccd366(
|
|
46390
47808
|
*,
|
|
46391
47809
|
cluster: ICluster,
|
|
47810
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
46392
47811
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
46393
47812
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
46394
47813
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
46395
47814
|
deployment_alarms: typing.Optional[typing.Union[DeploymentAlarmConfig, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
46396
47815
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
47816
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
46397
47817
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
46398
47818
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
46399
47819
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
46400
47820
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
47821
|
+
lifecycle_hooks: typing.Optional[typing.Sequence[IDeploymentLifecycleHookTarget]] = None,
|
|
46401
47822
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
46402
47823
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
46403
47824
|
propagate_tags: typing.Optional[PropagatedTagSource] = None,
|
|
@@ -46592,15 +48013,18 @@ def _typecheckingstub__bb8d7316afb3715109dfb05d3b7460700437fb0490a0e47180a1c5ef5
|
|
|
46592
48013
|
def _typecheckingstub__3cc413964caae89bfcfbcabff8356ffe5c054f46824be99731a77b64ec052a8a(
|
|
46593
48014
|
*,
|
|
46594
48015
|
cluster: ICluster,
|
|
48016
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
46595
48017
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
46596
48018
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
46597
48019
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
46598
48020
|
deployment_alarms: typing.Optional[typing.Union[DeploymentAlarmConfig, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
46599
48021
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48022
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
46600
48023
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
46601
48024
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
46602
48025
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
46603
48026
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
48027
|
+
lifecycle_hooks: typing.Optional[typing.Sequence[IDeploymentLifecycleHookTarget]] = None,
|
|
46604
48028
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
46605
48029
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
46606
48030
|
propagate_tags: typing.Optional[PropagatedTagSource] = None,
|
|
@@ -46650,15 +48074,18 @@ def _typecheckingstub__85c0463354cc6d5a3da5daace0570a015f941bfeb87bb282346c1e2be
|
|
|
46650
48074
|
def _typecheckingstub__8290283f61f3e2d289b7e7f81cad1a5d1e9ed9dbc07ccce2b57604682a42ded7(
|
|
46651
48075
|
*,
|
|
46652
48076
|
cluster: ICluster,
|
|
48077
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
46653
48078
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
46654
48079
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
46655
48080
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
46656
48081
|
deployment_alarms: typing.Optional[typing.Union[DeploymentAlarmConfig, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
46657
48082
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48083
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
46658
48084
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
46659
48085
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
46660
48086
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
46661
48087
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
48088
|
+
lifecycle_hooks: typing.Optional[typing.Sequence[IDeploymentLifecycleHookTarget]] = None,
|
|
46662
48089
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
46663
48090
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
46664
48091
|
propagate_tags: typing.Optional[PropagatedTagSource] = None,
|
|
@@ -46939,6 +48366,18 @@ def _typecheckingstub__0275aca574e1acd41af17b3acaa1528dd0890542d27aeee65489bbd55
|
|
|
46939
48366
|
"""Type checking stubs"""
|
|
46940
48367
|
pass
|
|
46941
48368
|
|
|
48369
|
+
def _typecheckingstub__1f10764be69e962209020c3a7e772567f1cbc3d3673cf209506562511ce9cd0a(
|
|
48370
|
+
scope: _constructs_77d1e7e8.IConstruct,
|
|
48371
|
+
) -> None:
|
|
48372
|
+
"""Type checking stubs"""
|
|
48373
|
+
pass
|
|
48374
|
+
|
|
48375
|
+
def _typecheckingstub__1cdcc51dc61399e62078243a225e42fd6901317236efebe039a9e3b36834d4b7(
|
|
48376
|
+
scope: _constructs_77d1e7e8.IConstruct,
|
|
48377
|
+
) -> None:
|
|
48378
|
+
"""Type checking stubs"""
|
|
48379
|
+
pass
|
|
48380
|
+
|
|
46942
48381
|
def _typecheckingstub__11773db60f5e0800c7efe817fcc41dcf7af2f8e010e72471c80e23766e96c5ab(
|
|
46943
48382
|
task_definition: TaskDefinition,
|
|
46944
48383
|
) -> None:
|
|
@@ -47066,9 +48505,22 @@ def _typecheckingstub__ef0bdf65f82e85f94b1db5a37b900ed9f46429089cbcb4c8d29b283f3
|
|
|
47066
48505
|
"""Type checking stubs"""
|
|
47067
48506
|
pass
|
|
47068
48507
|
|
|
48508
|
+
def _typecheckingstub__e4bdbe1ec0e220912f9ff8b7769875a4eebd5168734b702329f9d4600ecdb318(
|
|
48509
|
+
rule: _ApplicationListenerRule_f93ff606,
|
|
48510
|
+
) -> None:
|
|
48511
|
+
"""Type checking stubs"""
|
|
48512
|
+
pass
|
|
48513
|
+
|
|
48514
|
+
def _typecheckingstub__c964a7ba26c195318cd3937b823b36facecf4120aeb9196876feb206f6f9855a(
|
|
48515
|
+
listener: _NetworkListener_539c17bf,
|
|
48516
|
+
) -> None:
|
|
48517
|
+
"""Type checking stubs"""
|
|
48518
|
+
pass
|
|
48519
|
+
|
|
47069
48520
|
def _typecheckingstub__5499166a691d3d9b788ba4a9808f921437da0987c4c4733332600e4e584bf30f(
|
|
47070
48521
|
*,
|
|
47071
48522
|
container_name: builtins.str,
|
|
48523
|
+
alternate_target: typing.Optional[IAlternateTarget] = None,
|
|
47072
48524
|
container_port: typing.Optional[jsii.Number] = None,
|
|
47073
48525
|
protocol: typing.Optional[Protocol] = None,
|
|
47074
48526
|
) -> None:
|
|
@@ -47816,6 +49268,23 @@ def _typecheckingstub__8874c61d65168e60874c9191682af53d5d88352dbfe615fd842f45b2b
|
|
|
47816
49268
|
"""Type checking stubs"""
|
|
47817
49269
|
pass
|
|
47818
49270
|
|
|
49271
|
+
def _typecheckingstub__aa25b044df0e4eef1817fd07bd799a88800df4e6bd79f283ca2657cfee9e4b29(
|
|
49272
|
+
id: builtins.str,
|
|
49273
|
+
*,
|
|
49274
|
+
alternate_target_group: _ITargetGroup_83c6f8c4,
|
|
49275
|
+
production_listener: ListenerRuleConfiguration,
|
|
49276
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
49277
|
+
test_listener: typing.Optional[ListenerRuleConfiguration] = None,
|
|
49278
|
+
) -> None:
|
|
49279
|
+
"""Type checking stubs"""
|
|
49280
|
+
pass
|
|
49281
|
+
|
|
49282
|
+
def _typecheckingstub__147067753bcb82b7fc98e3b04dd99ea91c99dac8aec50a2f7076d3593aced862(
|
|
49283
|
+
scope: _constructs_77d1e7e8.IConstruct,
|
|
49284
|
+
) -> None:
|
|
49285
|
+
"""Type checking stubs"""
|
|
49286
|
+
pass
|
|
49287
|
+
|
|
47819
49288
|
def _typecheckingstub__6aeeebc397e1073be671305f45ff0de1478d4d043824a139c5e52661f7868baf(
|
|
47820
49289
|
_scope: _constructs_77d1e7e8.Construct,
|
|
47821
49290
|
_task_definition: TaskDefinition,
|
|
@@ -48035,6 +49504,22 @@ def _typecheckingstub__3407e1eace0b05ee1ef50b2d7263c1462cbbc2df7bfe6d22826f0f94f
|
|
|
48035
49504
|
"""Type checking stubs"""
|
|
48036
49505
|
pass
|
|
48037
49506
|
|
|
49507
|
+
def _typecheckingstub__bddcf05621152ce6e8fd520b5a7bb98f63b4f5805beda123da1f9f542d66294e(
|
|
49508
|
+
handler: _IFunction_6adb0ab8,
|
|
49509
|
+
id: builtins.str,
|
|
49510
|
+
*,
|
|
49511
|
+
lifecycle_stages: typing.Sequence[DeploymentLifecycleStage],
|
|
49512
|
+
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
49513
|
+
) -> None:
|
|
49514
|
+
"""Type checking stubs"""
|
|
49515
|
+
pass
|
|
49516
|
+
|
|
49517
|
+
def _typecheckingstub__c6510372e5e0e0b1114c294538138af0f03ebd70441a76bddd8496eca40f2fe8(
|
|
49518
|
+
scope: _constructs_77d1e7e8.IConstruct,
|
|
49519
|
+
) -> None:
|
|
49520
|
+
"""Type checking stubs"""
|
|
49521
|
+
pass
|
|
49522
|
+
|
|
48038
49523
|
def _typecheckingstub__0f3b91860780f56b42f6ab26d1855c0db28e15ef0dc9bcb868556324ed95a96b(
|
|
48039
49524
|
_scope: _constructs_77d1e7e8.Construct,
|
|
48040
49525
|
_container_definition: ContainerDefinition,
|
|
@@ -48095,6 +49580,12 @@ def _typecheckingstub__3cd0743b65b66534a274ff34e46f82cd780216193c08611a3b4e166e2
|
|
|
48095
49580
|
"""Type checking stubs"""
|
|
48096
49581
|
pass
|
|
48097
49582
|
|
|
49583
|
+
def _typecheckingstub__480743d611a768bf60af18dc6a08c65385351ccd86b4290955b74d1541662389(
|
|
49584
|
+
target: IDeploymentLifecycleHookTarget,
|
|
49585
|
+
) -> None:
|
|
49586
|
+
"""Type checking stubs"""
|
|
49587
|
+
pass
|
|
49588
|
+
|
|
48098
49589
|
def _typecheckingstub__e086e1f25717ea297fd9f530033e3685af15b9de3deb30fa9b228c05f8b0bcdc(
|
|
48099
49590
|
volume: ServiceManagedVolume,
|
|
48100
49591
|
) -> None:
|
|
@@ -48204,15 +49695,18 @@ def _typecheckingstub__1e578461670bd6cdf856f914534e1feff8905e31d33cd7aea2b9f5151
|
|
|
48204
49695
|
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
48205
49696
|
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48206
49697
|
cluster: ICluster,
|
|
49698
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
48207
49699
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
48208
49700
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48209
49701
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48210
49702
|
deployment_alarms: typing.Optional[typing.Union[DeploymentAlarmConfig, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48211
49703
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
49704
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
48212
49705
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
48213
49706
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
48214
49707
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
48215
49708
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
49709
|
+
lifecycle_hooks: typing.Optional[typing.Sequence[IDeploymentLifecycleHookTarget]] = None,
|
|
48216
49710
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
48217
49711
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
48218
49712
|
propagate_tags: typing.Optional[PropagatedTagSource] = None,
|
|
@@ -48354,15 +49848,18 @@ def _typecheckingstub__6ceef4de126cbb6bd6f379ba0b53be2fb61c35761f50685b5d228c682
|
|
|
48354
49848
|
daemon: typing.Optional[builtins.bool] = None,
|
|
48355
49849
|
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
48356
49850
|
cluster: ICluster,
|
|
49851
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
48357
49852
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
48358
49853
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48359
49854
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48360
49855
|
deployment_alarms: typing.Optional[typing.Union[DeploymentAlarmConfig, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48361
49856
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
49857
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
48362
49858
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
48363
49859
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
48364
49860
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
48365
49861
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
49862
|
+
lifecycle_hooks: typing.Optional[typing.Sequence[IDeploymentLifecycleHookTarget]] = None,
|
|
48366
49863
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
48367
49864
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
48368
49865
|
propagate_tags: typing.Optional[PropagatedTagSource] = None,
|
|
@@ -48460,15 +49957,18 @@ def _typecheckingstub__0ddac6b19472d00f74c1777e699ce5b239dc49e62ff4ab4674c917bbe
|
|
|
48460
49957
|
security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
|
|
48461
49958
|
vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48462
49959
|
cluster: ICluster,
|
|
49960
|
+
bake_time: typing.Optional[_Duration_4839e8c3] = None,
|
|
48463
49961
|
capacity_provider_strategies: typing.Optional[typing.Sequence[typing.Union[CapacityProviderStrategy, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
48464
49962
|
circuit_breaker: typing.Optional[typing.Union[DeploymentCircuitBreaker, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48465
49963
|
cloud_map_options: typing.Optional[typing.Union[CloudMapOptions, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48466
49964
|
deployment_alarms: typing.Optional[typing.Union[DeploymentAlarmConfig, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
48467
49965
|
deployment_controller: typing.Optional[typing.Union[DeploymentController, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
49966
|
+
deployment_strategy: typing.Optional[DeploymentStrategy] = None,
|
|
48468
49967
|
desired_count: typing.Optional[jsii.Number] = None,
|
|
48469
49968
|
enable_ecs_managed_tags: typing.Optional[builtins.bool] = None,
|
|
48470
49969
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
48471
49970
|
health_check_grace_period: typing.Optional[_Duration_4839e8c3] = None,
|
|
49971
|
+
lifecycle_hooks: typing.Optional[typing.Sequence[IDeploymentLifecycleHookTarget]] = None,
|
|
48472
49972
|
max_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
48473
49973
|
min_healthy_percent: typing.Optional[jsii.Number] = None,
|
|
48474
49974
|
propagate_tags: typing.Optional[PropagatedTagSource] = None,
|