aws-cdk-lib 2.126.0__py3-none-any.whl → 2.127.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 +0 -2
- aws_cdk/_jsii/__init__.py +1 -1
- aws_cdk/_jsii/{aws-cdk-lib@2.126.0.jsii.tgz → aws-cdk-lib@2.127.0.jsii.tgz} +0 -0
- aws_cdk/aws_acmpca/__init__.py +18 -6
- aws_cdk/aws_amazonmq/__init__.py +3 -2
- aws_cdk/aws_amplifyuibuilder/__init__.py +1212 -666
- aws_cdk/aws_apigateway/__init__.py +7 -3
- aws_cdk/aws_appconfig/__init__.py +108 -19
- aws_cdk/aws_appsync/__init__.py +43 -0
- aws_cdk/aws_autoscaling/__init__.py +37 -14
- aws_cdk/aws_cassandra/__init__.py +810 -4
- aws_cdk/aws_cloudfront/__init__.py +35 -37
- aws_cdk/aws_cloudfront/experimental/__init__.py +21 -0
- aws_cdk/aws_codebuild/__init__.py +43 -3
- aws_cdk/aws_codecommit/__init__.py +1 -0
- aws_cdk/aws_codepipeline/__init__.py +7 -3
- aws_cdk/aws_codepipeline_actions/__init__.py +11 -1
- aws_cdk/aws_codestarnotifications/__init__.py +24 -15
- aws_cdk/aws_cognito/__init__.py +180 -116
- aws_cdk/aws_datasync/__init__.py +8 -4
- aws_cdk/aws_dynamodb/__init__.py +80 -11
- aws_cdk/aws_ec2/__init__.py +207 -45
- aws_cdk/aws_ecs/__init__.py +171 -78
- aws_cdk/aws_ecs_patterns/__init__.py +24 -0
- aws_cdk/aws_efs/__init__.py +64 -8
- aws_cdk/aws_eks/__init__.py +52 -41
- aws_cdk/aws_elasticloadbalancingv2/__init__.py +12 -9
- aws_cdk/aws_fis/__init__.py +32 -12
- aws_cdk/aws_fsx/__init__.py +61 -43
- aws_cdk/aws_glue/__init__.py +449 -0
- aws_cdk/aws_guardduty/__init__.py +0 -8
- aws_cdk/aws_iam/__init__.py +3 -3
- aws_cdk/aws_inspectorv2/__init__.py +989 -0
- aws_cdk/aws_internetmonitor/__init__.py +10 -12
- aws_cdk/aws_iot/__init__.py +112 -0
- aws_cdk/aws_iotwireless/__init__.py +32 -19
- aws_cdk/aws_lambda/__init__.py +129 -32
- aws_cdk/aws_lambda_event_sources/__init__.py +95 -4
- aws_cdk/aws_lambda_nodejs/__init__.py +21 -0
- aws_cdk/aws_location/__init__.py +8 -2
- aws_cdk/aws_logs/__init__.py +7 -3
- aws_cdk/aws_networkmanager/__init__.py +1 -1
- aws_cdk/aws_opensearchserverless/__init__.py +4 -4
- aws_cdk/aws_osis/__init__.py +13 -13
- aws_cdk/aws_personalize/__init__.py +1 -1
- aws_cdk/aws_pinpoint/__init__.py +5 -5
- aws_cdk/aws_pipes/__init__.py +7 -10
- aws_cdk/aws_rds/__init__.py +449 -8
- aws_cdk/aws_redshiftserverless/__init__.py +282 -0
- aws_cdk/aws_rolesanywhere/__init__.py +53 -41
- aws_cdk/aws_route53/__init__.py +282 -0
- aws_cdk/aws_s3/__init__.py +11 -6
- aws_cdk/aws_sagemaker/__init__.py +1398 -39
- aws_cdk/aws_sns/__init__.py +56 -13
- aws_cdk/aws_sqs/__init__.py +13 -10
- aws_cdk/aws_stepfunctions/__init__.py +3612 -1395
- aws_cdk/aws_stepfunctions_tasks/__init__.py +267 -181
- aws_cdk/aws_transfer/__init__.py +1 -1
- aws_cdk/aws_verifiedpermissions/__init__.py +55 -55
- aws_cdk/aws_workspacesweb/__init__.py +6 -3
- aws_cdk/cx_api/__init__.py +17 -0
- aws_cdk/triggers/__init__.py +21 -0
- {aws_cdk_lib-2.126.0.dist-info → aws_cdk_lib-2.127.0.dist-info}/METADATA +1 -1
- {aws_cdk_lib-2.126.0.dist-info → aws_cdk_lib-2.127.0.dist-info}/RECORD +68 -69
- aws_cdk/aws_ssmguiconnect/__init__.py +0 -540
- {aws_cdk_lib-2.126.0.dist-info → aws_cdk_lib-2.127.0.dist-info}/LICENSE +0 -0
- {aws_cdk_lib-2.126.0.dist-info → aws_cdk_lib-2.127.0.dist-info}/NOTICE +0 -0
- {aws_cdk_lib-2.126.0.dist-info → aws_cdk_lib-2.127.0.dist-info}/WHEEL +0 -0
- {aws_cdk_lib-2.126.0.dist-info → aws_cdk_lib-2.127.0.dist-info}/top_level.txt +0 -0
aws_cdk/aws_ecs/__init__.py
CHANGED
|
@@ -1680,6 +1680,32 @@ custom_service = ecs.FargateService(self, "CustomizedService",
|
|
|
1680
1680
|
)
|
|
1681
1681
|
```
|
|
1682
1682
|
|
|
1683
|
+
To set a timeout for service connect, use `idleTimeout` and `perRequestTimeout`.
|
|
1684
|
+
|
|
1685
|
+
**Note**: If `idleTimeout` is set to a time that is less than `perRequestTimeout`, the connection will close when
|
|
1686
|
+
the `idleTimeout` is reached and not the `perRequestTimeout`.
|
|
1687
|
+
|
|
1688
|
+
```python
|
|
1689
|
+
# cluster: ecs.Cluster
|
|
1690
|
+
# task_definition: ecs.TaskDefinition
|
|
1691
|
+
|
|
1692
|
+
|
|
1693
|
+
service = ecs.FargateService(self, "Service",
|
|
1694
|
+
cluster=cluster,
|
|
1695
|
+
task_definition=task_definition,
|
|
1696
|
+
service_connect_configuration=ecs.ServiceConnectProps(
|
|
1697
|
+
services=[ecs.ServiceConnectService(
|
|
1698
|
+
port_mapping_name="api",
|
|
1699
|
+
idle_timeout=Duration.minutes(5),
|
|
1700
|
+
per_request_timeout=Duration.minutes(5)
|
|
1701
|
+
)
|
|
1702
|
+
]
|
|
1703
|
+
)
|
|
1704
|
+
)
|
|
1705
|
+
```
|
|
1706
|
+
|
|
1707
|
+
> Visit [Amazon ECS support for configurable timeout for services running with Service Connect](https://aws.amazon.com/about-aws/whats-new/2024/01/amazon-ecs-configurable-timeout-service-connect/) for more details.
|
|
1708
|
+
|
|
1683
1709
|
## ServiceManagedVolume
|
|
1684
1710
|
|
|
1685
1711
|
Amazon ECS now supports the attachment of Amazon Elastic Block Store (EBS) volumes to ECS tasks,
|
|
@@ -4593,7 +4619,9 @@ class BaseServiceOptions:
|
|
|
4593
4619
|
# the properties below are optional
|
|
4594
4620
|
discovery_name="discoveryName",
|
|
4595
4621
|
dns_name="dnsName",
|
|
4622
|
+
idle_timeout=cdk.Duration.minutes(30),
|
|
4596
4623
|
ingress_port_override=123,
|
|
4624
|
+
per_request_timeout=cdk.Duration.minutes(30),
|
|
4597
4625
|
port=123
|
|
4598
4626
|
)]
|
|
4599
4627
|
),
|
|
@@ -4989,7 +5017,9 @@ class BaseServiceProps(BaseServiceOptions):
|
|
|
4989
5017
|
# the properties below are optional
|
|
4990
5018
|
discovery_name="discoveryName",
|
|
4991
5019
|
dns_name="dnsName",
|
|
5020
|
+
idle_timeout=cdk.Duration.minutes(30),
|
|
4992
5021
|
ingress_port_override=123,
|
|
5022
|
+
per_request_timeout=cdk.Duration.minutes(30),
|
|
4993
5023
|
port=123
|
|
4994
5024
|
)]
|
|
4995
5025
|
),
|
|
@@ -9194,7 +9224,7 @@ class CfnService(
|
|
|
9194
9224
|
|
|
9195
9225
|
Services with tasks that use the ``awsvpc`` network mode (for example, those with the Fargate launch type) only support Application Load Balancers and Network Load Balancers. Classic Load Balancers are not supported. Also, when you create any target groups for these services, you must choose ``ip`` as the target type, not ``instance`` . Tasks that use the ``awsvpc`` network mode are associated with an elastic network interface, not an Amazon EC2 instance.
|
|
9196
9226
|
|
|
9197
|
-
:param container_name: The name of the container (as it appears in a container definition) to associate with the load balancer.
|
|
9227
|
+
:param container_name: The name of the container (as it appears in a container definition) to associate with the load balancer. You need to specify the container name when configuring the target group for an Amazon ECS load balancer.
|
|
9198
9228
|
:param container_port: The port on the container to associate with the load balancer. This port must correspond to a ``containerPort`` in the task definition the tasks in the service are using. For tasks that use the EC2 launch type, the container instance they're launched on must allow ingress traffic on the ``hostPort`` of the port mapping.
|
|
9199
9229
|
:param load_balancer_name: The name of the load balancer to associate with the Amazon ECS service or task set. If you are using an Application Load Balancer or a Network Load Balancer the load balancer name parameter should be omitted.
|
|
9200
9230
|
:param target_group_arn: The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service or task set. A target group ARN is only specified when using an Application Load Balancer or Network Load Balancer. For services using the ``ECS`` deployment controller, you can specify one or multiple target groups. For more information, see `Registering multiple target groups with a service <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html>`_ in the *Amazon Elastic Container Service Developer Guide* . For services using the ``CODE_DEPLOY`` deployment controller, you're required to define two target groups for the load balancer. For more information, see `Blue/green deployment with CodeDeploy <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html>`_ in the *Amazon Elastic Container Service Developer Guide* . .. epigraph:: If your service's task definition uses the ``awsvpc`` network mode, you must choose ``ip`` as the target type, not ``instance`` . Do this when creating your target groups because tasks that use the ``awsvpc`` network mode are associated with an elastic network interface, not an Amazon EC2 instance. This network mode is required for the Fargate launch type.
|
|
@@ -9235,6 +9265,8 @@ class CfnService(
|
|
|
9235
9265
|
def container_name(self) -> typing.Optional[builtins.str]:
|
|
9236
9266
|
'''The name of the container (as it appears in a container definition) to associate with the load balancer.
|
|
9237
9267
|
|
|
9268
|
+
You need to specify the container name when configuring the target group for an Amazon ECS load balancer.
|
|
9269
|
+
|
|
9238
9270
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-loadbalancer.html#cfn-ecs-service-loadbalancer-containername
|
|
9239
9271
|
'''
|
|
9240
9272
|
result = self._values.get("container_name")
|
|
@@ -11571,6 +11603,7 @@ class CfnTaskDefinition(
|
|
|
11571
11603
|
# the properties below are optional
|
|
11572
11604
|
command=["command"],
|
|
11573
11605
|
cpu=123,
|
|
11606
|
+
credential_specs=["credentialSpecs"],
|
|
11574
11607
|
depends_on=[ecs.CfnTaskDefinition.ContainerDependencyProperty(
|
|
11575
11608
|
condition="condition",
|
|
11576
11609
|
container_name="containerName"
|
|
@@ -12227,6 +12260,7 @@ class CfnTaskDefinition(
|
|
|
12227
12260
|
"name": "name",
|
|
12228
12261
|
"command": "command",
|
|
12229
12262
|
"cpu": "cpu",
|
|
12263
|
+
"credential_specs": "credentialSpecs",
|
|
12230
12264
|
"depends_on": "dependsOn",
|
|
12231
12265
|
"disable_networking": "disableNetworking",
|
|
12232
12266
|
"dns_search_domains": "dnsSearchDomains",
|
|
@@ -12272,6 +12306,7 @@ class CfnTaskDefinition(
|
|
|
12272
12306
|
name: builtins.str,
|
|
12273
12307
|
command: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
12274
12308
|
cpu: typing.Optional[jsii.Number] = None,
|
|
12309
|
+
credential_specs: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
12275
12310
|
depends_on: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Sequence[typing.Union[_IResolvable_da3f097b, typing.Union["CfnTaskDefinition.ContainerDependencyProperty", typing.Dict[builtins.str, typing.Any]]]]]] = None,
|
|
12276
12311
|
disable_networking: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
|
|
12277
12312
|
dns_search_domains: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
@@ -12316,6 +12351,7 @@ class CfnTaskDefinition(
|
|
|
12316
12351
|
:param name: The name of a container. If you're linking multiple containers together in a task definition, the ``name`` of one container can be entered in the ``links`` of another container to connect the containers. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed. This parameter maps to ``name`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``--name`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ .
|
|
12317
12352
|
:param command: The command that's passed to the container. This parameter maps to ``Cmd`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``COMMAND`` parameter to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . For more information, see `https://docs.docker.com/engine/reference/builder/#cmd <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/builder/#cmd>`_ . If there are multiple arguments, each argument is a separated string in the array.
|
|
12318
12353
|
:param cpu: The number of ``cpu`` units reserved for the container. This parameter maps to ``CpuShares`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``--cpu-shares`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . This field is optional for tasks using the Fargate launch type, and the only requirement is that the total amount of CPU reserved for all containers within a task be lower than the task-level ``cpu`` value. .. epigraph:: You can determine the number of CPU units that are available per EC2 instance type by multiplying the vCPUs listed for that instance type on the `Amazon EC2 Instances <https://docs.aws.amazon.com/ec2/instance-types/>`_ detail page by 1,024. Linux containers share unallocated CPU units with other containers on the container instance with the same ratio as their allocated amount. For example, if you run a single-container task on a single-core instance type with 512 CPU units specified for that container, and that's the only task running on the container instance, that container could use the full 1,024 CPU unit share at any given time. However, if you launched another copy of the same task on that container instance, each task is guaranteed a minimum of 512 CPU units when needed. Moreover, each container could float to higher CPU usage if the other container was not using it. If both tasks were 100% active all of the time, they would be limited to 512 CPU units. On Linux container instances, the Docker daemon on the container instance uses the CPU value to calculate the relative CPU share ratios for running containers. For more information, see `CPU share constraint <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#cpu-share-constraint>`_ in the Docker documentation. The minimum valid CPU share value that the Linux kernel allows is 2. However, the CPU parameter isn't required, and you can use CPU values below 2 in your container definitions. For CPU values below 2 (including null), the behavior varies based on your Amazon ECS container agent version: - *Agent versions less than or equal to 1.1.0:* Null and zero CPU values are passed to Docker as 0, which Docker then converts to 1,024 CPU shares. CPU values of 1 are passed to Docker as 1, which the Linux kernel converts to two CPU shares. - *Agent versions greater than or equal to 1.2.0:* Null, zero, and CPU values of 1 are passed to Docker as 2. On Windows container instances, the CPU limit is enforced as an absolute limit, or a quota. Windows containers only have access to the specified amount of CPU that's described in the task definition. A null or zero CPU value is passed to Docker as ``0`` , which Windows interprets as 1% of one CPU.
|
|
12354
|
+
:param credential_specs: A list of ARNs in SSM or Amazon S3 to a credential spec ( ``CredSpec`` ) file that configures the container for Active Directory authentication. We recommend that you use this parameter instead of the ``dockerSecurityOptions`` . The maximum number of ARNs is 1. There are two formats for each ARN. - **credentialspecdomainless:MyARN** - You use ``credentialspecdomainless:MyARN`` to provide a ``CredSpec`` with an additional section for a secret in AWS Secrets Manager . You provide the login credentials to the domain in the secret. Each task that runs on any container instance can join different domains. You can use this format without joining the container instance to a domain. - **credentialspec:MyARN** - You use ``credentialspec:MyARN`` to provide a ``CredSpec`` for a single domain. You must join the container instance to the domain before you start any tasks that use this task definition. In both formats, replace ``MyARN`` with the ARN in SSM or Amazon S3. If you provide a ``credentialspecdomainless:MyARN`` , the ``credspec`` must provide a ARN in AWS Secrets Manager for a secret containing the username, password, and the domain to connect to. For better security, the instance isn't joined to the domain for domainless authentication. Other applications on the instance can't use the domainless credentials. You can use this parameter to run tasks on the same instance, even it the tasks need to join different domains. For more information, see `Using gMSAs for Windows Containers <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html>`_ and `Using gMSAs for Linux Containers <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/linux-gmsa.html>`_ .
|
|
12319
12355
|
:param depends_on: The dependencies defined for container startup and shutdown. A container can contain multiple dependencies. When a dependency is defined for container startup, for container shutdown it is reversed. For tasks using the EC2 launch type, the container instances require at least version 1.26.0 of the container agent to turn on container dependencies. However, we recommend using the latest container agent version. For information about checking your agent version and updating to the latest version, see `Updating the Amazon ECS Container Agent <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html>`_ in the *Amazon Elastic Container Service Developer Guide* . If you're using an Amazon ECS-optimized Linux AMI, your instance needs at least version 1.26.0-1 of the ``ecs-init`` package. If your container instances are launched from version ``20190301`` or later, then they contain the required versions of the container agent and ``ecs-init`` . For more information, see `Amazon ECS-optimized Linux AMI <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html>`_ in the *Amazon Elastic Container Service Developer Guide* . For tasks using the Fargate launch type, the task or service requires the following platforms: - Linux platform version ``1.3.0`` or later. - Windows platform version ``1.0.0`` or later. If the task definition is used in a blue/green deployment that uses `AWS::CodeDeploy::DeploymentGroup BlueGreenDeploymentConfiguration <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codedeploy-deploymentgroup-bluegreendeploymentconfiguration.html>`_ , the ``dependsOn`` parameter is not supported. For more information see `Issue #680 <https://docs.aws.amazon.com/https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/680>`_ on the on the GitHub website.
|
|
12320
12356
|
:param disable_networking: When this parameter is true, networking is off within the container. This parameter maps to ``NetworkDisabled`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ . .. epigraph:: This parameter is not supported for Windows containers.
|
|
12321
12357
|
:param dns_search_domains: A list of DNS search domains that are presented to the container. This parameter maps to ``DnsSearch`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``--dns-search`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . .. epigraph:: This parameter is not supported for Windows containers.
|
|
@@ -12346,7 +12382,7 @@ class CfnTaskDefinition(
|
|
|
12346
12382
|
:param secrets: The secrets to pass to the container. For more information, see `Specifying Sensitive Data <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html>`_ in the *Amazon Elastic Container Service Developer Guide* .
|
|
12347
12383
|
:param start_timeout: Time duration (in seconds) to wait before giving up on resolving dependencies for a container. For example, you specify two containers in a task definition with containerA having a dependency on containerB reaching a ``COMPLETE`` , ``SUCCESS`` , or ``HEALTHY`` status. If a ``startTimeout`` value is specified for containerB and it doesn't reach the desired status within that time then containerA gives up and not start. This results in the task transitioning to a ``STOPPED`` state. .. epigraph:: When the ``ECS_CONTAINER_START_TIMEOUT`` container agent configuration variable is used, it's enforced independently from this start timeout value. For tasks using the Fargate launch type, the task or service requires the following platforms: - Linux platform version ``1.3.0`` or later. - Windows platform version ``1.0.0`` or later. For tasks using the EC2 launch type, your container instances require at least version ``1.26.0`` of the container agent to use a container start timeout value. However, we recommend using the latest container agent version. For information about checking your agent version and updating to the latest version, see `Updating the Amazon ECS Container Agent <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html>`_ in the *Amazon Elastic Container Service Developer Guide* . If you're using an Amazon ECS-optimized Linux AMI, your instance needs at least version ``1.26.0-1`` of the ``ecs-init`` package. If your container instances are launched from version ``20190301`` or later, then they contain the required versions of the container agent and ``ecs-init`` . For more information, see `Amazon ECS-optimized Linux AMI <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html>`_ in the *Amazon Elastic Container Service Developer Guide* . The valid values are 2-120 seconds.
|
|
12348
12384
|
:param stop_timeout: Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. For tasks using the Fargate launch type, the task or service requires the following platforms: - Linux platform version ``1.3.0`` or later. - Windows platform version ``1.0.0`` or later. The max stop timeout value is 120 seconds and if the parameter is not specified, the default value of 30 seconds is used. For tasks that use the EC2 launch type, if the ``stopTimeout`` parameter isn't specified, the value set for the Amazon ECS container agent configuration variable ``ECS_CONTAINER_STOP_TIMEOUT`` is used. If neither the ``stopTimeout`` parameter or the ``ECS_CONTAINER_STOP_TIMEOUT`` agent configuration variable are set, then the default values of 30 seconds for Linux containers and 30 seconds on Windows containers are used. Your container instances require at least version 1.26.0 of the container agent to use a container stop timeout value. However, we recommend using the latest container agent version. For information about checking your agent version and updating to the latest version, see `Updating the Amazon ECS Container Agent <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html>`_ in the *Amazon Elastic Container Service Developer Guide* . If you're using an Amazon ECS-optimized Linux AMI, your instance needs at least version 1.26.0-1 of the ``ecs-init`` package. If your container instances are launched from version ``20190301`` or later, then they contain the required versions of the container agent and ``ecs-init`` . For more information, see `Amazon ECS-optimized Linux AMI <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html>`_ in the *Amazon Elastic Container Service Developer Guide* . The valid values are 2-120 seconds.
|
|
12349
|
-
:param system_controls: A list of namespaced kernel parameters to set in the container. This parameter maps to ``Sysctls`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``--sysctl`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . For example, you can configure ``net.ipv4.tcp_keepalive_time`` setting to maintain longer lived connections.
|
|
12385
|
+
:param system_controls: A list of namespaced kernel parameters to set in the container. This parameter maps to ``Sysctls`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``--sysctl`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . For example, you can configure ``net.ipv4.tcp_keepalive_time`` setting to maintain longer lived connections.
|
|
12350
12386
|
:param ulimits: A list of ``ulimits`` to set in the container. This parameter maps to ``Ulimits`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``--ulimit`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/>`_ . Valid naming values are displayed in the `Ulimit <https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Ulimit.html>`_ data type. This parameter requires version 1.18 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: ``sudo docker version --format '{{.Server.APIVersion}}'`` .. epigraph:: This parameter is not supported for Windows containers.
|
|
12351
12387
|
:param user: The user to use inside the container. This parameter maps to ``User`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``--user`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . .. epigraph:: When running tasks using the ``host`` network mode, don't run containers using the root user (UID 0). We recommend using a non-root user for better security. You can specify the ``user`` using the following formats. If specifying a UID or GID, you must specify it as a positive integer. - ``user`` - ``user:group`` - ``uid`` - ``uid:gid`` - ``user:gid`` - ``uid:group`` .. epigraph:: This parameter is not supported for Windows containers.
|
|
12352
12388
|
:param volumes_from: Data volumes to mount from another container. This parameter maps to ``VolumesFrom`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``--volumes-from`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ .
|
|
@@ -12368,6 +12404,7 @@ class CfnTaskDefinition(
|
|
|
12368
12404
|
# the properties below are optional
|
|
12369
12405
|
command=["command"],
|
|
12370
12406
|
cpu=123,
|
|
12407
|
+
credential_specs=["credentialSpecs"],
|
|
12371
12408
|
depends_on=[ecs.CfnTaskDefinition.ContainerDependencyProperty(
|
|
12372
12409
|
condition="condition",
|
|
12373
12410
|
container_name="containerName"
|
|
@@ -12497,6 +12534,7 @@ class CfnTaskDefinition(
|
|
|
12497
12534
|
check_type(argname="argument name", value=name, expected_type=type_hints["name"])
|
|
12498
12535
|
check_type(argname="argument command", value=command, expected_type=type_hints["command"])
|
|
12499
12536
|
check_type(argname="argument cpu", value=cpu, expected_type=type_hints["cpu"])
|
|
12537
|
+
check_type(argname="argument credential_specs", value=credential_specs, expected_type=type_hints["credential_specs"])
|
|
12500
12538
|
check_type(argname="argument depends_on", value=depends_on, expected_type=type_hints["depends_on"])
|
|
12501
12539
|
check_type(argname="argument disable_networking", value=disable_networking, expected_type=type_hints["disable_networking"])
|
|
12502
12540
|
check_type(argname="argument dns_search_domains", value=dns_search_domains, expected_type=type_hints["dns_search_domains"])
|
|
@@ -12540,6 +12578,8 @@ class CfnTaskDefinition(
|
|
|
12540
12578
|
self._values["command"] = command
|
|
12541
12579
|
if cpu is not None:
|
|
12542
12580
|
self._values["cpu"] = cpu
|
|
12581
|
+
if credential_specs is not None:
|
|
12582
|
+
self._values["credential_specs"] = credential_specs
|
|
12543
12583
|
if depends_on is not None:
|
|
12544
12584
|
self._values["depends_on"] = depends_on
|
|
12545
12585
|
if disable_networking is not None:
|
|
@@ -12677,6 +12717,33 @@ class CfnTaskDefinition(
|
|
|
12677
12717
|
result = self._values.get("cpu")
|
|
12678
12718
|
return typing.cast(typing.Optional[jsii.Number], result)
|
|
12679
12719
|
|
|
12720
|
+
@builtins.property
|
|
12721
|
+
def credential_specs(self) -> typing.Optional[typing.List[builtins.str]]:
|
|
12722
|
+
'''A list of ARNs in SSM or Amazon S3 to a credential spec ( ``CredSpec`` ) file that configures the container for Active Directory authentication.
|
|
12723
|
+
|
|
12724
|
+
We recommend that you use this parameter instead of the ``dockerSecurityOptions`` . The maximum number of ARNs is 1.
|
|
12725
|
+
|
|
12726
|
+
There are two formats for each ARN.
|
|
12727
|
+
|
|
12728
|
+
- **credentialspecdomainless:MyARN** - You use ``credentialspecdomainless:MyARN`` to provide a ``CredSpec`` with an additional section for a secret in AWS Secrets Manager . You provide the login credentials to the domain in the secret.
|
|
12729
|
+
|
|
12730
|
+
Each task that runs on any container instance can join different domains.
|
|
12731
|
+
|
|
12732
|
+
You can use this format without joining the container instance to a domain.
|
|
12733
|
+
|
|
12734
|
+
- **credentialspec:MyARN** - You use ``credentialspec:MyARN`` to provide a ``CredSpec`` for a single domain.
|
|
12735
|
+
|
|
12736
|
+
You must join the container instance to the domain before you start any tasks that use this task definition.
|
|
12737
|
+
|
|
12738
|
+
In both formats, replace ``MyARN`` with the ARN in SSM or Amazon S3.
|
|
12739
|
+
|
|
12740
|
+
If you provide a ``credentialspecdomainless:MyARN`` , the ``credspec`` must provide a ARN in AWS Secrets Manager for a secret containing the username, password, and the domain to connect to. For better security, the instance isn't joined to the domain for domainless authentication. Other applications on the instance can't use the domainless credentials. You can use this parameter to run tasks on the same instance, even it the tasks need to join different domains. For more information, see `Using gMSAs for Windows Containers <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html>`_ and `Using gMSAs for Linux Containers <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/linux-gmsa.html>`_ .
|
|
12741
|
+
|
|
12742
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-credentialspecs
|
|
12743
|
+
'''
|
|
12744
|
+
result = self._values.get("credential_specs")
|
|
12745
|
+
return typing.cast(typing.Optional[typing.List[builtins.str]], result)
|
|
12746
|
+
|
|
12680
12747
|
@builtins.property
|
|
12681
12748
|
def depends_on(
|
|
12682
12749
|
self,
|
|
@@ -13170,20 +13237,6 @@ class CfnTaskDefinition(
|
|
|
13170
13237
|
|
|
13171
13238
|
This parameter maps to ``Sysctls`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``--sysctl`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . For example, you can configure ``net.ipv4.tcp_keepalive_time`` setting to maintain longer lived connections.
|
|
13172
13239
|
|
|
13173
|
-
We don't recommend that you specify network-related ``systemControls`` parameters for multiple containers in a single task that also uses either the ``awsvpc`` or ``host`` network mode. Doing this has the following disadvantages:
|
|
13174
|
-
|
|
13175
|
-
- For tasks that use the ``awsvpc`` network mode including Fargate, if you set ``systemControls`` for any container, it applies to all containers in the task. If you set different ``systemControls`` for multiple containers in a single task, the container that's started last determines which ``systemControls`` take effect.
|
|
13176
|
-
- For tasks that use the ``host`` network mode, the network namespace ``systemControls`` aren't supported.
|
|
13177
|
-
|
|
13178
|
-
If you're setting an IPC resource namespace to use for the containers in the task, the following conditions apply to your system controls. For more information, see `IPC mode <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_definition_ipcmode>`_ .
|
|
13179
|
-
|
|
13180
|
-
- For tasks that use the ``host`` IPC mode, IPC namespace ``systemControls`` aren't supported.
|
|
13181
|
-
- For tasks that use the ``task`` IPC mode, IPC namespace ``systemControls`` values apply to all containers within a task.
|
|
13182
|
-
|
|
13183
|
-
.. epigraph::
|
|
13184
|
-
|
|
13185
|
-
This parameter is not supported for Windows containers. > This parameter is only supported for tasks that are hosted on AWS Fargate if the tasks are using platform version ``1.4.0`` or later (Linux). This isn't supported for Windows containers on Fargate.
|
|
13186
|
-
|
|
13187
13240
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinition.html#cfn-ecs-taskdefinition-containerdefinition-systemcontrols
|
|
13188
13241
|
'''
|
|
13189
13242
|
result = self._values.get("system_controls")
|
|
@@ -13821,7 +13874,7 @@ class CfnTaskDefinition(
|
|
|
13821
13874
|
def __init__(self, *, size_in_gib: typing.Optional[jsii.Number] = None) -> None:
|
|
13822
13875
|
'''The amount of ephemeral storage to allocate for the task.
|
|
13823
13876
|
|
|
13824
|
-
This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate . For more information, see `
|
|
13877
|
+
This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate . For more information, see `Using data volumes in tasks <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html>`_ in the *Amazon ECS Developer Guide;* .
|
|
13825
13878
|
.. epigraph::
|
|
13826
13879
|
|
|
13827
13880
|
For tasks using the Fargate launch type, the task requires the following platforms:
|
|
@@ -15507,12 +15560,21 @@ class CfnTaskDefinition(
|
|
|
15507
15560
|
) -> None:
|
|
15508
15561
|
'''A list of namespaced kernel parameters to set in the container.
|
|
15509
15562
|
|
|
15510
|
-
This parameter maps to ``Sysctls`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``--sysctl`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ .
|
|
15563
|
+
This parameter maps to ``Sysctls`` in the `Create a container <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate>`_ section of the `Docker Remote API <https://docs.aws.amazon.com/https://docs.docker.com/engine/api/v1.35/>`_ and the ``--sysctl`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . For example, you can configure ``net.ipv4.tcp_keepalive_time`` setting to maintain longer lived connections.
|
|
15564
|
+
|
|
15565
|
+
We don't recommend that you specify network-related ``systemControls`` parameters for multiple containers in a single task that also uses either the ``awsvpc`` or ``host`` network mode. Doing this has the following disadvantages:
|
|
15566
|
+
|
|
15567
|
+
- For tasks that use the ``awsvpc`` network mode including Fargate, if you set ``systemControls`` for any container, it applies to all containers in the task. If you set different ``systemControls`` for multiple containers in a single task, the container that's started last determines which ``systemControls`` take effect.
|
|
15568
|
+
- For tasks that use the ``host`` network mode, the network namespace ``systemControls`` aren't supported.
|
|
15569
|
+
|
|
15570
|
+
If you're setting an IPC resource namespace to use for the containers in the task, the following conditions apply to your system controls. For more information, see `IPC mode <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_definition_ipcmode>`_ .
|
|
15511
15571
|
|
|
15512
|
-
|
|
15572
|
+
- For tasks that use the ``host`` IPC mode, IPC namespace ``systemControls`` aren't supported.
|
|
15573
|
+
- For tasks that use the ``task`` IPC mode, IPC namespace ``systemControls`` values apply to all containers within a task.
|
|
15574
|
+
|
|
15575
|
+
.. epigraph::
|
|
15513
15576
|
|
|
15514
|
-
|
|
15515
|
-
- For tasks that use the ``host`` network mode, the ``systemControls`` parameter applies to the container instance's kernel parameter and that of all containers of any tasks running on that container instance.
|
|
15577
|
+
This parameter is not supported for Windows containers. > This parameter is only supported for tasks that are hosted on AWS Fargate if the tasks are using platform version ``1.4.0`` or later (Linux). This isn't supported for Windows containers on Fargate.
|
|
15516
15578
|
|
|
15517
15579
|
:param namespace: The namespaced kernel parameter to set a ``value`` for.
|
|
15518
15580
|
:param value: The namespaced kernel parameter to set a ``value`` for. Valid IPC namespace values: ``"kernel.msgmax" | "kernel.msgmnb" | "kernel.msgmni" | "kernel.sem" | "kernel.shmall" | "kernel.shmmax" | "kernel.shmmni" | "kernel.shm_rmid_forced"`` , and ``Sysctls`` that start with ``"fs.mqueue.*"`` Valid network namespace values: ``Sysctls`` that start with ``"net.*"`` All of these values are supported by Fargate.
|
|
@@ -16176,6 +16238,7 @@ class CfnTaskDefinitionProps:
|
|
|
16176
16238
|
# the properties below are optional
|
|
16177
16239
|
command=["command"],
|
|
16178
16240
|
cpu=123,
|
|
16241
|
+
credential_specs=["credentialSpecs"],
|
|
16179
16242
|
depends_on=[ecs.CfnTaskDefinition.ContainerDependencyProperty(
|
|
16180
16243
|
condition="condition",
|
|
16181
16244
|
container_name="containerName"
|
|
@@ -17159,7 +17222,7 @@ class CfnTaskSet(
|
|
|
17159
17222
|
|
|
17160
17223
|
A service-linked role is required for services that use multiple target groups. For more information, see `Using service-linked roles <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html>`_ in the *Amazon Elastic Container Service Developer Guide* .
|
|
17161
17224
|
|
|
17162
|
-
:param container_name: The name of the container (as it appears in a container definition) to associate with the load balancer.
|
|
17225
|
+
:param container_name: The name of the container (as it appears in a container definition) to associate with the load balancer. You need to specify the container name when configuring the target group for an Amazon ECS load balancer.
|
|
17163
17226
|
:param container_port: The port on the container to associate with the load balancer. This port must correspond to a ``containerPort`` in the task definition the tasks in the service are using. For tasks that use the EC2 launch type, the container instance they're launched on must allow ingress traffic on the ``hostPort`` of the port mapping.
|
|
17164
17227
|
:param target_group_arn: The full Amazon Resource Name (ARN) of the Elastic Load Balancing target group or groups associated with a service or task set. A target group ARN is only specified when using an Application Load Balancer or Network Load Balancer. For services using the ``ECS`` deployment controller, you can specify one or multiple target groups. For more information, see `Registering multiple target groups with a service <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/register-multiple-targetgroups.html>`_ in the *Amazon Elastic Container Service Developer Guide* . For services using the ``CODE_DEPLOY`` deployment controller, you're required to define two target groups for the load balancer. For more information, see `Blue/green deployment with CodeDeploy <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html>`_ in the *Amazon Elastic Container Service Developer Guide* . .. epigraph:: If your service's task definition uses the ``awsvpc`` network mode, you must choose ``ip`` as the target type, not ``instance`` . Do this when creating your target groups because tasks that use the ``awsvpc`` network mode are associated with an elastic network interface, not an Amazon EC2 instance. This network mode is required for the Fargate launch type.
|
|
17165
17228
|
|
|
@@ -17195,6 +17258,8 @@ class CfnTaskSet(
|
|
|
17195
17258
|
def container_name(self) -> typing.Optional[builtins.str]:
|
|
17196
17259
|
'''The name of the container (as it appears in a container definition) to associate with the load balancer.
|
|
17197
17260
|
|
|
17261
|
+
You need to specify the container name when configuring the target group for an Amazon ECS load balancer.
|
|
17262
|
+
|
|
17198
17263
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-loadbalancer.html#cfn-ecs-taskset-loadbalancer-containername
|
|
17199
17264
|
'''
|
|
17200
17265
|
result = self._values.get("container_name")
|
|
@@ -22017,7 +22082,7 @@ class Ec2ServiceProps(BaseServiceOptions):
|
|
|
22017
22082
|
:param volume_configurations: Configuration details for a volume used by the service. This allows you to specify details about the EBS volume that can be attched to ECS tasks. Default: - undefined
|
|
22018
22083
|
:param task_definition: The task definition to use for tasks in the service. [disable-awslint:ref-via-interface]
|
|
22019
22084
|
:param assign_public_ip: Specifies whether the task's elastic network interface receives a public IP address. If true, each task will receive a public IP address. This property is only used for tasks that use the awsvpc network mode. Default: false
|
|
22020
|
-
:param daemon: Specifies whether the service will use the 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
|
|
22085
|
+
:param daemon: Specifies whether the service will use the 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. Default: false
|
|
22021
22086
|
:param placement_constraints: The placement constraints to use for tasks in the service. For more information, see `Amazon ECS Task Placement Constraints <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html>`_. Default: - No constraints.
|
|
22022
22087
|
:param placement_strategies: The placement strategies to use for tasks in the service. For more information, see `Amazon ECS Task Placement Strategies <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html>`_. Default: - No strategies.
|
|
22023
22088
|
: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.
|
|
@@ -22331,7 +22396,7 @@ class Ec2ServiceProps(BaseServiceOptions):
|
|
|
22331
22396
|
|
|
22332
22397
|
If true, the service scheduler deploys exactly one task on each container instance in your cluster.
|
|
22333
22398
|
|
|
22334
|
-
When you are using this strategy, do not specify a desired number of tasks
|
|
22399
|
+
When you are using this strategy, do not specify a desired number of tasks or any task placement strategies.
|
|
22335
22400
|
|
|
22336
22401
|
:default: false
|
|
22337
22402
|
'''
|
|
@@ -24749,33 +24814,27 @@ class FargateServiceProps(BaseServiceOptions):
|
|
|
24749
24814
|
|
|
24750
24815
|
# cluster: ecs.Cluster
|
|
24751
24816
|
# task_definition: ecs.TaskDefinition
|
|
24817
|
+
# elb_alarm: cw.Alarm
|
|
24818
|
+
|
|
24752
24819
|
|
|
24753
|
-
service_name = "MyFargateService"
|
|
24754
24820
|
service = ecs.FargateService(self, "Service",
|
|
24755
|
-
service_name=service_name,
|
|
24756
24821
|
cluster=cluster,
|
|
24757
|
-
task_definition=task_definition
|
|
24822
|
+
task_definition=task_definition,
|
|
24823
|
+
deployment_alarms=ecs.DeploymentAlarmConfig(
|
|
24824
|
+
alarm_names=[elb_alarm.alarm_name],
|
|
24825
|
+
behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
|
|
24826
|
+
)
|
|
24758
24827
|
)
|
|
24759
24828
|
|
|
24760
|
-
|
|
24761
|
-
|
|
24762
|
-
|
|
24763
|
-
|
|
24764
|
-
|
|
24765
|
-
dimensions_map={
|
|
24766
|
-
"ClusterName": cluster.cluster_name,
|
|
24767
|
-
# Using `service.serviceName` here will cause a circular dependency
|
|
24768
|
-
"ServiceName": service_name
|
|
24769
|
-
}
|
|
24770
|
-
)
|
|
24771
|
-
my_alarm = cw.Alarm(self, "CPUAlarm",
|
|
24772
|
-
alarm_name="cpuAlarmName",
|
|
24773
|
-
metric=cpu_metric,
|
|
24829
|
+
# Defining a deployment alarm after the service has been created
|
|
24830
|
+
cpu_alarm_name = "MyCpuMetricAlarm"
|
|
24831
|
+
cw.Alarm(self, "CPUAlarm",
|
|
24832
|
+
alarm_name=cpu_alarm_name,
|
|
24833
|
+
metric=service.metric_cpu_utilization(),
|
|
24774
24834
|
evaluation_periods=2,
|
|
24775
24835
|
threshold=80
|
|
24776
24836
|
)
|
|
24777
|
-
|
|
24778
|
-
service.enable_deployment_alarms([my_alarm.alarm_name],
|
|
24837
|
+
service.enable_deployment_alarms([cpu_alarm_name],
|
|
24779
24838
|
behavior=ecs.AlarmBehavior.FAIL_ON_ALARM
|
|
24780
24839
|
)
|
|
24781
24840
|
'''
|
|
@@ -32412,28 +32471,21 @@ class ServiceConnectProps:
|
|
|
32412
32471
|
|
|
32413
32472
|
# cluster: ecs.Cluster
|
|
32414
32473
|
# task_definition: ecs.TaskDefinition
|
|
32415
|
-
# container_options: ecs.ContainerDefinitionOptions
|
|
32416
32474
|
|
|
32417
32475
|
|
|
32418
|
-
|
|
32419
|
-
|
|
32420
|
-
container.add_port_mappings(
|
|
32421
|
-
name="api",
|
|
32422
|
-
container_port=8080
|
|
32423
|
-
)
|
|
32424
|
-
|
|
32425
|
-
cluster.add_default_cloud_map_namespace(
|
|
32426
|
-
name="local"
|
|
32427
|
-
)
|
|
32428
|
-
|
|
32429
|
-
service = ecs.FargateService(self, "Service",
|
|
32476
|
+
custom_service = ecs.FargateService(self, "CustomizedService",
|
|
32430
32477
|
cluster=cluster,
|
|
32431
32478
|
task_definition=task_definition,
|
|
32432
32479
|
service_connect_configuration=ecs.ServiceConnectProps(
|
|
32480
|
+
log_driver=ecs.LogDrivers.aws_logs(
|
|
32481
|
+
stream_prefix="sc-traffic"
|
|
32482
|
+
),
|
|
32433
32483
|
services=[ecs.ServiceConnectService(
|
|
32434
32484
|
port_mapping_name="api",
|
|
32435
|
-
dns_name="
|
|
32436
|
-
port=80
|
|
32485
|
+
dns_name="customized-api",
|
|
32486
|
+
port=80,
|
|
32487
|
+
ingress_port_override=20040,
|
|
32488
|
+
discovery_name="custom"
|
|
32437
32489
|
)
|
|
32438
32490
|
]
|
|
32439
32491
|
)
|
|
@@ -32500,7 +32552,9 @@ class ServiceConnectProps:
|
|
|
32500
32552
|
"port_mapping_name": "portMappingName",
|
|
32501
32553
|
"discovery_name": "discoveryName",
|
|
32502
32554
|
"dns_name": "dnsName",
|
|
32555
|
+
"idle_timeout": "idleTimeout",
|
|
32503
32556
|
"ingress_port_override": "ingressPortOverride",
|
|
32557
|
+
"per_request_timeout": "perRequestTimeout",
|
|
32504
32558
|
"port": "port",
|
|
32505
32559
|
},
|
|
32506
32560
|
)
|
|
@@ -32511,7 +32565,9 @@ class ServiceConnectService:
|
|
|
32511
32565
|
port_mapping_name: builtins.str,
|
|
32512
32566
|
discovery_name: typing.Optional[builtins.str] = None,
|
|
32513
32567
|
dns_name: typing.Optional[builtins.str] = None,
|
|
32568
|
+
idle_timeout: typing.Optional[_Duration_4839e8c3] = None,
|
|
32514
32569
|
ingress_port_override: typing.Optional[jsii.Number] = None,
|
|
32570
|
+
per_request_timeout: typing.Optional[_Duration_4839e8c3] = None,
|
|
32515
32571
|
port: typing.Optional[jsii.Number] = None,
|
|
32516
32572
|
) -> None:
|
|
32517
32573
|
'''Interface for service connect Service props.
|
|
@@ -32519,7 +32575,9 @@ class ServiceConnectService:
|
|
|
32519
32575
|
:param port_mapping_name: portMappingName specifies which port and protocol combination should be used for this service connect service.
|
|
32520
32576
|
:param discovery_name: Optionally specifies an intermediate dns name to register in the CloudMap namespace. This is required if you wish to use the same port mapping name in more than one service. Default: - port mapping name
|
|
32521
32577
|
:param dns_name: The terse DNS alias to use for this port mapping in the service connect mesh. Service Connect-enabled clients will be able to reach this service at http://dnsName:port. Default: - No alias is created. The service is reachable at ``portMappingName.namespace:port``.
|
|
32578
|
+
:param idle_timeout: The amount of time in seconds a connection for Service Connect will stay active while idle. A value of 0 can be set to disable ``idleTimeout``. If ``idleTimeout`` is set to a time that is less than ``perRequestTimeout``, the connection will close when the ``idleTimeout`` is reached and not the ``perRequestTimeout``. Default: - Duration.minutes(5) for HTTP/HTTP2/GRPC, Duration.hours(1) for TCP.
|
|
32522
32579
|
:param ingress_port_override: Optional. The port on the Service Connect agent container to use for traffic ingress to this service. Default: - none
|
|
32580
|
+
:param per_request_timeout: The amount of time waiting for the upstream to respond with a complete response per request for Service Connect. A value of 0 can be set to disable ``perRequestTimeout``. Can only be set when the ``appProtocol`` for the application container is HTTP/HTTP2/GRPC. If ``idleTimeout`` is set to a time that is less than ``perRequestTimeout``, the connection will close when the ``idleTimeout`` is reached and not the ``perRequestTimeout``. Default: - Duration.seconds(15)
|
|
32523
32581
|
:param port: The port for clients to use to communicate with this service via Service Connect. Default: the container port specified by the port mapping in portMappingName.
|
|
32524
32582
|
|
|
32525
32583
|
:exampleMetadata: fixture=_generated
|
|
@@ -32528,6 +32586,7 @@ class ServiceConnectService:
|
|
|
32528
32586
|
|
|
32529
32587
|
# The code below shows an example of how to instantiate this type.
|
|
32530
32588
|
# The values are placeholders you should change.
|
|
32589
|
+
import aws_cdk as cdk
|
|
32531
32590
|
from aws_cdk import aws_ecs as ecs
|
|
32532
32591
|
|
|
32533
32592
|
service_connect_service = ecs.ServiceConnectService(
|
|
@@ -32536,7 +32595,9 @@ class ServiceConnectService:
|
|
|
32536
32595
|
# the properties below are optional
|
|
32537
32596
|
discovery_name="discoveryName",
|
|
32538
32597
|
dns_name="dnsName",
|
|
32598
|
+
idle_timeout=cdk.Duration.minutes(30),
|
|
32539
32599
|
ingress_port_override=123,
|
|
32600
|
+
per_request_timeout=cdk.Duration.minutes(30),
|
|
32540
32601
|
port=123
|
|
32541
32602
|
)
|
|
32542
32603
|
'''
|
|
@@ -32545,7 +32606,9 @@ class ServiceConnectService:
|
|
|
32545
32606
|
check_type(argname="argument port_mapping_name", value=port_mapping_name, expected_type=type_hints["port_mapping_name"])
|
|
32546
32607
|
check_type(argname="argument discovery_name", value=discovery_name, expected_type=type_hints["discovery_name"])
|
|
32547
32608
|
check_type(argname="argument dns_name", value=dns_name, expected_type=type_hints["dns_name"])
|
|
32609
|
+
check_type(argname="argument idle_timeout", value=idle_timeout, expected_type=type_hints["idle_timeout"])
|
|
32548
32610
|
check_type(argname="argument ingress_port_override", value=ingress_port_override, expected_type=type_hints["ingress_port_override"])
|
|
32611
|
+
check_type(argname="argument per_request_timeout", value=per_request_timeout, expected_type=type_hints["per_request_timeout"])
|
|
32549
32612
|
check_type(argname="argument port", value=port, expected_type=type_hints["port"])
|
|
32550
32613
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
32551
32614
|
"port_mapping_name": port_mapping_name,
|
|
@@ -32554,8 +32617,12 @@ class ServiceConnectService:
|
|
|
32554
32617
|
self._values["discovery_name"] = discovery_name
|
|
32555
32618
|
if dns_name is not None:
|
|
32556
32619
|
self._values["dns_name"] = dns_name
|
|
32620
|
+
if idle_timeout is not None:
|
|
32621
|
+
self._values["idle_timeout"] = idle_timeout
|
|
32557
32622
|
if ingress_port_override is not None:
|
|
32558
32623
|
self._values["ingress_port_override"] = ingress_port_override
|
|
32624
|
+
if per_request_timeout is not None:
|
|
32625
|
+
self._values["per_request_timeout"] = per_request_timeout
|
|
32559
32626
|
if port is not None:
|
|
32560
32627
|
self._values["port"] = port
|
|
32561
32628
|
|
|
@@ -32589,6 +32656,20 @@ class ServiceConnectService:
|
|
|
32589
32656
|
result = self._values.get("dns_name")
|
|
32590
32657
|
return typing.cast(typing.Optional[builtins.str], result)
|
|
32591
32658
|
|
|
32659
|
+
@builtins.property
|
|
32660
|
+
def idle_timeout(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
32661
|
+
'''The amount of time in seconds a connection for Service Connect will stay active while idle.
|
|
32662
|
+
|
|
32663
|
+
A value of 0 can be set to disable ``idleTimeout``.
|
|
32664
|
+
|
|
32665
|
+
If ``idleTimeout`` is set to a time that is less than ``perRequestTimeout``, the connection will close
|
|
32666
|
+
when the ``idleTimeout`` is reached and not the ``perRequestTimeout``.
|
|
32667
|
+
|
|
32668
|
+
:default: - Duration.minutes(5) for HTTP/HTTP2/GRPC, Duration.hours(1) for TCP.
|
|
32669
|
+
'''
|
|
32670
|
+
result = self._values.get("idle_timeout")
|
|
32671
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
32672
|
+
|
|
32592
32673
|
@builtins.property
|
|
32593
32674
|
def ingress_port_override(self) -> typing.Optional[jsii.Number]:
|
|
32594
32675
|
'''Optional.
|
|
@@ -32600,6 +32681,21 @@ class ServiceConnectService:
|
|
|
32600
32681
|
result = self._values.get("ingress_port_override")
|
|
32601
32682
|
return typing.cast(typing.Optional[jsii.Number], result)
|
|
32602
32683
|
|
|
32684
|
+
@builtins.property
|
|
32685
|
+
def per_request_timeout(self) -> typing.Optional[_Duration_4839e8c3]:
|
|
32686
|
+
'''The amount of time waiting for the upstream to respond with a complete response per request for Service Connect.
|
|
32687
|
+
|
|
32688
|
+
A value of 0 can be set to disable ``perRequestTimeout``.
|
|
32689
|
+
Can only be set when the ``appProtocol`` for the application container is HTTP/HTTP2/GRPC.
|
|
32690
|
+
|
|
32691
|
+
If ``idleTimeout`` is set to a time that is less than ``perRequestTimeout``, the connection will close
|
|
32692
|
+
when the ``idleTimeout`` is reached and not the ``perRequestTimeout``.
|
|
32693
|
+
|
|
32694
|
+
:default: - Duration.seconds(15)
|
|
32695
|
+
'''
|
|
32696
|
+
result = self._values.get("per_request_timeout")
|
|
32697
|
+
return typing.cast(typing.Optional[_Duration_4839e8c3], result)
|
|
32698
|
+
|
|
32603
32699
|
@builtins.property
|
|
32604
32700
|
def port(self) -> typing.Optional[jsii.Number]:
|
|
32605
32701
|
'''The port for clients to use to communicate with this service via Service Connect.
|
|
@@ -38464,7 +38560,7 @@ class Ec2Service(
|
|
|
38464
38560
|
:param id: -
|
|
38465
38561
|
:param task_definition: The task definition to use for tasks in the service. [disable-awslint:ref-via-interface]
|
|
38466
38562
|
:param assign_public_ip: Specifies whether the task's elastic network interface receives a public IP address. If true, each task will receive a public IP address. This property is only used for tasks that use the awsvpc network mode. Default: false
|
|
38467
|
-
:param daemon: Specifies whether the service will use the 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
|
|
38563
|
+
:param daemon: Specifies whether the service will use the 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. Default: false
|
|
38468
38564
|
:param placement_constraints: The placement constraints to use for tasks in the service. For more information, see `Amazon ECS Task Placement Constraints <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html>`_. Default: - No constraints.
|
|
38469
38565
|
:param placement_strategies: The placement strategies to use for tasks in the service. For more information, see `Amazon ECS Task Placement Strategies <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html>`_. Default: - No strategies.
|
|
38470
38566
|
: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.
|
|
@@ -39300,33 +39396,27 @@ class FargateService(
|
|
|
39300
39396
|
|
|
39301
39397
|
# cluster: ecs.Cluster
|
|
39302
39398
|
# task_definition: ecs.TaskDefinition
|
|
39399
|
+
# elb_alarm: cw.Alarm
|
|
39400
|
+
|
|
39303
39401
|
|
|
39304
|
-
service_name = "MyFargateService"
|
|
39305
39402
|
service = ecs.FargateService(self, "Service",
|
|
39306
|
-
service_name=service_name,
|
|
39307
39403
|
cluster=cluster,
|
|
39308
|
-
task_definition=task_definition
|
|
39404
|
+
task_definition=task_definition,
|
|
39405
|
+
deployment_alarms=ecs.DeploymentAlarmConfig(
|
|
39406
|
+
alarm_names=[elb_alarm.alarm_name],
|
|
39407
|
+
behavior=ecs.AlarmBehavior.ROLLBACK_ON_ALARM
|
|
39408
|
+
)
|
|
39309
39409
|
)
|
|
39310
39410
|
|
|
39311
|
-
|
|
39312
|
-
|
|
39313
|
-
|
|
39314
|
-
|
|
39315
|
-
|
|
39316
|
-
dimensions_map={
|
|
39317
|
-
"ClusterName": cluster.cluster_name,
|
|
39318
|
-
# Using `service.serviceName` here will cause a circular dependency
|
|
39319
|
-
"ServiceName": service_name
|
|
39320
|
-
}
|
|
39321
|
-
)
|
|
39322
|
-
my_alarm = cw.Alarm(self, "CPUAlarm",
|
|
39323
|
-
alarm_name="cpuAlarmName",
|
|
39324
|
-
metric=cpu_metric,
|
|
39411
|
+
# Defining a deployment alarm after the service has been created
|
|
39412
|
+
cpu_alarm_name = "MyCpuMetricAlarm"
|
|
39413
|
+
cw.Alarm(self, "CPUAlarm",
|
|
39414
|
+
alarm_name=cpu_alarm_name,
|
|
39415
|
+
metric=service.metric_cpu_utilization(),
|
|
39325
39416
|
evaluation_periods=2,
|
|
39326
39417
|
threshold=80
|
|
39327
39418
|
)
|
|
39328
|
-
|
|
39329
|
-
service.enable_deployment_alarms([my_alarm.alarm_name],
|
|
39419
|
+
service.enable_deployment_alarms([cpu_alarm_name],
|
|
39330
39420
|
behavior=ecs.AlarmBehavior.FAIL_ON_ALARM
|
|
39331
39421
|
)
|
|
39332
39422
|
'''
|
|
@@ -40983,6 +41073,7 @@ def _typecheckingstub__d367f5be98d90056ca7f199c577c5744b20417ce5d1c8ad339824ec9d
|
|
|
40983
41073
|
name: builtins.str,
|
|
40984
41074
|
command: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
40985
41075
|
cpu: typing.Optional[jsii.Number] = None,
|
|
41076
|
+
credential_specs: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
40986
41077
|
depends_on: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Sequence[typing.Union[_IResolvable_da3f097b, typing.Union[CfnTaskDefinition.ContainerDependencyProperty, typing.Dict[builtins.str, typing.Any]]]]]] = None,
|
|
40987
41078
|
disable_networking: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
|
|
40988
41079
|
dns_search_domains: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
@@ -42859,7 +42950,9 @@ def _typecheckingstub__5fc70dc513eac25b19e79ac6e7ba5dc61662a4299bbba170094fabb95
|
|
|
42859
42950
|
port_mapping_name: builtins.str,
|
|
42860
42951
|
discovery_name: typing.Optional[builtins.str] = None,
|
|
42861
42952
|
dns_name: typing.Optional[builtins.str] = None,
|
|
42953
|
+
idle_timeout: typing.Optional[_Duration_4839e8c3] = None,
|
|
42862
42954
|
ingress_port_override: typing.Optional[jsii.Number] = None,
|
|
42955
|
+
per_request_timeout: typing.Optional[_Duration_4839e8c3] = None,
|
|
42863
42956
|
port: typing.Optional[jsii.Number] = None,
|
|
42864
42957
|
) -> None:
|
|
42865
42958
|
"""Type checking stubs"""
|