aws-cdk-lib 2.178.1__py3-none-any.whl → 2.179.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 +69 -35
- aws_cdk/_jsii/__init__.py +1 -2
- aws_cdk/_jsii/{aws-cdk-lib@2.178.1.jsii.tgz → aws-cdk-lib@2.179.0.jsii.tgz} +0 -0
- aws_cdk/aws_apigateway/__init__.py +170 -29
- aws_cdk/aws_apigatewayv2/__init__.py +151 -32
- aws_cdk/aws_apigatewayv2_integrations/__init__.py +348 -0
- aws_cdk/aws_applicationautoscaling/__init__.py +8 -8
- aws_cdk/aws_appsync/__init__.py +6 -4
- aws_cdk/aws_cloudfront/__init__.py +5 -5
- aws_cdk/aws_codebuild/__init__.py +216 -0
- aws_cdk/aws_codepipeline/__init__.py +89 -28
- aws_cdk/aws_codepipeline_actions/__init__.py +526 -62
- aws_cdk/aws_cognito/__init__.py +676 -20
- aws_cdk/aws_ec2/__init__.py +25 -9
- aws_cdk/aws_ecs/__init__.py +8 -8
- aws_cdk/aws_eks/__init__.py +555 -179
- aws_cdk/aws_elasticloadbalancingv2/__init__.py +99 -0
- aws_cdk/aws_events/__init__.py +9 -15
- aws_cdk/aws_events_targets/__init__.py +303 -16
- aws_cdk/aws_iam/__init__.py +3 -3
- aws_cdk/aws_ivs/__init__.py +241 -73
- aws_cdk/aws_logs/__init__.py +62 -13
- aws_cdk/aws_pinpoint/__init__.py +14 -9
- aws_cdk/aws_rds/__init__.py +168 -24
- aws_cdk/aws_s3/__init__.py +9 -9
- aws_cdk/aws_stepfunctions_tasks/__init__.py +127 -21
- aws_cdk/pipelines/__init__.py +2 -2
- {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/METADATA +1 -2
- {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/RECORD +33 -34
- aws_cdk/lambda_layer_kubectl/__init__.py +0 -107
- {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/LICENSE +0 -0
- {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/NOTICE +0 -0
- {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/WHEEL +0 -0
- {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/top_level.txt +0 -0
|
@@ -558,6 +558,34 @@ rule.add_target(targets.EcsTask(
|
|
|
558
558
|
))
|
|
559
559
|
```
|
|
560
560
|
|
|
561
|
+
### Overriding Values in the Task Definition
|
|
562
|
+
|
|
563
|
+
You can override values in the task definition by setting the corresponding properties in the `EcsTaskProps`. All
|
|
564
|
+
values in the [`TaskOverrides` API](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskOverride.html) are
|
|
565
|
+
supported.
|
|
566
|
+
|
|
567
|
+
```python
|
|
568
|
+
import aws_cdk.aws_ecs as ecs
|
|
569
|
+
|
|
570
|
+
# cluster: ecs.ICluster
|
|
571
|
+
# task_definition: ecs.TaskDefinition
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
rule = events.Rule(self, "Rule",
|
|
575
|
+
schedule=events.Schedule.rate(cdk.Duration.hours(1))
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
rule.add_target(targets.EcsTask(
|
|
579
|
+
cluster=cluster,
|
|
580
|
+
task_definition=task_definition,
|
|
581
|
+
task_count=1,
|
|
582
|
+
|
|
583
|
+
# Overrides the cpu and memory values in the task definition
|
|
584
|
+
cpu="512",
|
|
585
|
+
memory="512"
|
|
586
|
+
))
|
|
587
|
+
```
|
|
588
|
+
|
|
561
589
|
## Schedule a Redshift query (serverless or cluster)
|
|
562
590
|
|
|
563
591
|
Use the `RedshiftQuery` target to schedule an Amazon Redshift Query.
|
|
@@ -1826,7 +1854,6 @@ class EcsTask(
|
|
|
1826
1854
|
Example::
|
|
1827
1855
|
|
|
1828
1856
|
import aws_cdk.aws_ecs as ecs
|
|
1829
|
-
import aws_cdk.aws_ec2 as ec2
|
|
1830
1857
|
|
|
1831
1858
|
# cluster: ecs.ICluster
|
|
1832
1859
|
# task_definition: ecs.TaskDefinition
|
|
@@ -1836,13 +1863,15 @@ class EcsTask(
|
|
|
1836
1863
|
schedule=events.Schedule.rate(cdk.Duration.hours(1))
|
|
1837
1864
|
)
|
|
1838
1865
|
|
|
1839
|
-
rule.add_target(
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1866
|
+
rule.add_target(targets.EcsTask(
|
|
1867
|
+
cluster=cluster,
|
|
1868
|
+
task_definition=task_definition,
|
|
1869
|
+
task_count=1,
|
|
1870
|
+
|
|
1871
|
+
# Overrides the cpu and memory values in the task definition
|
|
1872
|
+
cpu="512",
|
|
1873
|
+
memory="512"
|
|
1874
|
+
))
|
|
1846
1875
|
'''
|
|
1847
1876
|
|
|
1848
1877
|
def __init__(
|
|
@@ -1852,8 +1881,13 @@ class EcsTask(
|
|
|
1852
1881
|
task_definition: _ITaskDefinition_889ba4d8,
|
|
1853
1882
|
assign_public_ip: typing.Optional[builtins.bool] = None,
|
|
1854
1883
|
container_overrides: typing.Optional[typing.Sequence[typing.Union[ContainerOverride, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1884
|
+
cpu: typing.Optional[builtins.str] = None,
|
|
1855
1885
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
1886
|
+
ephemeral_storage: typing.Optional[typing.Union["EphemeralStorageOverride", typing.Dict[builtins.str, typing.Any]]] = None,
|
|
1887
|
+
execution_role: typing.Optional[_IRole_235f5d8e] = None,
|
|
1888
|
+
inference_accelerator_overrides: typing.Optional[typing.Sequence[typing.Union["InferenceAcceleratorOverride", typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1856
1889
|
launch_type: typing.Optional[_LaunchType_6894135d] = None,
|
|
1890
|
+
memory: typing.Optional[builtins.str] = None,
|
|
1857
1891
|
platform_version: typing.Optional[_FargatePlatformVersion_55d8be5c] = None,
|
|
1858
1892
|
propagate_tags: typing.Optional[_PropagatedTagSource_ad4e874a] = None,
|
|
1859
1893
|
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
@@ -1861,6 +1895,7 @@ class EcsTask(
|
|
|
1861
1895
|
subnet_selection: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
1862
1896
|
tags: typing.Optional[typing.Sequence[typing.Union["Tag", typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
1863
1897
|
task_count: typing.Optional[jsii.Number] = None,
|
|
1898
|
+
task_role: typing.Optional[_IRole_235f5d8e] = None,
|
|
1864
1899
|
dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
|
|
1865
1900
|
max_event_age: typing.Optional[_Duration_4839e8c3] = None,
|
|
1866
1901
|
retry_attempts: typing.Optional[jsii.Number] = None,
|
|
@@ -1870,8 +1905,13 @@ class EcsTask(
|
|
|
1870
1905
|
:param task_definition: Task Definition of the task that should be started.
|
|
1871
1906
|
:param assign_public_ip: Specifies whether the task's elastic network interface receives a public IP address. You can specify true only when LaunchType is set to FARGATE. Default: - true if the subnet type is PUBLIC, otherwise false
|
|
1872
1907
|
:param container_overrides: Container setting overrides. Key is the name of the container to override, value is the values you want to override.
|
|
1908
|
+
:param cpu: The CPU override for the task. Default: - The task definition's CPU value
|
|
1873
1909
|
:param enable_execute_command: Whether or not to enable the execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task. Default: - false
|
|
1910
|
+
:param ephemeral_storage: The ephemeral storage setting override for the task. NOTE: This parameter is only supported for tasks hosted on Fargate that use the following platform versions: - Linux platform version 1.4.0 or later. - Windows platform version 1.0.0 or later. Default: - The task definition's ephemeral storage value
|
|
1911
|
+
:param execution_role: The execution role for the task. The Amazon Resource Name (ARN) of the task execution role override for the task. Default: - The task definition's execution role
|
|
1912
|
+
:param inference_accelerator_overrides: The Elastic Inference accelerator override for the task. Default: - The task definition's inference accelerator overrides
|
|
1874
1913
|
:param launch_type: Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. Default: - 'EC2' if ``isEc2Compatible`` for the ``taskDefinition`` is true, otherwise 'FARGATE'
|
|
1914
|
+
:param memory: The memory override for the task. Default: - The task definition's memory value
|
|
1875
1915
|
:param platform_version: The platform version on which to run your task. Unless you have specific compatibility requirements, you don't need to specify this. Default: - ECS will set the Fargate platform version to 'LATEST'
|
|
1876
1916
|
:param propagate_tags: Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Default: - Tags will not be propagated
|
|
1877
1917
|
:param role: Existing IAM role to run the ECS task. Default: A new IAM role is created
|
|
@@ -1879,6 +1919,7 @@ class EcsTask(
|
|
|
1879
1919
|
:param subnet_selection: In what subnets to place the task's ENIs. (Only applicable in case the TaskDefinition is configured for AwsVpc networking) Default: Private subnets
|
|
1880
1920
|
:param tags: The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Default: - No additional tags are applied to the task
|
|
1881
1921
|
:param task_count: How many tasks should be started when this event is triggered. Default: 1
|
|
1922
|
+
:param task_role: The IAM role for the task. Default: - The task definition's task role
|
|
1882
1923
|
:param dead_letter_queue: The SQS queue to be used as deadLetterQueue. Check out the `considerations for using a dead-letter queue <https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html#dlq-considerations>`_. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
|
|
1883
1924
|
:param max_event_age: The maximum age of a request that Lambda sends to a function for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
|
|
1884
1925
|
:param retry_attempts: The maximum number of times to retry when the function returns an error. Minimum value of 0. Maximum value of 185. Default: 185
|
|
@@ -1888,8 +1929,13 @@ class EcsTask(
|
|
|
1888
1929
|
task_definition=task_definition,
|
|
1889
1930
|
assign_public_ip=assign_public_ip,
|
|
1890
1931
|
container_overrides=container_overrides,
|
|
1932
|
+
cpu=cpu,
|
|
1891
1933
|
enable_execute_command=enable_execute_command,
|
|
1934
|
+
ephemeral_storage=ephemeral_storage,
|
|
1935
|
+
execution_role=execution_role,
|
|
1936
|
+
inference_accelerator_overrides=inference_accelerator_overrides,
|
|
1892
1937
|
launch_type=launch_type,
|
|
1938
|
+
memory=memory,
|
|
1893
1939
|
platform_version=platform_version,
|
|
1894
1940
|
propagate_tags=propagate_tags,
|
|
1895
1941
|
role=role,
|
|
@@ -1897,6 +1943,7 @@ class EcsTask(
|
|
|
1897
1943
|
subnet_selection=subnet_selection,
|
|
1898
1944
|
tags=tags,
|
|
1899
1945
|
task_count=task_count,
|
|
1946
|
+
task_role=task_role,
|
|
1900
1947
|
dead_letter_queue=dead_letter_queue,
|
|
1901
1948
|
max_event_age=max_event_age,
|
|
1902
1949
|
retry_attempts=retry_attempts,
|
|
@@ -1933,6 +1980,58 @@ class EcsTask(
|
|
|
1933
1980
|
return typing.cast(typing.Optional[typing.List[_ISecurityGroup_acf8a799]], jsii.get(self, "securityGroups"))
|
|
1934
1981
|
|
|
1935
1982
|
|
|
1983
|
+
@jsii.data_type(
|
|
1984
|
+
jsii_type="aws-cdk-lib.aws_events_targets.EphemeralStorageOverride",
|
|
1985
|
+
jsii_struct_bases=[],
|
|
1986
|
+
name_mapping={"size_in_gib": "sizeInGiB"},
|
|
1987
|
+
)
|
|
1988
|
+
class EphemeralStorageOverride:
|
|
1989
|
+
def __init__(self, *, size_in_gib: jsii.Number) -> None:
|
|
1990
|
+
'''Override ephemeral storage for the task.
|
|
1991
|
+
|
|
1992
|
+
:param size_in_gib: The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is 20 GiB and the maximum supported value is 200 GiB.
|
|
1993
|
+
|
|
1994
|
+
:exampleMetadata: fixture=_generated
|
|
1995
|
+
|
|
1996
|
+
Example::
|
|
1997
|
+
|
|
1998
|
+
# The code below shows an example of how to instantiate this type.
|
|
1999
|
+
# The values are placeholders you should change.
|
|
2000
|
+
from aws_cdk import aws_events_targets as events_targets
|
|
2001
|
+
|
|
2002
|
+
ephemeral_storage_override = events_targets.EphemeralStorageOverride(
|
|
2003
|
+
size_in_gi_b=123
|
|
2004
|
+
)
|
|
2005
|
+
'''
|
|
2006
|
+
if __debug__:
|
|
2007
|
+
type_hints = typing.get_type_hints(_typecheckingstub__5eb4fe2cce860dd139eb826c1adfe14b0a1394ea467d09e880ac9c27d43ec835)
|
|
2008
|
+
check_type(argname="argument size_in_gib", value=size_in_gib, expected_type=type_hints["size_in_gib"])
|
|
2009
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
2010
|
+
"size_in_gib": size_in_gib,
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
@builtins.property
|
|
2014
|
+
def size_in_gib(self) -> jsii.Number:
|
|
2015
|
+
'''The total amount, in GiB, of ephemeral storage to set for the task.
|
|
2016
|
+
|
|
2017
|
+
The minimum supported value is 20 GiB and the maximum supported value is 200 GiB.
|
|
2018
|
+
'''
|
|
2019
|
+
result = self._values.get("size_in_gib")
|
|
2020
|
+
assert result is not None, "Required property 'size_in_gib' is missing"
|
|
2021
|
+
return typing.cast(jsii.Number, result)
|
|
2022
|
+
|
|
2023
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
2024
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
2025
|
+
|
|
2026
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
2027
|
+
return not (rhs == self)
|
|
2028
|
+
|
|
2029
|
+
def __repr__(self) -> str:
|
|
2030
|
+
return "EphemeralStorageOverride(%s)" % ", ".join(
|
|
2031
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
2032
|
+
)
|
|
2033
|
+
|
|
2034
|
+
|
|
1936
2035
|
@jsii.implements(_IRuleTarget_7a91f454)
|
|
1937
2036
|
class EventBus(
|
|
1938
2037
|
metaclass=jsii.JSIIMeta,
|
|
@@ -2124,6 +2223,69 @@ class _IDeliveryStreamProxy(
|
|
|
2124
2223
|
typing.cast(typing.Any, IDeliveryStream).__jsii_proxy_class__ = lambda : _IDeliveryStreamProxy
|
|
2125
2224
|
|
|
2126
2225
|
|
|
2226
|
+
@jsii.data_type(
|
|
2227
|
+
jsii_type="aws-cdk-lib.aws_events_targets.InferenceAcceleratorOverride",
|
|
2228
|
+
jsii_struct_bases=[],
|
|
2229
|
+
name_mapping={"device_name": "deviceName", "device_type": "deviceType"},
|
|
2230
|
+
)
|
|
2231
|
+
class InferenceAcceleratorOverride:
|
|
2232
|
+
def __init__(self, *, device_name: builtins.str, device_type: builtins.str) -> None:
|
|
2233
|
+
'''Override inference accelerators for the task.
|
|
2234
|
+
|
|
2235
|
+
:param device_name: The Elastic Inference accelerator device name to override for the task. This parameter must match a ``deviceName`` specified in the task definition.
|
|
2236
|
+
:param device_type: The Elastic Inference accelerator type to use.
|
|
2237
|
+
|
|
2238
|
+
:exampleMetadata: fixture=_generated
|
|
2239
|
+
|
|
2240
|
+
Example::
|
|
2241
|
+
|
|
2242
|
+
# The code below shows an example of how to instantiate this type.
|
|
2243
|
+
# The values are placeholders you should change.
|
|
2244
|
+
from aws_cdk import aws_events_targets as events_targets
|
|
2245
|
+
|
|
2246
|
+
inference_accelerator_override = events_targets.InferenceAcceleratorOverride(
|
|
2247
|
+
device_name="deviceName",
|
|
2248
|
+
device_type="deviceType"
|
|
2249
|
+
)
|
|
2250
|
+
'''
|
|
2251
|
+
if __debug__:
|
|
2252
|
+
type_hints = typing.get_type_hints(_typecheckingstub__04d9348fef54fca78833e3224fa6f62badc3a0e6c0bfa6af7838fe531de0ebf6)
|
|
2253
|
+
check_type(argname="argument device_name", value=device_name, expected_type=type_hints["device_name"])
|
|
2254
|
+
check_type(argname="argument device_type", value=device_type, expected_type=type_hints["device_type"])
|
|
2255
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
2256
|
+
"device_name": device_name,
|
|
2257
|
+
"device_type": device_type,
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
@builtins.property
|
|
2261
|
+
def device_name(self) -> builtins.str:
|
|
2262
|
+
'''The Elastic Inference accelerator device name to override for the task.
|
|
2263
|
+
|
|
2264
|
+
This parameter must match a ``deviceName`` specified in the task definition.
|
|
2265
|
+
'''
|
|
2266
|
+
result = self._values.get("device_name")
|
|
2267
|
+
assert result is not None, "Required property 'device_name' is missing"
|
|
2268
|
+
return typing.cast(builtins.str, result)
|
|
2269
|
+
|
|
2270
|
+
@builtins.property
|
|
2271
|
+
def device_type(self) -> builtins.str:
|
|
2272
|
+
'''The Elastic Inference accelerator type to use.'''
|
|
2273
|
+
result = self._values.get("device_type")
|
|
2274
|
+
assert result is not None, "Required property 'device_type' is missing"
|
|
2275
|
+
return typing.cast(builtins.str, result)
|
|
2276
|
+
|
|
2277
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
2278
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
2279
|
+
|
|
2280
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
2281
|
+
return not (rhs == self)
|
|
2282
|
+
|
|
2283
|
+
def __repr__(self) -> str:
|
|
2284
|
+
return "InferenceAcceleratorOverride(%s)" % ", ".join(
|
|
2285
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
2286
|
+
)
|
|
2287
|
+
|
|
2288
|
+
|
|
2127
2289
|
@jsii.implements(_IRuleTarget_7a91f454)
|
|
2128
2290
|
class KinesisFirehoseStream(
|
|
2129
2291
|
metaclass=jsii.JSIIMeta,
|
|
@@ -4443,8 +4605,13 @@ class CodePipelineTargetOptions(TargetBaseProps):
|
|
|
4443
4605
|
"task_definition": "taskDefinition",
|
|
4444
4606
|
"assign_public_ip": "assignPublicIp",
|
|
4445
4607
|
"container_overrides": "containerOverrides",
|
|
4608
|
+
"cpu": "cpu",
|
|
4446
4609
|
"enable_execute_command": "enableExecuteCommand",
|
|
4610
|
+
"ephemeral_storage": "ephemeralStorage",
|
|
4611
|
+
"execution_role": "executionRole",
|
|
4612
|
+
"inference_accelerator_overrides": "inferenceAcceleratorOverrides",
|
|
4447
4613
|
"launch_type": "launchType",
|
|
4614
|
+
"memory": "memory",
|
|
4448
4615
|
"platform_version": "platformVersion",
|
|
4449
4616
|
"propagate_tags": "propagateTags",
|
|
4450
4617
|
"role": "role",
|
|
@@ -4452,6 +4619,7 @@ class CodePipelineTargetOptions(TargetBaseProps):
|
|
|
4452
4619
|
"subnet_selection": "subnetSelection",
|
|
4453
4620
|
"tags": "tags",
|
|
4454
4621
|
"task_count": "taskCount",
|
|
4622
|
+
"task_role": "taskRole",
|
|
4455
4623
|
},
|
|
4456
4624
|
)
|
|
4457
4625
|
class EcsTaskProps(TargetBaseProps):
|
|
@@ -4465,8 +4633,13 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4465
4633
|
task_definition: _ITaskDefinition_889ba4d8,
|
|
4466
4634
|
assign_public_ip: typing.Optional[builtins.bool] = None,
|
|
4467
4635
|
container_overrides: typing.Optional[typing.Sequence[typing.Union[ContainerOverride, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4636
|
+
cpu: typing.Optional[builtins.str] = None,
|
|
4468
4637
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
4638
|
+
ephemeral_storage: typing.Optional[typing.Union[EphemeralStorageOverride, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
4639
|
+
execution_role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4640
|
+
inference_accelerator_overrides: typing.Optional[typing.Sequence[typing.Union[InferenceAcceleratorOverride, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4469
4641
|
launch_type: typing.Optional[_LaunchType_6894135d] = None,
|
|
4642
|
+
memory: typing.Optional[builtins.str] = None,
|
|
4470
4643
|
platform_version: typing.Optional[_FargatePlatformVersion_55d8be5c] = None,
|
|
4471
4644
|
propagate_tags: typing.Optional[_PropagatedTagSource_ad4e874a] = None,
|
|
4472
4645
|
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
@@ -4474,6 +4647,7 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4474
4647
|
subnet_selection: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
4475
4648
|
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
4476
4649
|
task_count: typing.Optional[jsii.Number] = None,
|
|
4650
|
+
task_role: typing.Optional[_IRole_235f5d8e] = None,
|
|
4477
4651
|
) -> None:
|
|
4478
4652
|
'''Properties to define an ECS Event Task.
|
|
4479
4653
|
|
|
@@ -4484,8 +4658,13 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4484
4658
|
:param task_definition: Task Definition of the task that should be started.
|
|
4485
4659
|
:param assign_public_ip: Specifies whether the task's elastic network interface receives a public IP address. You can specify true only when LaunchType is set to FARGATE. Default: - true if the subnet type is PUBLIC, otherwise false
|
|
4486
4660
|
:param container_overrides: Container setting overrides. Key is the name of the container to override, value is the values you want to override.
|
|
4661
|
+
:param cpu: The CPU override for the task. Default: - The task definition's CPU value
|
|
4487
4662
|
:param enable_execute_command: Whether or not to enable the execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task. Default: - false
|
|
4663
|
+
:param ephemeral_storage: The ephemeral storage setting override for the task. NOTE: This parameter is only supported for tasks hosted on Fargate that use the following platform versions: - Linux platform version 1.4.0 or later. - Windows platform version 1.0.0 or later. Default: - The task definition's ephemeral storage value
|
|
4664
|
+
:param execution_role: The execution role for the task. The Amazon Resource Name (ARN) of the task execution role override for the task. Default: - The task definition's execution role
|
|
4665
|
+
:param inference_accelerator_overrides: The Elastic Inference accelerator override for the task. Default: - The task definition's inference accelerator overrides
|
|
4488
4666
|
:param launch_type: Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. Default: - 'EC2' if ``isEc2Compatible`` for the ``taskDefinition`` is true, otherwise 'FARGATE'
|
|
4667
|
+
:param memory: The memory override for the task. Default: - The task definition's memory value
|
|
4489
4668
|
:param platform_version: The platform version on which to run your task. Unless you have specific compatibility requirements, you don't need to specify this. Default: - ECS will set the Fargate platform version to 'LATEST'
|
|
4490
4669
|
:param propagate_tags: Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Default: - Tags will not be propagated
|
|
4491
4670
|
:param role: Existing IAM role to run the ECS task. Default: A new IAM role is created
|
|
@@ -4493,13 +4672,13 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4493
4672
|
:param subnet_selection: In what subnets to place the task's ENIs. (Only applicable in case the TaskDefinition is configured for AwsVpc networking) Default: Private subnets
|
|
4494
4673
|
:param tags: The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Default: - No additional tags are applied to the task
|
|
4495
4674
|
:param task_count: How many tasks should be started when this event is triggered. Default: 1
|
|
4675
|
+
:param task_role: The IAM role for the task. Default: - The task definition's task role
|
|
4496
4676
|
|
|
4497
4677
|
:exampleMetadata: infused
|
|
4498
4678
|
|
|
4499
4679
|
Example::
|
|
4500
4680
|
|
|
4501
4681
|
import aws_cdk.aws_ecs as ecs
|
|
4502
|
-
import aws_cdk.aws_ec2 as ec2
|
|
4503
4682
|
|
|
4504
4683
|
# cluster: ecs.ICluster
|
|
4505
4684
|
# task_definition: ecs.TaskDefinition
|
|
@@ -4509,14 +4688,18 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4509
4688
|
schedule=events.Schedule.rate(cdk.Duration.hours(1))
|
|
4510
4689
|
)
|
|
4511
4690
|
|
|
4512
|
-
rule.add_target(
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4691
|
+
rule.add_target(targets.EcsTask(
|
|
4692
|
+
cluster=cluster,
|
|
4693
|
+
task_definition=task_definition,
|
|
4694
|
+
task_count=1,
|
|
4695
|
+
|
|
4696
|
+
# Overrides the cpu and memory values in the task definition
|
|
4697
|
+
cpu="512",
|
|
4698
|
+
memory="512"
|
|
4699
|
+
))
|
|
4519
4700
|
'''
|
|
4701
|
+
if isinstance(ephemeral_storage, dict):
|
|
4702
|
+
ephemeral_storage = EphemeralStorageOverride(**ephemeral_storage)
|
|
4520
4703
|
if isinstance(subnet_selection, dict):
|
|
4521
4704
|
subnet_selection = _SubnetSelection_e57d76df(**subnet_selection)
|
|
4522
4705
|
if __debug__:
|
|
@@ -4528,8 +4711,13 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4528
4711
|
check_type(argname="argument task_definition", value=task_definition, expected_type=type_hints["task_definition"])
|
|
4529
4712
|
check_type(argname="argument assign_public_ip", value=assign_public_ip, expected_type=type_hints["assign_public_ip"])
|
|
4530
4713
|
check_type(argname="argument container_overrides", value=container_overrides, expected_type=type_hints["container_overrides"])
|
|
4714
|
+
check_type(argname="argument cpu", value=cpu, expected_type=type_hints["cpu"])
|
|
4531
4715
|
check_type(argname="argument enable_execute_command", value=enable_execute_command, expected_type=type_hints["enable_execute_command"])
|
|
4716
|
+
check_type(argname="argument ephemeral_storage", value=ephemeral_storage, expected_type=type_hints["ephemeral_storage"])
|
|
4717
|
+
check_type(argname="argument execution_role", value=execution_role, expected_type=type_hints["execution_role"])
|
|
4718
|
+
check_type(argname="argument inference_accelerator_overrides", value=inference_accelerator_overrides, expected_type=type_hints["inference_accelerator_overrides"])
|
|
4532
4719
|
check_type(argname="argument launch_type", value=launch_type, expected_type=type_hints["launch_type"])
|
|
4720
|
+
check_type(argname="argument memory", value=memory, expected_type=type_hints["memory"])
|
|
4533
4721
|
check_type(argname="argument platform_version", value=platform_version, expected_type=type_hints["platform_version"])
|
|
4534
4722
|
check_type(argname="argument propagate_tags", value=propagate_tags, expected_type=type_hints["propagate_tags"])
|
|
4535
4723
|
check_type(argname="argument role", value=role, expected_type=type_hints["role"])
|
|
@@ -4537,6 +4725,7 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4537
4725
|
check_type(argname="argument subnet_selection", value=subnet_selection, expected_type=type_hints["subnet_selection"])
|
|
4538
4726
|
check_type(argname="argument tags", value=tags, expected_type=type_hints["tags"])
|
|
4539
4727
|
check_type(argname="argument task_count", value=task_count, expected_type=type_hints["task_count"])
|
|
4728
|
+
check_type(argname="argument task_role", value=task_role, expected_type=type_hints["task_role"])
|
|
4540
4729
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
4541
4730
|
"cluster": cluster,
|
|
4542
4731
|
"task_definition": task_definition,
|
|
@@ -4551,10 +4740,20 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4551
4740
|
self._values["assign_public_ip"] = assign_public_ip
|
|
4552
4741
|
if container_overrides is not None:
|
|
4553
4742
|
self._values["container_overrides"] = container_overrides
|
|
4743
|
+
if cpu is not None:
|
|
4744
|
+
self._values["cpu"] = cpu
|
|
4554
4745
|
if enable_execute_command is not None:
|
|
4555
4746
|
self._values["enable_execute_command"] = enable_execute_command
|
|
4747
|
+
if ephemeral_storage is not None:
|
|
4748
|
+
self._values["ephemeral_storage"] = ephemeral_storage
|
|
4749
|
+
if execution_role is not None:
|
|
4750
|
+
self._values["execution_role"] = execution_role
|
|
4751
|
+
if inference_accelerator_overrides is not None:
|
|
4752
|
+
self._values["inference_accelerator_overrides"] = inference_accelerator_overrides
|
|
4556
4753
|
if launch_type is not None:
|
|
4557
4754
|
self._values["launch_type"] = launch_type
|
|
4755
|
+
if memory is not None:
|
|
4756
|
+
self._values["memory"] = memory
|
|
4558
4757
|
if platform_version is not None:
|
|
4559
4758
|
self._values["platform_version"] = platform_version
|
|
4560
4759
|
if propagate_tags is not None:
|
|
@@ -4569,6 +4768,8 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4569
4768
|
self._values["tags"] = tags
|
|
4570
4769
|
if task_count is not None:
|
|
4571
4770
|
self._values["task_count"] = task_count
|
|
4771
|
+
if task_role is not None:
|
|
4772
|
+
self._values["task_role"] = task_role
|
|
4572
4773
|
|
|
4573
4774
|
@builtins.property
|
|
4574
4775
|
def dead_letter_queue(self) -> typing.Optional[_IQueue_7ed6f679]:
|
|
@@ -4642,6 +4843,15 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4642
4843
|
result = self._values.get("container_overrides")
|
|
4643
4844
|
return typing.cast(typing.Optional[typing.List[ContainerOverride]], result)
|
|
4644
4845
|
|
|
4846
|
+
@builtins.property
|
|
4847
|
+
def cpu(self) -> typing.Optional[builtins.str]:
|
|
4848
|
+
'''The CPU override for the task.
|
|
4849
|
+
|
|
4850
|
+
:default: - The task definition's CPU value
|
|
4851
|
+
'''
|
|
4852
|
+
result = self._values.get("cpu")
|
|
4853
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
4854
|
+
|
|
4645
4855
|
@builtins.property
|
|
4646
4856
|
def enable_execute_command(self) -> typing.Optional[builtins.bool]:
|
|
4647
4857
|
'''Whether or not to enable the execute command functionality for the containers in this task.
|
|
@@ -4653,6 +4863,42 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4653
4863
|
result = self._values.get("enable_execute_command")
|
|
4654
4864
|
return typing.cast(typing.Optional[builtins.bool], result)
|
|
4655
4865
|
|
|
4866
|
+
@builtins.property
|
|
4867
|
+
def ephemeral_storage(self) -> typing.Optional[EphemeralStorageOverride]:
|
|
4868
|
+
'''The ephemeral storage setting override for the task.
|
|
4869
|
+
|
|
4870
|
+
NOTE: This parameter is only supported for tasks hosted on Fargate that use the following platform versions:
|
|
4871
|
+
|
|
4872
|
+
- Linux platform version 1.4.0 or later.
|
|
4873
|
+
- Windows platform version 1.0.0 or later.
|
|
4874
|
+
|
|
4875
|
+
:default: - The task definition's ephemeral storage value
|
|
4876
|
+
'''
|
|
4877
|
+
result = self._values.get("ephemeral_storage")
|
|
4878
|
+
return typing.cast(typing.Optional[EphemeralStorageOverride], result)
|
|
4879
|
+
|
|
4880
|
+
@builtins.property
|
|
4881
|
+
def execution_role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
4882
|
+
'''The execution role for the task.
|
|
4883
|
+
|
|
4884
|
+
The Amazon Resource Name (ARN) of the task execution role override for the task.
|
|
4885
|
+
|
|
4886
|
+
:default: - The task definition's execution role
|
|
4887
|
+
'''
|
|
4888
|
+
result = self._values.get("execution_role")
|
|
4889
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
4890
|
+
|
|
4891
|
+
@builtins.property
|
|
4892
|
+
def inference_accelerator_overrides(
|
|
4893
|
+
self,
|
|
4894
|
+
) -> typing.Optional[typing.List[InferenceAcceleratorOverride]]:
|
|
4895
|
+
'''The Elastic Inference accelerator override for the task.
|
|
4896
|
+
|
|
4897
|
+
:default: - The task definition's inference accelerator overrides
|
|
4898
|
+
'''
|
|
4899
|
+
result = self._values.get("inference_accelerator_overrides")
|
|
4900
|
+
return typing.cast(typing.Optional[typing.List[InferenceAcceleratorOverride]], result)
|
|
4901
|
+
|
|
4656
4902
|
@builtins.property
|
|
4657
4903
|
def launch_type(self) -> typing.Optional[_LaunchType_6894135d]:
|
|
4658
4904
|
'''Specifies the launch type on which your task is running.
|
|
@@ -4665,6 +4911,15 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4665
4911
|
result = self._values.get("launch_type")
|
|
4666
4912
|
return typing.cast(typing.Optional[_LaunchType_6894135d], result)
|
|
4667
4913
|
|
|
4914
|
+
@builtins.property
|
|
4915
|
+
def memory(self) -> typing.Optional[builtins.str]:
|
|
4916
|
+
'''The memory override for the task.
|
|
4917
|
+
|
|
4918
|
+
:default: - The task definition's memory value
|
|
4919
|
+
'''
|
|
4920
|
+
result = self._values.get("memory")
|
|
4921
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
4922
|
+
|
|
4668
4923
|
@builtins.property
|
|
4669
4924
|
def platform_version(self) -> typing.Optional[_FargatePlatformVersion_55d8be5c]:
|
|
4670
4925
|
'''The platform version on which to run your task.
|
|
@@ -4740,6 +4995,15 @@ class EcsTaskProps(TargetBaseProps):
|
|
|
4740
4995
|
result = self._values.get("task_count")
|
|
4741
4996
|
return typing.cast(typing.Optional[jsii.Number], result)
|
|
4742
4997
|
|
|
4998
|
+
@builtins.property
|
|
4999
|
+
def task_role(self) -> typing.Optional[_IRole_235f5d8e]:
|
|
5000
|
+
'''The IAM role for the task.
|
|
5001
|
+
|
|
5002
|
+
:default: - The task definition's task role
|
|
5003
|
+
'''
|
|
5004
|
+
result = self._values.get("task_role")
|
|
5005
|
+
return typing.cast(typing.Optional[_IRole_235f5d8e], result)
|
|
5006
|
+
|
|
4743
5007
|
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
4744
5008
|
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
4745
5009
|
|
|
@@ -5590,9 +5854,11 @@ __all__ = [
|
|
|
5590
5854
|
"ContainerOverride",
|
|
5591
5855
|
"EcsTask",
|
|
5592
5856
|
"EcsTaskProps",
|
|
5857
|
+
"EphemeralStorageOverride",
|
|
5593
5858
|
"EventBus",
|
|
5594
5859
|
"EventBusProps",
|
|
5595
5860
|
"IDeliveryStream",
|
|
5861
|
+
"InferenceAcceleratorOverride",
|
|
5596
5862
|
"KinesisFirehoseStream",
|
|
5597
5863
|
"KinesisFirehoseStreamProps",
|
|
5598
5864
|
"KinesisFirehoseStreamV2",
|
|
@@ -5815,6 +6081,13 @@ def _typecheckingstub__8ad199a8641f171a0447e974756bbddd91b00aaa9bcf33d231826916b
|
|
|
5815
6081
|
"""Type checking stubs"""
|
|
5816
6082
|
pass
|
|
5817
6083
|
|
|
6084
|
+
def _typecheckingstub__5eb4fe2cce860dd139eb826c1adfe14b0a1394ea467d09e880ac9c27d43ec835(
|
|
6085
|
+
*,
|
|
6086
|
+
size_in_gib: jsii.Number,
|
|
6087
|
+
) -> None:
|
|
6088
|
+
"""Type checking stubs"""
|
|
6089
|
+
pass
|
|
6090
|
+
|
|
5818
6091
|
def _typecheckingstub__e6012a31db9ac91c35876daca0265cba4fbb81bfdf8acd148b62786503371d52(
|
|
5819
6092
|
event_bus: _IEventBus_88d13111,
|
|
5820
6093
|
*,
|
|
@@ -5839,6 +6112,14 @@ def _typecheckingstub__5af20e134873490c1ac4788761972ccd53cd625edbd9b75c1c1f0b1a3
|
|
|
5839
6112
|
"""Type checking stubs"""
|
|
5840
6113
|
pass
|
|
5841
6114
|
|
|
6115
|
+
def _typecheckingstub__04d9348fef54fca78833e3224fa6f62badc3a0e6c0bfa6af7838fe531de0ebf6(
|
|
6116
|
+
*,
|
|
6117
|
+
device_name: builtins.str,
|
|
6118
|
+
device_type: builtins.str,
|
|
6119
|
+
) -> None:
|
|
6120
|
+
"""Type checking stubs"""
|
|
6121
|
+
pass
|
|
6122
|
+
|
|
5842
6123
|
def _typecheckingstub__c6dba8ed5e351380147a927ce30f4c9095bc69a54a2de45039c2a1d8275dc88c(
|
|
5843
6124
|
stream: _CfnDeliveryStream_8f3b1735,
|
|
5844
6125
|
*,
|
|
@@ -6132,8 +6413,13 @@ def _typecheckingstub__3624031da4f9372e2ccdb3e422123cc459d01922cc36bab5b96caa98f
|
|
|
6132
6413
|
task_definition: _ITaskDefinition_889ba4d8,
|
|
6133
6414
|
assign_public_ip: typing.Optional[builtins.bool] = None,
|
|
6134
6415
|
container_overrides: typing.Optional[typing.Sequence[typing.Union[ContainerOverride, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
6416
|
+
cpu: typing.Optional[builtins.str] = None,
|
|
6135
6417
|
enable_execute_command: typing.Optional[builtins.bool] = None,
|
|
6418
|
+
ephemeral_storage: typing.Optional[typing.Union[EphemeralStorageOverride, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
6419
|
+
execution_role: typing.Optional[_IRole_235f5d8e] = None,
|
|
6420
|
+
inference_accelerator_overrides: typing.Optional[typing.Sequence[typing.Union[InferenceAcceleratorOverride, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
6136
6421
|
launch_type: typing.Optional[_LaunchType_6894135d] = None,
|
|
6422
|
+
memory: typing.Optional[builtins.str] = None,
|
|
6137
6423
|
platform_version: typing.Optional[_FargatePlatformVersion_55d8be5c] = None,
|
|
6138
6424
|
propagate_tags: typing.Optional[_PropagatedTagSource_ad4e874a] = None,
|
|
6139
6425
|
role: typing.Optional[_IRole_235f5d8e] = None,
|
|
@@ -6141,6 +6427,7 @@ def _typecheckingstub__3624031da4f9372e2ccdb3e422123cc459d01922cc36bab5b96caa98f
|
|
|
6141
6427
|
subnet_selection: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
6142
6428
|
tags: typing.Optional[typing.Sequence[typing.Union[Tag, typing.Dict[builtins.str, typing.Any]]]] = None,
|
|
6143
6429
|
task_count: typing.Optional[jsii.Number] = None,
|
|
6430
|
+
task_role: typing.Optional[_IRole_235f5d8e] = None,
|
|
6144
6431
|
) -> None:
|
|
6145
6432
|
"""Type checking stubs"""
|
|
6146
6433
|
pass
|
aws_cdk/aws_iam/__init__.py
CHANGED
|
@@ -13890,7 +13890,7 @@ class ArnPrincipal(
|
|
|
13890
13890
|
Example::
|
|
13891
13891
|
|
|
13892
13892
|
# Option 2: create your custom mastersRole with scoped assumeBy arn as the Cluster prop. Switch to this role from the AWS console.
|
|
13893
|
-
from aws_cdk.
|
|
13893
|
+
from aws_cdk.lambda_layer_kubectl_v32 import KubectlV32Layer
|
|
13894
13894
|
# vpc: ec2.Vpc
|
|
13895
13895
|
|
|
13896
13896
|
|
|
@@ -13900,8 +13900,8 @@ class ArnPrincipal(
|
|
|
13900
13900
|
|
|
13901
13901
|
cluster = eks.Cluster(self, "EksCluster",
|
|
13902
13902
|
vpc=vpc,
|
|
13903
|
-
version=eks.KubernetesVersion.
|
|
13904
|
-
kubectl_layer=
|
|
13903
|
+
version=eks.KubernetesVersion.V1_32,
|
|
13904
|
+
kubectl_layer=KubectlV32Layer(self, "KubectlLayer"),
|
|
13905
13905
|
masters_role=masters_role
|
|
13906
13906
|
)
|
|
13907
13907
|
|