aws-cdk-lib 2.75.1__py3-none-any.whl → 2.76.0__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (98) hide show
  1. aws_cdk/__init__.py +245 -259
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.75.1.jsii.tgz → aws-cdk-lib@2.76.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_amplifyuibuilder/__init__.py +184 -216
  5. aws_cdk/aws_apigateway/__init__.py +95 -148
  6. aws_cdk/aws_appconfig/__init__.py +8 -4
  7. aws_cdk/aws_appflow/__init__.py +27 -52
  8. aws_cdk/aws_appmesh/__init__.py +91 -200
  9. aws_cdk/aws_apprunner/__init__.py +4 -16
  10. aws_cdk/aws_appstream/__init__.py +18 -82
  11. aws_cdk/aws_athena/__init__.py +18 -32
  12. aws_cdk/aws_backup/__init__.py +48 -86
  13. aws_cdk/aws_billingconductor/__init__.py +12 -7
  14. aws_cdk/aws_budgets/__init__.py +8 -17
  15. aws_cdk/aws_certificatemanager/__init__.py +7 -4
  16. aws_cdk/aws_cloudfront/__init__.py +14 -11
  17. aws_cdk/aws_cloudfront_origins/__init__.py +18 -8
  18. aws_cdk/aws_cloudtrail/__init__.py +7 -10
  19. aws_cdk/aws_cloudwatch/__init__.py +63 -35
  20. aws_cdk/aws_codebuild/__init__.py +10 -13
  21. aws_cdk/aws_codecommit/__init__.py +0 -1
  22. aws_cdk/aws_codedeploy/__init__.py +165 -162
  23. aws_cdk/aws_codepipeline/__init__.py +0 -4
  24. aws_cdk/aws_codepipeline_actions/__init__.py +16 -164
  25. aws_cdk/aws_cognito/__init__.py +195 -100
  26. aws_cdk/aws_config/__init__.py +28 -51
  27. aws_cdk/aws_connectcampaigns/__init__.py +5 -6
  28. aws_cdk/aws_databrew/__init__.py +5 -6
  29. aws_cdk/aws_dlm/__init__.py +33 -71
  30. aws_cdk/aws_docdb/__init__.py +20 -76
  31. aws_cdk/aws_dynamodb/__init__.py +7 -14
  32. aws_cdk/aws_ec2/__init__.py +1846 -421
  33. aws_cdk/aws_ecr/__init__.py +1 -2
  34. aws_cdk/aws_ecr_assets/__init__.py +27 -14
  35. aws_cdk/aws_ecs/__init__.py +241 -111
  36. aws_cdk/aws_ecs_patterns/__init__.py +13 -11
  37. aws_cdk/aws_eks/__init__.py +13 -8
  38. aws_cdk/aws_elasticloadbalancing/__init__.py +16 -9
  39. aws_cdk/aws_elasticloadbalancingv2/__init__.py +142 -82
  40. aws_cdk/aws_elasticloadbalancingv2_actions/__init__.py +126 -61
  41. aws_cdk/aws_elasticsearch/__init__.py +0 -7
  42. aws_cdk/aws_emr/__init__.py +7 -16
  43. aws_cdk/aws_emrserverless/__init__.py +14 -18
  44. aws_cdk/aws_events/__init__.py +33 -29
  45. aws_cdk/aws_events_targets/__init__.py +248 -89
  46. aws_cdk/aws_frauddetector/__init__.py +3 -4
  47. aws_cdk/aws_fsx/__init__.py +13 -7
  48. aws_cdk/aws_gamelift/__init__.py +11 -20
  49. aws_cdk/aws_iam/__init__.py +21 -25
  50. aws_cdk/aws_imagebuilder/__init__.py +58 -80
  51. aws_cdk/aws_iot/__init__.py +16 -10
  52. aws_cdk/aws_iotcoredeviceadvisor/__init__.py +16 -26
  53. aws_cdk/aws_iotevents/__init__.py +6 -4
  54. aws_cdk/aws_iotfleetwise/__init__.py +27 -40
  55. aws_cdk/aws_iotsitewise/__init__.py +8 -5
  56. aws_cdk/aws_kinesisfirehose/__init__.py +21 -38
  57. aws_cdk/aws_lambda/__init__.py +59 -48
  58. aws_cdk/aws_lambda_event_sources/__init__.py +6 -21
  59. aws_cdk/aws_logs/__init__.py +5 -7
  60. aws_cdk/aws_macie/__init__.py +22 -15
  61. aws_cdk/aws_mediaconnect/__init__.py +5 -8
  62. aws_cdk/aws_medialive/__init__.py +2 -4
  63. aws_cdk/aws_mediapackage/__init__.py +9 -18
  64. aws_cdk/aws_memorydb/__init__.py +5 -10
  65. aws_cdk/aws_mwaa/__init__.py +8 -4
  66. aws_cdk/aws_nimblestudio/__init__.py +25 -45
  67. aws_cdk/aws_opensearchservice/__init__.py +0 -1
  68. aws_cdk/aws_panorama/__init__.py +11 -12
  69. aws_cdk/aws_personalize/__init__.py +46 -72
  70. aws_cdk/aws_pinpoint/__init__.py +36 -65
  71. aws_cdk/aws_quicksight/__init__.py +9972 -13374
  72. aws_cdk/aws_rds/__init__.py +23 -22
  73. aws_cdk/aws_route53/__init__.py +8 -16
  74. aws_cdk/aws_route53_targets/__init__.py +2 -4
  75. aws_cdk/aws_s3/__init__.py +25 -85
  76. aws_cdk/aws_s3_notifications/__init__.py +0 -3
  77. aws_cdk/aws_sagemaker/__init__.py +6 -2
  78. aws_cdk/aws_secretsmanager/__init__.py +17 -14
  79. aws_cdk/aws_servicecatalog/__init__.py +58 -82
  80. aws_cdk/aws_servicediscovery/__init__.py +4 -6
  81. aws_cdk/aws_ses/__init__.py +21 -34
  82. aws_cdk/aws_sns/__init__.py +4 -8
  83. aws_cdk/aws_ssm/__init__.py +19 -23
  84. aws_cdk/aws_ssmcontacts/__init__.py +10 -6
  85. aws_cdk/aws_stepfunctions/__init__.py +3 -12
  86. aws_cdk/aws_stepfunctions_tasks/__init__.py +7 -12
  87. aws_cdk/aws_timestream/__init__.py +22 -28
  88. aws_cdk/aws_xray/__init__.py +15 -22
  89. aws_cdk/cloud_assembly_schema/__init__.py +14 -6
  90. aws_cdk/custom_resources/__init__.py +2 -3
  91. aws_cdk/pipelines/__init__.py +84 -134
  92. aws_cdk/triggers/__init__.py +46 -61
  93. {aws_cdk_lib-2.75.1.dist-info → aws_cdk_lib-2.76.0.dist-info}/METADATA +47 -92
  94. {aws_cdk_lib-2.75.1.dist-info → aws_cdk_lib-2.76.0.dist-info}/RECORD +98 -98
  95. {aws_cdk_lib-2.75.1.dist-info → aws_cdk_lib-2.76.0.dist-info}/LICENSE +0 -0
  96. {aws_cdk_lib-2.75.1.dist-info → aws_cdk_lib-2.76.0.dist-info}/NOTICE +0 -0
  97. {aws_cdk_lib-2.75.1.dist-info → aws_cdk_lib-2.76.0.dist-info}/WHEEL +0 -0
  98. {aws_cdk_lib-2.75.1.dist-info → aws_cdk_lib-2.76.0.dist-info}/top_level.txt +0 -0
@@ -738,22 +738,22 @@ The feature flag changes behavior for the entire CDK project. Therefore it is no
738
738
  declare const cluster: ecs.Cluster;
739
739
 
740
740
  // Import service from EC2 service attributes
741
- const service = ecs.Ec2Service.fromEc2ServiceAttributes(stack, 'EcsService', {
741
+ const service = ecs.Ec2Service.fromEc2ServiceAttributes(this, 'EcsService', {
742
742
  serviceArn: 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service',
743
743
  cluster,
744
744
  });
745
745
 
746
746
  // Import service from EC2 service ARN
747
- const service = ecs.Ec2Service.fromEc2ServiceArn(stack, 'EcsService', 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service');
747
+ const service = ecs.Ec2Service.fromEc2ServiceArn(this, 'EcsService', 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service');
748
748
 
749
749
  // Import service from Fargate service attributes
750
- const service = ecs.FargateService.fromFargateServiceAttributes(stack, 'EcsService', {
750
+ const service = ecs.FargateService.fromFargateServiceAttributes(this, 'EcsService', {
751
751
  serviceArn: 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service',
752
752
  cluster,
753
753
  });
754
754
 
755
755
  // Import service from Fargate service ARN
756
- const service = ecs.FargateService.fromFargateServiceArn(stack, 'EcsService', 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service');
756
+ const service = ecs.FargateService.fromFargateServiceArn(this, 'EcsService', 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service');
757
757
  ```
758
758
 
759
759
  ## Task Auto-Scaling
@@ -1168,11 +1168,10 @@ For more information visit https://docs.aws.amazon.com/AmazonECS/latest/develope
1168
1168
  When the service does not have a capacity provider strategy, the cluster's default capacity provider strategy will be used. Default Capacity Provider Strategy can be added by using the method `addDefaultCapacityProviderStrategy`. A capacity provider strategy cannot contain a mix of EC2 Autoscaling Group capacity providers and Fargate providers.
1169
1169
 
1170
1170
  ```python
1171
- # Example automatically generated from non-compiling source. May contain errors.
1172
- # capacity_provider: ecs.CapacityProvider
1171
+ # capacity_provider: ecs.AsgCapacityProvider
1173
1172
 
1174
1173
 
1175
- cluster = ecs.Cluster(stack, "EcsCluster",
1174
+ cluster = ecs.Cluster(self, "EcsCluster",
1176
1175
  enable_fargate_capacity_providers=True
1177
1176
  )
1178
1177
  cluster.add_asg_capacity_provider(capacity_provider)
@@ -1182,11 +1181,10 @@ cluster.add_default_capacity_provider_strategy([capacity_provider="FARGATE", bas
1182
1181
  ```
1183
1182
 
1184
1183
  ```python
1185
- # Example automatically generated from non-compiling source. May contain errors.
1186
- # capacity_provider: ecs.CapacityProvider
1184
+ # capacity_provider: ecs.AsgCapacityProvider
1187
1185
 
1188
1186
 
1189
- cluster = ecs.Cluster(stack, "EcsCluster",
1187
+ cluster = ecs.Cluster(self, "EcsCluster",
1190
1188
  enable_fargate_capacity_providers=True
1191
1189
  )
1192
1190
  cluster.add_asg_capacity_provider(capacity_provider)
@@ -1303,19 +1301,18 @@ To enable Service Connect, you must have created a CloudMap namespace. The CDK c
1303
1301
  or you can specify a custom namespace. You must also have created a named port mapping on at least one container in your Task Definition.
1304
1302
 
1305
1303
  ```python
1306
- # Example automatically generated from non-compiling source. May contain errors.
1307
1304
  # cluster: ecs.Cluster
1308
1305
  # task_definition: ecs.TaskDefinition
1309
- # container: ecs.ContainerDefinition
1306
+ # container_options: ecs.ContainerDefinitionOptions
1307
+
1310
1308
 
1309
+ container = task_definition.add_container("MyContainer", container_options)
1311
1310
 
1312
1311
  container.add_port_mappings(
1313
1312
  name="api",
1314
1313
  container_port=8080
1315
1314
  )
1316
1315
 
1317
- task_definition.add_container(container)
1318
-
1319
1316
  cluster.add_default_cloud_map_namespace(
1320
1317
  name="local"
1321
1318
  )
@@ -1340,7 +1337,10 @@ be routed to the container's port 8080.
1340
1337
  To opt a service into using service connect without advertising a port, simply call the 'enableServiceConnect' method on an initialized service.
1341
1338
 
1342
1339
  ```python
1343
- # Example automatically generated from non-compiling source. May contain errors.
1340
+ # cluster: ecs.Cluster
1341
+ # task_definition: ecs.TaskDefinition
1342
+
1343
+
1344
1344
  service = ecs.FargateService(self, "Service",
1345
1345
  cluster=cluster,
1346
1346
  task_definition=task_definition
@@ -1351,12 +1351,15 @@ service.enable_service_connect()
1351
1351
  Service Connect also allows custom logging, Service Discovery name, and configuration of the port where service connect traffic is received.
1352
1352
 
1353
1353
  ```python
1354
- # Example automatically generated from non-compiling source. May contain errors.
1354
+ # cluster: ecs.Cluster
1355
+ # task_definition: ecs.TaskDefinition
1356
+
1357
+
1355
1358
  custom_service = ecs.FargateService(self, "CustomizedService",
1356
1359
  cluster=cluster,
1357
1360
  task_definition=task_definition,
1358
1361
  service_connect_configuration=ecs.ServiceConnectProps(
1359
- log_driver=ecs.LogDrivers.awslogs(
1362
+ log_driver=ecs.LogDrivers.aws_logs(
1360
1363
  stream_prefix="sc-traffic"
1361
1364
  ),
1362
1365
  services=[ecs.ServiceConnectService(
@@ -3251,8 +3254,12 @@ class AssetImageProps(_DockerImageAssetOptions_9580cd76):
3251
3254
 
3252
3255
  Example::
3253
3256
 
3254
- # Example automatically generated from non-compiling source. May contain errors.
3255
- "MY_SECRET"DockerBuildSecret.from_src("file.txt")
3257
+ from aws_cdk import DockerBuildSecret
3258
+
3259
+
3260
+ build_secrets = {
3261
+ "MY_SECRET": DockerBuildSecret.from_src("file.txt")
3262
+ }
3256
3263
  '''
3257
3264
  result = self._values.get("build_secrets")
3258
3265
  return typing.cast(typing.Optional[typing.Mapping[builtins.str, builtins.str]], result)
@@ -10962,7 +10969,7 @@ class CfnTaskDefinition(
10962
10969
  :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.
10963
10970
  :param dns_servers: A list of DNS servers that are presented to the container. This parameter maps to ``Dns`` 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`` 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.
10964
10971
  :param docker_labels: A key/value map of labels to add to the container. This parameter maps to ``Labels`` 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 ``--label`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . 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}}'``
10965
- :param docker_security_options: A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. This field isn't valid for containers in tasks using the Fargate launch type. With Windows containers, this parameter can be used to reference a credential spec file when configuring a container for Active Directory authentication. For more information, see `Using gMSAs for Windows Containers <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html>`_ in the *Amazon Elastic Container Service Developer Guide* . This parameter maps to ``SecurityOpt`` 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 ``--security-opt`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . .. epigraph:: The Amazon ECS container agent running on a container instance must register with the ``ECS_SELINUX_CAPABLE=true`` or ``ECS_APPARMOR_CAPABLE=true`` environment variables before containers placed on that instance can use these security options. For more information, see `Amazon ECS Container Agent Configuration <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html>`_ in the *Amazon Elastic Container Service Developer Guide* . For more information about valid values, see `Docker Run Security Configuration <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . Valid values: "no-new-privileges" | "apparmor:PROFILE" | "label:value" | "credentialspec:CredentialSpecFilePath"
10972
+ :param docker_security_options: A list of strings to provide custom configuration for multiple security systems. For more information about valid values, see `Docker Run Security Configuration <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . This field isn't valid for containers in tasks using the Fargate launch type. For Linux tasks on EC2, this parameter can be used to reference custom labels for SELinux and AppArmor multi-level security systems. For any tasks on EC2, this parameter can be used to reference a credential spec file that configures a container for Active Directory authentication. 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>`_ in the *Amazon Elastic Container Service Developer Guide* . This parameter maps to ``SecurityOpt`` 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 ``--security-opt`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . .. epigraph:: The Amazon ECS container agent running on a container instance must register with the ``ECS_SELINUX_CAPABLE=true`` or ``ECS_APPARMOR_CAPABLE=true`` environment variables before containers placed on that instance can use these security options. For more information, see `Amazon ECS Container Agent Configuration <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html>`_ in the *Amazon Elastic Container Service Developer Guide* . For more information about valid values, see `Docker Run Security Configuration <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . Valid values: "no-new-privileges" | "apparmor:PROFILE" | "label:value" | "credentialspec:CredentialSpecFilePath"
10966
10973
  :param entry_point: .. epigraph:: Early versions of the Amazon ECS container agent don't properly handle ``entryPoint`` parameters. If you have problems using ``entryPoint`` , update your container agent or enter your commands and arguments as ``command`` array items instead. The entry point that's passed to the container. This parameter maps to ``Entrypoint`` 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 ``--entrypoint`` option 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/#entrypoint <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/builder/#entrypoint>`_ .
10967
10974
  :param environment: The environment variables to pass to a container. This parameter maps to ``Env`` 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 ``--env`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . .. epigraph:: We don't recommend that you use plaintext environment variables for sensitive information, such as credential data.
10968
10975
  :param environment_files: A list of files containing the environment variables to pass to a container. This parameter maps to the ``--env-file`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . You can specify up to ten environment files. The file must have a ``.env`` file extension. Each line in an environment file contains an environment variable in ``VARIABLE=VALUE`` format. Lines beginning with ``#`` are treated as comments and are ignored. For more information about the environment variable file syntax, see `Declare default environment variables in file <https://docs.aws.amazon.com/https://docs.docker.com/compose/env-file/>`_ . If there are environment variables specified using the ``environment`` parameter in a container definition, they take precedence over the variables contained within an environment file. If multiple environment files are specified that contain the same variable, they're processed from the top down. We recommend that you use unique variable names. For more information, see `Specifying Environment Variables <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html>`_ in the *Amazon Elastic Container Service Developer Guide* .
@@ -11399,11 +11406,13 @@ class CfnTaskDefinition(
11399
11406
 
11400
11407
  @builtins.property
11401
11408
  def docker_security_options(self) -> typing.Optional[typing.List[builtins.str]]:
11402
- '''A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems.
11409
+ '''A list of strings to provide custom configuration for multiple security systems.
11410
+
11411
+ For more information about valid values, see `Docker Run Security Configuration <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ . This field isn't valid for containers in tasks using the Fargate launch type.
11403
11412
 
11404
- This field isn't valid for containers in tasks using the Fargate launch type.
11413
+ For Linux tasks on EC2, this parameter can be used to reference custom labels for SELinux and AppArmor multi-level security systems.
11405
11414
 
11406
- With Windows containers, this parameter can be used to reference a credential spec file when configuring a container for Active Directory authentication. For more information, see `Using gMSAs for Windows Containers <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html>`_ in the *Amazon Elastic Container Service Developer Guide* .
11415
+ For any tasks on EC2, this parameter can be used to reference a credential spec file that configures a container for Active Directory authentication. 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>`_ in the *Amazon Elastic Container Service Developer Guide* .
11407
11416
 
11408
11417
  This parameter maps to ``SecurityOpt`` 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 ``--security-opt`` option to `docker run <https://docs.aws.amazon.com/https://docs.docker.com/engine/reference/run/#security-configuration>`_ .
11409
11418
  .. epigraph::
@@ -16399,19 +16408,18 @@ class CloudMapNamespaceOptions:
16399
16408
 
16400
16409
  Example::
16401
16410
 
16402
- # Example automatically generated from non-compiling source. May contain errors.
16403
16411
  # cluster: ecs.Cluster
16404
16412
  # task_definition: ecs.TaskDefinition
16405
- # container: ecs.ContainerDefinition
16413
+ # container_options: ecs.ContainerDefinitionOptions
16406
16414
 
16407
16415
 
16416
+ container = task_definition.add_container("MyContainer", container_options)
16417
+
16408
16418
  container.add_port_mappings(
16409
16419
  name="api",
16410
16420
  container_port=8080
16411
16421
  )
16412
16422
 
16413
- task_definition.add_container(container)
16414
-
16415
16423
  cluster.add_default_cloud_map_namespace(
16416
16424
  name="local"
16417
16425
  )
@@ -17023,6 +17031,7 @@ class ClusterProps:
17023
17031
  jsii_struct_bases=[],
17024
17032
  name_mapping={
17025
17033
  "task_definition_arn": "taskDefinitionArn",
17034
+ "execution_role": "executionRole",
17026
17035
  "network_mode": "networkMode",
17027
17036
  "task_role": "taskRole",
17028
17037
  },
@@ -17032,12 +17041,14 @@ class CommonTaskDefinitionAttributes:
17032
17041
  self,
17033
17042
  *,
17034
17043
  task_definition_arn: builtins.str,
17044
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
17035
17045
  network_mode: typing.Optional["NetworkMode"] = None,
17036
17046
  task_role: typing.Optional[_IRole_235f5d8e] = None,
17037
17047
  ) -> None:
17038
17048
  '''The common task definition attributes used across all types of task definitions.
17039
17049
 
17040
17050
  :param task_definition_arn: The arn of the task definition.
17051
+ :param execution_role: The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. Some tasks do not have an execution role. Default: - undefined
17041
17052
  :param network_mode: The networking mode to use for the containers in the task. Default: Network mode cannot be provided to the imported task.
17042
17053
  :param task_role: The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. Default: Permissions cannot be granted to the imported task.
17043
17054
 
@@ -17056,6 +17067,7 @@ class CommonTaskDefinitionAttributes:
17056
17067
  task_definition_arn="taskDefinitionArn",
17057
17068
 
17058
17069
  # the properties below are optional
17070
+ execution_role=role,
17059
17071
  network_mode=ecs.NetworkMode.NONE,
17060
17072
  task_role=role
17061
17073
  )
@@ -17063,11 +17075,14 @@ class CommonTaskDefinitionAttributes:
17063
17075
  if __debug__:
17064
17076
  type_hints = typing.get_type_hints(_typecheckingstub__1a458c1ea772685ddb7eb49b075e7de9bed322fac4bbee8aeab1cf6b576bc995)
17065
17077
  check_type(argname="argument task_definition_arn", value=task_definition_arn, expected_type=type_hints["task_definition_arn"])
17078
+ check_type(argname="argument execution_role", value=execution_role, expected_type=type_hints["execution_role"])
17066
17079
  check_type(argname="argument network_mode", value=network_mode, expected_type=type_hints["network_mode"])
17067
17080
  check_type(argname="argument task_role", value=task_role, expected_type=type_hints["task_role"])
17068
17081
  self._values: typing.Dict[builtins.str, typing.Any] = {
17069
17082
  "task_definition_arn": task_definition_arn,
17070
17083
  }
17084
+ if execution_role is not None:
17085
+ self._values["execution_role"] = execution_role
17071
17086
  if network_mode is not None:
17072
17087
  self._values["network_mode"] = network_mode
17073
17088
  if task_role is not None:
@@ -17080,6 +17095,17 @@ class CommonTaskDefinitionAttributes:
17080
17095
  assert result is not None, "Required property 'task_definition_arn' is missing"
17081
17096
  return typing.cast(builtins.str, result)
17082
17097
 
17098
+ @builtins.property
17099
+ def execution_role(self) -> typing.Optional[_IRole_235f5d8e]:
17100
+ '''The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf.
17101
+
17102
+ Some tasks do not have an execution role.
17103
+
17104
+ :default: - undefined
17105
+ '''
17106
+ result = self._values.get("execution_role")
17107
+ return typing.cast(typing.Optional[_IRole_235f5d8e], result)
17108
+
17083
17109
  @builtins.property
17084
17110
  def network_mode(self) -> typing.Optional["NetworkMode"]:
17085
17111
  '''The networking mode to use for the containers in the task.
@@ -19743,20 +19769,31 @@ class DeploymentController:
19743
19769
 
19744
19770
  Example::
19745
19771
 
19772
+ # my_application: codedeploy.EcsApplication
19746
19773
  # cluster: ecs.Cluster
19774
+ # task_definition: ecs.FargateTaskDefinition
19775
+ # blue_target_group: elbv2.ITargetGroup
19776
+ # green_target_group: elbv2.ITargetGroup
19777
+ # listener: elbv2.IApplicationListener
19747
19778
 
19748
- load_balanced_fargate_service = ecs_patterns.ApplicationLoadBalancedFargateService(self, "Service",
19779
+
19780
+ service = ecs.FargateService(self, "Service",
19749
19781
  cluster=cluster,
19750
- memory_limit_mi_b=1024,
19751
- desired_count=1,
19752
- cpu=512,
19753
- task_image_options=ecsPatterns.ApplicationLoadBalancedTaskImageOptions(
19754
- image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
19755
- ),
19782
+ task_definition=task_definition,
19756
19783
  deployment_controller=ecs.DeploymentController(
19757
19784
  type=ecs.DeploymentControllerType.CODE_DEPLOY
19758
19785
  )
19759
19786
  )
19787
+
19788
+ codedeploy.EcsDeploymentGroup(self, "BlueGreenDG",
19789
+ service=service,
19790
+ blue_green_deployment_config=codedeploy.EcsBlueGreenDeploymentConfig(
19791
+ blue_target_group=blue_target_group,
19792
+ green_target_group=green_target_group,
19793
+ listener=listener
19794
+ ),
19795
+ deployment_config=codedeploy.EcsDeploymentConfig.CANARY_10PERCENT_5MINUTES
19796
+ )
19760
19797
  '''
19761
19798
  if __debug__:
19762
19799
  type_hints = typing.get_type_hints(_typecheckingstub__919598d1dc3ec32befe4a81bbf3a26a387685443884de6cb5971808667ffb28b)
@@ -19794,20 +19831,31 @@ class DeploymentControllerType(enum.Enum):
19794
19831
 
19795
19832
  Example::
19796
19833
 
19834
+ # my_application: codedeploy.EcsApplication
19797
19835
  # cluster: ecs.Cluster
19836
+ # task_definition: ecs.FargateTaskDefinition
19837
+ # blue_target_group: elbv2.ITargetGroup
19838
+ # green_target_group: elbv2.ITargetGroup
19839
+ # listener: elbv2.IApplicationListener
19798
19840
 
19799
- load_balanced_fargate_service = ecs_patterns.ApplicationLoadBalancedFargateService(self, "Service",
19841
+
19842
+ service = ecs.FargateService(self, "Service",
19800
19843
  cluster=cluster,
19801
- memory_limit_mi_b=1024,
19802
- desired_count=1,
19803
- cpu=512,
19804
- task_image_options=ecsPatterns.ApplicationLoadBalancedTaskImageOptions(
19805
- image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample")
19806
- ),
19844
+ task_definition=task_definition,
19807
19845
  deployment_controller=ecs.DeploymentController(
19808
19846
  type=ecs.DeploymentControllerType.CODE_DEPLOY
19809
19847
  )
19810
19848
  )
19849
+
19850
+ codedeploy.EcsDeploymentGroup(self, "BlueGreenDG",
19851
+ service=service,
19852
+ blue_green_deployment_config=codedeploy.EcsBlueGreenDeploymentConfig(
19853
+ blue_target_group=blue_target_group,
19854
+ green_target_group=green_target_group,
19855
+ listener=listener
19856
+ ),
19857
+ deployment_config=codedeploy.EcsDeploymentConfig.CANARY_10PERCENT_5MINUTES
19858
+ )
19811
19859
  '''
19812
19860
 
19813
19861
  ECS = "ECS"
@@ -20556,6 +20604,7 @@ class Ec2ServiceProps(BaseServiceOptions):
20556
20604
  jsii_struct_bases=[CommonTaskDefinitionAttributes],
20557
20605
  name_mapping={
20558
20606
  "task_definition_arn": "taskDefinitionArn",
20607
+ "execution_role": "executionRole",
20559
20608
  "network_mode": "networkMode",
20560
20609
  "task_role": "taskRole",
20561
20610
  },
@@ -20565,12 +20614,14 @@ class Ec2TaskDefinitionAttributes(CommonTaskDefinitionAttributes):
20565
20614
  self,
20566
20615
  *,
20567
20616
  task_definition_arn: builtins.str,
20617
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
20568
20618
  network_mode: typing.Optional["NetworkMode"] = None,
20569
20619
  task_role: typing.Optional[_IRole_235f5d8e] = None,
20570
20620
  ) -> None:
20571
20621
  '''Attributes used to import an existing EC2 task definition.
20572
20622
 
20573
20623
  :param task_definition_arn: The arn of the task definition.
20624
+ :param execution_role: The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. Some tasks do not have an execution role. Default: - undefined
20574
20625
  :param network_mode: The networking mode to use for the containers in the task. Default: Network mode cannot be provided to the imported task.
20575
20626
  :param task_role: The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. Default: Permissions cannot be granted to the imported task.
20576
20627
 
@@ -20589,6 +20640,7 @@ class Ec2TaskDefinitionAttributes(CommonTaskDefinitionAttributes):
20589
20640
  task_definition_arn="taskDefinitionArn",
20590
20641
 
20591
20642
  # the properties below are optional
20643
+ execution_role=role,
20592
20644
  network_mode=ecs.NetworkMode.NONE,
20593
20645
  task_role=role
20594
20646
  )
@@ -20596,11 +20648,14 @@ class Ec2TaskDefinitionAttributes(CommonTaskDefinitionAttributes):
20596
20648
  if __debug__:
20597
20649
  type_hints = typing.get_type_hints(_typecheckingstub__e90e61a002f578b0dbe160c067f2d3de15287892110df7eedcbbfa7f0c7d391d)
20598
20650
  check_type(argname="argument task_definition_arn", value=task_definition_arn, expected_type=type_hints["task_definition_arn"])
20651
+ check_type(argname="argument execution_role", value=execution_role, expected_type=type_hints["execution_role"])
20599
20652
  check_type(argname="argument network_mode", value=network_mode, expected_type=type_hints["network_mode"])
20600
20653
  check_type(argname="argument task_role", value=task_role, expected_type=type_hints["task_role"])
20601
20654
  self._values: typing.Dict[builtins.str, typing.Any] = {
20602
20655
  "task_definition_arn": task_definition_arn,
20603
20656
  }
20657
+ if execution_role is not None:
20658
+ self._values["execution_role"] = execution_role
20604
20659
  if network_mode is not None:
20605
20660
  self._values["network_mode"] = network_mode
20606
20661
  if task_role is not None:
@@ -20613,6 +20668,17 @@ class Ec2TaskDefinitionAttributes(CommonTaskDefinitionAttributes):
20613
20668
  assert result is not None, "Required property 'task_definition_arn' is missing"
20614
20669
  return typing.cast(builtins.str, result)
20615
20670
 
20671
+ @builtins.property
20672
+ def execution_role(self) -> typing.Optional[_IRole_235f5d8e]:
20673
+ '''The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf.
20674
+
20675
+ Some tasks do not have an execution role.
20676
+
20677
+ :default: - undefined
20678
+ '''
20679
+ result = self._values.get("execution_role")
20680
+ return typing.cast(typing.Optional[_IRole_235f5d8e], result)
20681
+
20616
20682
  @builtins.property
20617
20683
  def network_mode(self) -> typing.Optional["NetworkMode"]:
20618
20684
  '''The networking mode to use for the containers in the task.
@@ -22287,6 +22353,7 @@ class ExternalServiceProps(BaseServiceOptions):
22287
22353
  jsii_struct_bases=[CommonTaskDefinitionAttributes],
22288
22354
  name_mapping={
22289
22355
  "task_definition_arn": "taskDefinitionArn",
22356
+ "execution_role": "executionRole",
22290
22357
  "network_mode": "networkMode",
22291
22358
  "task_role": "taskRole",
22292
22359
  },
@@ -22296,12 +22363,14 @@ class ExternalTaskDefinitionAttributes(CommonTaskDefinitionAttributes):
22296
22363
  self,
22297
22364
  *,
22298
22365
  task_definition_arn: builtins.str,
22366
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
22299
22367
  network_mode: typing.Optional["NetworkMode"] = None,
22300
22368
  task_role: typing.Optional[_IRole_235f5d8e] = None,
22301
22369
  ) -> None:
22302
22370
  '''Attributes used to import an existing External task definition.
22303
22371
 
22304
22372
  :param task_definition_arn: The arn of the task definition.
22373
+ :param execution_role: The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. Some tasks do not have an execution role. Default: - undefined
22305
22374
  :param network_mode: The networking mode to use for the containers in the task. Default: Network mode cannot be provided to the imported task.
22306
22375
  :param task_role: The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. Default: Permissions cannot be granted to the imported task.
22307
22376
 
@@ -22320,6 +22389,7 @@ class ExternalTaskDefinitionAttributes(CommonTaskDefinitionAttributes):
22320
22389
  task_definition_arn="taskDefinitionArn",
22321
22390
 
22322
22391
  # the properties below are optional
22392
+ execution_role=role,
22323
22393
  network_mode=ecs.NetworkMode.NONE,
22324
22394
  task_role=role
22325
22395
  )
@@ -22327,11 +22397,14 @@ class ExternalTaskDefinitionAttributes(CommonTaskDefinitionAttributes):
22327
22397
  if __debug__:
22328
22398
  type_hints = typing.get_type_hints(_typecheckingstub__2d58078e68b889d5f10f95714f42385491c26bf6ec084584b1a1487cc3acf7a2)
22329
22399
  check_type(argname="argument task_definition_arn", value=task_definition_arn, expected_type=type_hints["task_definition_arn"])
22400
+ check_type(argname="argument execution_role", value=execution_role, expected_type=type_hints["execution_role"])
22330
22401
  check_type(argname="argument network_mode", value=network_mode, expected_type=type_hints["network_mode"])
22331
22402
  check_type(argname="argument task_role", value=task_role, expected_type=type_hints["task_role"])
22332
22403
  self._values: typing.Dict[builtins.str, typing.Any] = {
22333
22404
  "task_definition_arn": task_definition_arn,
22334
22405
  }
22406
+ if execution_role is not None:
22407
+ self._values["execution_role"] = execution_role
22335
22408
  if network_mode is not None:
22336
22409
  self._values["network_mode"] = network_mode
22337
22410
  if task_role is not None:
@@ -22344,6 +22417,17 @@ class ExternalTaskDefinitionAttributes(CommonTaskDefinitionAttributes):
22344
22417
  assert result is not None, "Required property 'task_definition_arn' is missing"
22345
22418
  return typing.cast(builtins.str, result)
22346
22419
 
22420
+ @builtins.property
22421
+ def execution_role(self) -> typing.Optional[_IRole_235f5d8e]:
22422
+ '''The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf.
22423
+
22424
+ Some tasks do not have an execution role.
22425
+
22426
+ :default: - undefined
22427
+ '''
22428
+ result = self._values.get("execution_role")
22429
+ return typing.cast(typing.Optional[_IRole_235f5d8e], result)
22430
+
22347
22431
  @builtins.property
22348
22432
  def network_mode(self) -> typing.Optional["NetworkMode"]:
22349
22433
  '''The networking mode to use for the containers in the task.
@@ -23076,6 +23160,7 @@ class FargateServiceProps(BaseServiceOptions):
23076
23160
  jsii_struct_bases=[CommonTaskDefinitionAttributes],
23077
23161
  name_mapping={
23078
23162
  "task_definition_arn": "taskDefinitionArn",
23163
+ "execution_role": "executionRole",
23079
23164
  "network_mode": "networkMode",
23080
23165
  "task_role": "taskRole",
23081
23166
  },
@@ -23085,12 +23170,14 @@ class FargateTaskDefinitionAttributes(CommonTaskDefinitionAttributes):
23085
23170
  self,
23086
23171
  *,
23087
23172
  task_definition_arn: builtins.str,
23173
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
23088
23174
  network_mode: typing.Optional["NetworkMode"] = None,
23089
23175
  task_role: typing.Optional[_IRole_235f5d8e] = None,
23090
23176
  ) -> None:
23091
23177
  '''Attributes used to import an existing Fargate task definition.
23092
23178
 
23093
23179
  :param task_definition_arn: The arn of the task definition.
23180
+ :param execution_role: The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. Some tasks do not have an execution role. Default: - undefined
23094
23181
  :param network_mode: The networking mode to use for the containers in the task. Default: Network mode cannot be provided to the imported task.
23095
23182
  :param task_role: The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. Default: Permissions cannot be granted to the imported task.
23096
23183
 
@@ -23109,6 +23196,7 @@ class FargateTaskDefinitionAttributes(CommonTaskDefinitionAttributes):
23109
23196
  task_definition_arn="taskDefinitionArn",
23110
23197
 
23111
23198
  # the properties below are optional
23199
+ execution_role=role,
23112
23200
  network_mode=ecs.NetworkMode.NONE,
23113
23201
  task_role=role
23114
23202
  )
@@ -23116,11 +23204,14 @@ class FargateTaskDefinitionAttributes(CommonTaskDefinitionAttributes):
23116
23204
  if __debug__:
23117
23205
  type_hints = typing.get_type_hints(_typecheckingstub__5dd329152ba42239c8e48630ce2d0477a28dd88014af62f4536ef752f002010e)
23118
23206
  check_type(argname="argument task_definition_arn", value=task_definition_arn, expected_type=type_hints["task_definition_arn"])
23207
+ check_type(argname="argument execution_role", value=execution_role, expected_type=type_hints["execution_role"])
23119
23208
  check_type(argname="argument network_mode", value=network_mode, expected_type=type_hints["network_mode"])
23120
23209
  check_type(argname="argument task_role", value=task_role, expected_type=type_hints["task_role"])
23121
23210
  self._values: typing.Dict[builtins.str, typing.Any] = {
23122
23211
  "task_definition_arn": task_definition_arn,
23123
23212
  }
23213
+ if execution_role is not None:
23214
+ self._values["execution_role"] = execution_role
23124
23215
  if network_mode is not None:
23125
23216
  self._values["network_mode"] = network_mode
23126
23217
  if task_role is not None:
@@ -23133,6 +23224,17 @@ class FargateTaskDefinitionAttributes(CommonTaskDefinitionAttributes):
23133
23224
  assert result is not None, "Required property 'task_definition_arn' is missing"
23134
23225
  return typing.cast(builtins.str, result)
23135
23226
 
23227
+ @builtins.property
23228
+ def execution_role(self) -> typing.Optional[_IRole_235f5d8e]:
23229
+ '''The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf.
23230
+
23231
+ Some tasks do not have an execution role.
23232
+
23233
+ :default: - undefined
23234
+ '''
23235
+ result = self._values.get("execution_role")
23236
+ return typing.cast(typing.Optional[_IRole_235f5d8e], result)
23237
+
23136
23238
  @builtins.property
23137
23239
  def network_mode(self) -> typing.Optional["NetworkMode"]:
23138
23240
  '''The networking mode to use for the containers in the task.
@@ -27396,17 +27498,17 @@ class LogDriver(
27396
27498
 
27397
27499
  Example::
27398
27500
 
27501
+ # secret: ecs.Secret
27502
+
27503
+
27399
27504
  # Create a Task Definition for the container to start
27400
27505
  task_definition = ecs.Ec2TaskDefinition(self, "TaskDef")
27401
27506
  task_definition.add_container("TheContainer",
27402
27507
  image=ecs.ContainerImage.from_registry("example-image"),
27403
27508
  memory_limit_mi_b=256,
27404
- logging=ecs.LogDrivers.firelens(
27405
- options={
27406
- "Name": "firehose",
27407
- "region": "us-west-2",
27408
- "delivery_stream": "my-stream"
27409
- }
27509
+ logging=ecs.LogDrivers.splunk(
27510
+ secret_token=secret,
27511
+ url="my-splunk-url"
27410
27512
  )
27411
27513
  )
27412
27514
  '''
@@ -27599,12 +27701,18 @@ class LogDrivers(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_ecs.LogDriv
27599
27701
 
27600
27702
  Example::
27601
27703
 
27704
+ # secret: ecs.Secret
27705
+
27706
+
27602
27707
  # Create a Task Definition for the container to start
27603
27708
  task_definition = ecs.Ec2TaskDefinition(self, "TaskDef")
27604
27709
  task_definition.add_container("TheContainer",
27605
27710
  image=ecs.ContainerImage.from_registry("example-image"),
27606
27711
  memory_limit_mi_b=256,
27607
- logging=ecs.LogDrivers.aws_logs(stream_prefix="EventDemo")
27712
+ logging=ecs.LogDrivers.splunk(
27713
+ secret_token=secret,
27714
+ url="my-splunk-url"
27715
+ )
27608
27716
  )
27609
27717
  '''
27610
27718
 
@@ -28795,35 +28903,29 @@ class PropagatedTagSource(enum.Enum):
28795
28903
  is_default=True
28796
28904
  )
28797
28905
 
28798
- cluster = ecs.Cluster(self, "Ec2Cluster", vpc=vpc)
28799
- cluster.add_capacity("DefaultAutoScalingGroup",
28800
- instance_type=ec2.InstanceType("t2.micro"),
28801
- vpc_subnets=ec2.SubnetSelection(subnet_type=ec2.SubnetType.PUBLIC)
28802
- )
28906
+ cluster = ecs.Cluster(self, "FargateCluster", vpc=vpc)
28803
28907
 
28804
28908
  task_definition = ecs.TaskDefinition(self, "TD",
28805
- compatibility=ecs.Compatibility.EC2
28909
+ memory_mi_b="512",
28910
+ cpu="256",
28911
+ compatibility=ecs.Compatibility.FARGATE
28806
28912
  )
28807
28913
 
28808
- task_definition.add_container("TheContainer",
28914
+ container_definition = task_definition.add_container("TheContainer",
28809
28915
  image=ecs.ContainerImage.from_registry("foo/bar"),
28810
28916
  memory_limit_mi_b=256
28811
28917
  )
28812
28918
 
28813
- run_task = tasks.EcsRunTask(self, "Run",
28919
+ run_task = tasks.EcsRunTask(self, "RunFargate",
28814
28920
  integration_pattern=sfn.IntegrationPattern.RUN_JOB,
28815
28921
  cluster=cluster,
28816
28922
  task_definition=task_definition,
28817
- launch_target=tasks.EcsEc2LaunchTarget(
28818
- placement_strategies=[
28819
- ecs.PlacementStrategy.spread_across_instances(),
28820
- ecs.PlacementStrategy.packed_by_cpu(),
28821
- ecs.PlacementStrategy.randomly()
28822
- ],
28823
- placement_constraints=[
28824
- ecs.PlacementConstraint.member_of("blieptuut")
28825
- ]
28826
- ),
28923
+ assign_public_ip=True,
28924
+ container_overrides=[tasks.ContainerOverride(
28925
+ container_definition=container_definition,
28926
+ environment=[tasks.TaskEnvironmentVariable(name="SOME_KEY", value=sfn.JsonPath.string_at("$.SomeKey"))]
28927
+ )],
28928
+ launch_target=tasks.EcsFargateLaunchTarget(),
28827
28929
  propagated_tag_source=ecs.PropagatedTagSource.TASK_DEFINITION
28828
28930
  )
28829
28931
  '''
@@ -28980,17 +29082,17 @@ class RepositoryImage(
28980
29082
  Example::
28981
29083
 
28982
29084
  # Example automatically generated from non-compiling source. May contain errors.
28983
- import aws_cdk.aws_batch as batch
29085
+ import aws_cdk.aws_batch_alpha as batch
28984
29086
  from aws_cdk.aws_ecs import ContainerImage
28985
29087
 
28986
29088
 
28987
29089
  job_queue = batch.JobQueue(self, "MyQueue",
28988
- compute_environments=[{
28989
- "compute_environment": batch.ComputeEnvironment(self, "ComputeEnvironment",
29090
+ compute_environments=[batch.OrderedComputeEnvironment(
29091
+ compute_environment=batch.ComputeEnvironment(self, "ComputeEnvironment",
28990
29092
  managed=False
28991
29093
  ),
28992
- "order": 1
28993
- }
29094
+ order=1
29095
+ )
28994
29096
  ]
28995
29097
  )
28996
29098
 
@@ -29003,14 +29105,14 @@ class RepositoryImage(
29003
29105
  queue = sqs.Queue(self, "Queue")
29004
29106
 
29005
29107
  rule = events.Rule(self, "Rule",
29006
- schedule=events.Schedule.rate(cdk.Duration.hours(1))
29108
+ schedule=events.Schedule.rate(Duration.hours(1))
29007
29109
  )
29008
29110
 
29009
29111
  rule.add_target(targets.BatchJob(job_queue.job_queue_arn, job_queue, job_definition.job_definition_arn, job_definition,
29010
29112
  dead_letter_queue=queue,
29011
29113
  event=events.RuleTargetInput.from_object({"SomeParam": "SomeValue"}),
29012
29114
  retry_attempts=2,
29013
- max_event_age=cdk.Duration.hours(2)
29115
+ max_event_age=Duration.hours(2)
29014
29116
  ))
29015
29117
  '''
29016
29118
 
@@ -30252,19 +30354,18 @@ class ServiceConnectProps:
30252
30354
 
30253
30355
  Example::
30254
30356
 
30255
- # Example automatically generated from non-compiling source. May contain errors.
30256
30357
  # cluster: ecs.Cluster
30257
30358
  # task_definition: ecs.TaskDefinition
30258
- # container: ecs.ContainerDefinition
30359
+ # container_options: ecs.ContainerDefinitionOptions
30360
+
30259
30361
 
30362
+ container = task_definition.add_container("MyContainer", container_options)
30260
30363
 
30261
30364
  container.add_port_mappings(
30262
30365
  name="api",
30263
30366
  container_port=8080
30264
30367
  )
30265
30368
 
30266
- task_definition.add_container(container)
30267
-
30268
30369
  cluster.add_default_cloud_map_namespace(
30269
30370
  name="local"
30270
30371
  )
@@ -31539,31 +31640,20 @@ class TaskDefinition(
31539
31640
 
31540
31641
  Example::
31541
31642
 
31542
- # task_definition: ecs.TaskDefinition
31543
31643
  # cluster: ecs.Cluster
31644
+ # task_definition: ecs.TaskDefinition
31645
+ # vpc: ec2.Vpc
31544
31646
 
31647
+ service = ecs.FargateService(self, "Service", cluster=cluster, task_definition=task_definition)
31545
31648
 
31546
- # Add a container to the task definition
31547
- specific_container = task_definition.add_container("Container",
31548
- image=ecs.ContainerImage.from_registry("/aws/aws-example-app"),
31549
- memory_limit_mi_b=2048
31550
- )
31551
-
31552
- # Add a port mapping
31553
- specific_container.add_port_mappings(
31554
- container_port=7600,
31555
- protocol=ecs.Protocol.TCP
31556
- )
31557
-
31558
- ecs.Ec2Service(self, "Service",
31559
- cluster=cluster,
31560
- task_definition=task_definition,
31561
- cloud_map_options=ecs.CloudMapOptions(
31562
- # Create SRV records - useful for bridge networking
31563
- dns_record_type=cloudmap.DnsRecordType.SRV,
31564
- # Targets port TCP port 7600 `specificContainer`
31565
- container=specific_container,
31566
- container_port=7600
31649
+ lb = elbv2.ApplicationLoadBalancer(self, "LB", vpc=vpc, internet_facing=True)
31650
+ listener = lb.add_listener("Listener", port=80)
31651
+ service.register_load_balancer_targets(
31652
+ container_name="web",
31653
+ container_port=80,
31654
+ new_target_group_id="ECS",
31655
+ listener=ecs.ListenerConfig.application_listener(listener,
31656
+ protocol=elbv2.ApplicationProtocol.HTTPS
31567
31657
  )
31568
31658
  )
31569
31659
  '''
@@ -31665,6 +31755,7 @@ class TaskDefinition(
31665
31755
  *,
31666
31756
  compatibility: typing.Optional[Compatibility] = None,
31667
31757
  task_definition_arn: builtins.str,
31758
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
31668
31759
  network_mode: typing.Optional[NetworkMode] = None,
31669
31760
  task_role: typing.Optional[_IRole_235f5d8e] = None,
31670
31761
  ) -> ITaskDefinition:
@@ -31674,6 +31765,7 @@ class TaskDefinition(
31674
31765
  :param id: -
31675
31766
  :param compatibility: What launch types this task definition should be compatible with. Default: Compatibility.EC2_AND_FARGATE
31676
31767
  :param task_definition_arn: The arn of the task definition.
31768
+ :param execution_role: The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. Some tasks do not have an execution role. Default: - undefined
31677
31769
  :param network_mode: The networking mode to use for the containers in the task. Default: Network mode cannot be provided to the imported task.
31678
31770
  :param task_role: The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. Default: Permissions cannot be granted to the imported task.
31679
31771
  '''
@@ -31684,6 +31776,7 @@ class TaskDefinition(
31684
31776
  attrs = TaskDefinitionAttributes(
31685
31777
  compatibility=compatibility,
31686
31778
  task_definition_arn=task_definition_arn,
31779
+ execution_role=execution_role,
31687
31780
  network_mode=network_mode,
31688
31781
  task_role=task_role,
31689
31782
  )
@@ -32182,6 +32275,7 @@ class TaskDefinition(
32182
32275
  jsii_struct_bases=[CommonTaskDefinitionAttributes],
32183
32276
  name_mapping={
32184
32277
  "task_definition_arn": "taskDefinitionArn",
32278
+ "execution_role": "executionRole",
32185
32279
  "network_mode": "networkMode",
32186
32280
  "task_role": "taskRole",
32187
32281
  "compatibility": "compatibility",
@@ -32192,6 +32286,7 @@ class TaskDefinitionAttributes(CommonTaskDefinitionAttributes):
32192
32286
  self,
32193
32287
  *,
32194
32288
  task_definition_arn: builtins.str,
32289
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
32195
32290
  network_mode: typing.Optional[NetworkMode] = None,
32196
32291
  task_role: typing.Optional[_IRole_235f5d8e] = None,
32197
32292
  compatibility: typing.Optional[Compatibility] = None,
@@ -32199,6 +32294,7 @@ class TaskDefinitionAttributes(CommonTaskDefinitionAttributes):
32199
32294
  '''A reference to an existing task definition.
32200
32295
 
32201
32296
  :param task_definition_arn: The arn of the task definition.
32297
+ :param execution_role: The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. Some tasks do not have an execution role. Default: - undefined
32202
32298
  :param network_mode: The networking mode to use for the containers in the task. Default: Network mode cannot be provided to the imported task.
32203
32299
  :param task_role: The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. Default: Permissions cannot be granted to the imported task.
32204
32300
  :param compatibility: What launch types this task definition should be compatible with. Default: Compatibility.EC2_AND_FARGATE
@@ -32219,6 +32315,7 @@ class TaskDefinitionAttributes(CommonTaskDefinitionAttributes):
32219
32315
 
32220
32316
  # the properties below are optional
32221
32317
  compatibility=ecs.Compatibility.EC2,
32318
+ execution_role=role,
32222
32319
  network_mode=ecs.NetworkMode.NONE,
32223
32320
  task_role=role
32224
32321
  )
@@ -32226,12 +32323,15 @@ class TaskDefinitionAttributes(CommonTaskDefinitionAttributes):
32226
32323
  if __debug__:
32227
32324
  type_hints = typing.get_type_hints(_typecheckingstub__723c7f01009409e12e945705433183d486be735607b50d3b8dd0ec765a5e03e3)
32228
32325
  check_type(argname="argument task_definition_arn", value=task_definition_arn, expected_type=type_hints["task_definition_arn"])
32326
+ check_type(argname="argument execution_role", value=execution_role, expected_type=type_hints["execution_role"])
32229
32327
  check_type(argname="argument network_mode", value=network_mode, expected_type=type_hints["network_mode"])
32230
32328
  check_type(argname="argument task_role", value=task_role, expected_type=type_hints["task_role"])
32231
32329
  check_type(argname="argument compatibility", value=compatibility, expected_type=type_hints["compatibility"])
32232
32330
  self._values: typing.Dict[builtins.str, typing.Any] = {
32233
32331
  "task_definition_arn": task_definition_arn,
32234
32332
  }
32333
+ if execution_role is not None:
32334
+ self._values["execution_role"] = execution_role
32235
32335
  if network_mode is not None:
32236
32336
  self._values["network_mode"] = network_mode
32237
32337
  if task_role is not None:
@@ -32246,6 +32346,17 @@ class TaskDefinitionAttributes(CommonTaskDefinitionAttributes):
32246
32346
  assert result is not None, "Required property 'task_definition_arn' is missing"
32247
32347
  return typing.cast(builtins.str, result)
32248
32348
 
32349
+ @builtins.property
32350
+ def execution_role(self) -> typing.Optional[_IRole_235f5d8e]:
32351
+ '''The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf.
32352
+
32353
+ Some tasks do not have an execution role.
32354
+
32355
+ :default: - undefined
32356
+ '''
32357
+ result = self._values.get("execution_role")
32358
+ return typing.cast(typing.Optional[_IRole_235f5d8e], result)
32359
+
32249
32360
  @builtins.property
32250
32361
  def network_mode(self) -> typing.Optional[NetworkMode]:
32251
32362
  '''The networking mode to use for the containers in the task.
@@ -33466,6 +33577,7 @@ class AssetImage(
33466
33577
 
33467
33578
  Example::
33468
33579
 
33580
+ from constructs import Construct
33469
33581
  from aws_cdk import App, Stack
33470
33582
  import aws_cdk.aws_ec2 as ec2
33471
33583
  import aws_cdk.aws_ecs as ecs
@@ -33473,20 +33585,21 @@ class AssetImage(
33473
33585
  import aws_cdk.cx_api as cxapi
33474
33586
  import path as path
33475
33587
 
33476
- app = App()
33588
+ class MyStack(Stack):
33589
+ def __init__(self, scope, id):
33590
+ super().__init__(scope, id)
33477
33591
 
33478
- stack = Stack(app, "aws-ecs-patterns-queue")
33479
- stack.node.set_context(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, True)
33592
+ self.node.set_context(cxapi.ECS_REMOVE_DEFAULT_DESIRED_COUNT, True)
33480
33593
 
33481
- vpc = ec2.Vpc(stack, "VPC",
33482
- max_azs=2
33483
- )
33594
+ vpc = ec2.Vpc(self, "VPC",
33595
+ max_azs=2
33596
+ )
33484
33597
 
33485
- ecs_patterns.QueueProcessingFargateService(stack, "QueueProcessingService",
33486
- vpc=vpc,
33487
- memory_limit_mi_b=512,
33488
- image=ecs.AssetImage(path.join(__dirname, "..", "sqs-reader"))
33489
- )
33598
+ ecs_patterns.QueueProcessingFargateService(self, "QueueProcessingService",
33599
+ vpc=vpc,
33600
+ memory_limit_mi_b=512,
33601
+ image=ecs.AssetImage(path.join(__dirname, "..", "sqs-reader"))
33602
+ )
33490
33603
  '''
33491
33604
 
33492
33605
  def __init__(
@@ -34904,7 +35017,6 @@ class BaseService(
34904
35017
 
34905
35018
  Example::
34906
35019
 
34907
- # Example automatically generated from non-compiling source. May contain errors.
34908
35020
  import aws_cdk.aws_ecs as ecs
34909
35021
 
34910
35022
 
@@ -35739,6 +35851,7 @@ class Ec2TaskDefinition(
35739
35851
  id: builtins.str,
35740
35852
  *,
35741
35853
  task_definition_arn: builtins.str,
35854
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
35742
35855
  network_mode: typing.Optional[NetworkMode] = None,
35743
35856
  task_role: typing.Optional[_IRole_235f5d8e] = None,
35744
35857
  ) -> IEc2TaskDefinition:
@@ -35747,6 +35860,7 @@ class Ec2TaskDefinition(
35747
35860
  :param scope: -
35748
35861
  :param id: -
35749
35862
  :param task_definition_arn: The arn of the task definition.
35863
+ :param execution_role: The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. Some tasks do not have an execution role. Default: - undefined
35750
35864
  :param network_mode: The networking mode to use for the containers in the task. Default: Network mode cannot be provided to the imported task.
35751
35865
  :param task_role: The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. Default: Permissions cannot be granted to the imported task.
35752
35866
  '''
@@ -35756,6 +35870,7 @@ class Ec2TaskDefinition(
35756
35870
  check_type(argname="argument id", value=id, expected_type=type_hints["id"])
35757
35871
  attrs = Ec2TaskDefinitionAttributes(
35758
35872
  task_definition_arn=task_definition_arn,
35873
+ execution_role=execution_role,
35759
35874
  network_mode=network_mode,
35760
35875
  task_role=task_role,
35761
35876
  )
@@ -36137,6 +36252,7 @@ class ExternalTaskDefinition(
36137
36252
  id: builtins.str,
36138
36253
  *,
36139
36254
  task_definition_arn: builtins.str,
36255
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
36140
36256
  network_mode: typing.Optional[NetworkMode] = None,
36141
36257
  task_role: typing.Optional[_IRole_235f5d8e] = None,
36142
36258
  ) -> IExternalTaskDefinition:
@@ -36145,6 +36261,7 @@ class ExternalTaskDefinition(
36145
36261
  :param scope: -
36146
36262
  :param id: -
36147
36263
  :param task_definition_arn: The arn of the task definition.
36264
+ :param execution_role: The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. Some tasks do not have an execution role. Default: - undefined
36148
36265
  :param network_mode: The networking mode to use for the containers in the task. Default: Network mode cannot be provided to the imported task.
36149
36266
  :param task_role: The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. Default: Permissions cannot be granted to the imported task.
36150
36267
  '''
@@ -36154,6 +36271,7 @@ class ExternalTaskDefinition(
36154
36271
  check_type(argname="argument id", value=id, expected_type=type_hints["id"])
36155
36272
  attrs = ExternalTaskDefinitionAttributes(
36156
36273
  task_definition_arn=task_definition_arn,
36274
+ execution_role=execution_role,
36157
36275
  network_mode=network_mode,
36158
36276
  task_role=task_role,
36159
36277
  )
@@ -36437,6 +36555,7 @@ class FargateTaskDefinition(
36437
36555
  id: builtins.str,
36438
36556
  *,
36439
36557
  task_definition_arn: builtins.str,
36558
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
36440
36559
  network_mode: typing.Optional[NetworkMode] = None,
36441
36560
  task_role: typing.Optional[_IRole_235f5d8e] = None,
36442
36561
  ) -> IFargateTaskDefinition:
@@ -36445,6 +36564,7 @@ class FargateTaskDefinition(
36445
36564
  :param scope: -
36446
36565
  :param id: -
36447
36566
  :param task_definition_arn: The arn of the task definition.
36567
+ :param execution_role: The IAM role that grants containers and Fargate agents permission to make AWS API calls on your behalf. Some tasks do not have an execution role. Default: - undefined
36448
36568
  :param network_mode: The networking mode to use for the containers in the task. Default: Network mode cannot be provided to the imported task.
36449
36569
  :param task_role: The name of the IAM role that grants containers in the task permission to call AWS APIs on your behalf. Default: Permissions cannot be granted to the imported task.
36450
36570
  '''
@@ -36454,6 +36574,7 @@ class FargateTaskDefinition(
36454
36574
  check_type(argname="argument id", value=id, expected_type=type_hints["id"])
36455
36575
  attrs = FargateTaskDefinitionAttributes(
36456
36576
  task_definition_arn=task_definition_arn,
36577
+ execution_role=execution_role,
36457
36578
  network_mode=network_mode,
36458
36579
  task_role=task_role,
36459
36580
  )
@@ -38218,6 +38339,7 @@ def _typecheckingstub__8819884fed76c2873e86d47e66faba011202f5d697aa512d17a66e595
38218
38339
  def _typecheckingstub__1a458c1ea772685ddb7eb49b075e7de9bed322fac4bbee8aeab1cf6b576bc995(
38219
38340
  *,
38220
38341
  task_definition_arn: builtins.str,
38342
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
38221
38343
  network_mode: typing.Optional[NetworkMode] = None,
38222
38344
  task_role: typing.Optional[_IRole_235f5d8e] = None,
38223
38345
  ) -> None:
@@ -38599,6 +38721,7 @@ def _typecheckingstub__95634258086aa3448fbdfd9896017a2cbeb858f382deb61186bb9e22b
38599
38721
  def _typecheckingstub__e90e61a002f578b0dbe160c067f2d3de15287892110df7eedcbbfa7f0c7d391d(
38600
38722
  *,
38601
38723
  task_definition_arn: builtins.str,
38724
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
38602
38725
  network_mode: typing.Optional[NetworkMode] = None,
38603
38726
  task_role: typing.Optional[_IRole_235f5d8e] = None,
38604
38727
  ) -> None:
@@ -38776,6 +38899,7 @@ def _typecheckingstub__3cc413964caae89bfcfbcabff8356ffe5c054f46824be99731a77b64e
38776
38899
  def _typecheckingstub__2d58078e68b889d5f10f95714f42385491c26bf6ec084584b1a1487cc3acf7a2(
38777
38900
  *,
38778
38901
  task_definition_arn: builtins.str,
38902
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
38779
38903
  network_mode: typing.Optional[NetworkMode] = None,
38780
38904
  task_role: typing.Optional[_IRole_235f5d8e] = None,
38781
38905
  ) -> None:
@@ -38831,6 +38955,7 @@ def _typecheckingstub__8290283f61f3e2d289b7e7f81cad1a5d1e9ed9dbc07ccce2b57604682
38831
38955
  def _typecheckingstub__5dd329152ba42239c8e48630ce2d0477a28dd88014af62f4536ef752f002010e(
38832
38956
  *,
38833
38957
  task_definition_arn: builtins.str,
38958
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
38834
38959
  network_mode: typing.Optional[NetworkMode] = None,
38835
38960
  task_role: typing.Optional[_IRole_235f5d8e] = None,
38836
38961
  ) -> None:
@@ -39641,6 +39766,7 @@ def _typecheckingstub__33efccb48f741fbca68f3379a33fab8d93a2872fc8c2a118c9704894b
39641
39766
  *,
39642
39767
  compatibility: typing.Optional[Compatibility] = None,
39643
39768
  task_definition_arn: builtins.str,
39769
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
39644
39770
  network_mode: typing.Optional[NetworkMode] = None,
39645
39771
  task_role: typing.Optional[_IRole_235f5d8e] = None,
39646
39772
  ) -> None:
@@ -39779,6 +39905,7 @@ def _typecheckingstub__9a9f5e275c7ec18083bd47fd70c94d0dee80deddee22c30c6ef86cb08
39779
39905
  def _typecheckingstub__723c7f01009409e12e945705433183d486be735607b50d3b8dd0ec765a5e03e3(
39780
39906
  *,
39781
39907
  task_definition_arn: builtins.str,
39908
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
39782
39909
  network_mode: typing.Optional[NetworkMode] = None,
39783
39910
  task_role: typing.Optional[_IRole_235f5d8e] = None,
39784
39911
  compatibility: typing.Optional[Compatibility] = None,
@@ -40260,6 +40387,7 @@ def _typecheckingstub__d794d0fc9ba23db2d5f4c804346c25e9732a8bd6c40b66b459e4b0596
40260
40387
  id: builtins.str,
40261
40388
  *,
40262
40389
  task_definition_arn: builtins.str,
40390
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
40263
40391
  network_mode: typing.Optional[NetworkMode] = None,
40264
40392
  task_role: typing.Optional[_IRole_235f5d8e] = None,
40265
40393
  ) -> None:
@@ -40357,6 +40485,7 @@ def _typecheckingstub__ccd4d51c36358a0ea1efb52a38fa0bccb9e2db43ee7dc217a32ca2bf2
40357
40485
  id: builtins.str,
40358
40486
  *,
40359
40487
  task_definition_arn: builtins.str,
40488
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
40360
40489
  network_mode: typing.Optional[NetworkMode] = None,
40361
40490
  task_role: typing.Optional[_IRole_235f5d8e] = None,
40362
40491
  ) -> None:
@@ -40439,6 +40568,7 @@ def _typecheckingstub__59be62eab8487bb224b6839e6560b22ec29653bf5f8e319f85996fa99
40439
40568
  id: builtins.str,
40440
40569
  *,
40441
40570
  task_definition_arn: builtins.str,
40571
+ execution_role: typing.Optional[_IRole_235f5d8e] = None,
40442
40572
  network_mode: typing.Optional[NetworkMode] = None,
40443
40573
  task_role: typing.Optional[_IRole_235f5d8e] = None,
40444
40574
  ) -> None: