FargateServiceProps¶
-
class
aws_cdk.aws_ecs.
FargateServiceProps
(*, cluster, capacity_provider_strategies=None, circuit_breaker=None, cloud_map_options=None, deployment_controller=None, desired_count=None, enable_ecs_managed_tags=None, health_check_grace_period=None, max_healthy_percent=None, min_healthy_percent=None, propagate_tags=None, service_name=None, task_definition, assign_public_ip=None, platform_version=None, propagate_task_tags_from=None, security_group=None, security_groups=None, vpc_subnets=None)¶ Bases:
aws_cdk.aws_ecs.BaseServiceOptions
The properties for defining a service using the Fargate launch type.
- Parameters
cluster (
ICluster
) – The name of the cluster that hosts the service.capacity_provider_strategies (
Optional
[Sequence
[CapacityProviderStrategy
]]) – A list of Capacity Provider strategies used to place a service. Default: - undefinedcircuit_breaker (
Optional
[DeploymentCircuitBreaker
]) – Whether to enable the deployment circuit breaker. If this property is defined, circuit breaker will be implicitly enabled. Default: - disabledcloud_map_options (
Optional
[CloudMapOptions
]) – The options for configuring an Amazon ECS service to use service discovery. Default: - AWS Cloud Map service discovery is not enabled.deployment_controller (
Optional
[DeploymentController
]) – Specifies which deployment controller to use for the service. For more information, see Amazon ECS Deployment Types Default: - Rolling update (ECS)desired_count (
Union
[int
,float
,None
]) – The desired number of instantiations of the task definition to keep running on the service. Default: - When creating the service, default is 1; when updating the service, default uses the current task number.enable_ecs_managed_tags (
Optional
[bool
]) – Specifies whether to enable Amazon ECS managed tags for the tasks within the service. For more information, see Tagging Your Amazon ECS Resources Default: falsehealth_check_grace_period (
Optional
[Duration
]) – The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started. Default: - defaults to 60 seconds if at least one load balancer is in-use and it is not already setmax_healthy_percent (
Union
[int
,float
,None
]) – The maximum number of tasks, specified as a percentage of the Amazon ECS service’s DesiredCount value, that can run in a service during a deployment. Default: - 100 if daemon, otherwise 200min_healthy_percent (
Union
[int
,float
,None
]) – The minimum number of tasks, specified as a percentage of the Amazon ECS service’s DesiredCount value, that must continue to run and remain healthy during a deployment. Default: - 0 if daemon, otherwise 50propagate_tags (
Optional
[PropagatedTagSource
]) – Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE Default: PropagatedTagSource.NONEservice_name (
Optional
[str
]) – The name of the service. Default: - CloudFormation-generated name.task_definition (
TaskDefinition
) – The task definition to use for tasks in the service. [disable-awslint:ref-via-interface]assign_public_ip (
Optional
[bool
]) – Specifies whether the task’s elastic network interface receives a public IP address. If true, each task will receive a public IP address. Default: falseplatform_version (
Optional
[FargatePlatformVersion
]) – The platform version on which to run your service. If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide. Default: Latestpropagate_task_tags_from (
Optional
[PropagatedTagSource
]) – (deprecated) Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. Tags can only be propagated to the tasks within the service during service creation. Default: PropagatedTagSource.NONEsecurity_group (
Optional
[ISecurityGroup
]) – (deprecated) The security groups to associate with the service. If you do not specify a security group, the default security group for the VPC is used. Default: - A new security group is created.security_groups (
Optional
[Sequence
[ISecurityGroup
]]) – The security groups to associate with the service. If you do not specify a security group, the default security group for the VPC is used. Default: - A new security group is created.vpc_subnets (
Optional
[SubnetSelection
]) – The subnets to associate with the service. Default: - Public subnets ifassignPublicIp
is set, otherwise the first available one of Private, Isolated, Public, in that order.
Attributes
-
assign_public_ip
¶ Specifies whether the task’s elastic network interface receives a public IP address.
If true, each task will receive a public IP address.
- Default
false
- Return type
Optional
[bool
]
-
capacity_provider_strategies
¶ A list of Capacity Provider strategies used to place a service.
- Default
undefined
- Return type
Optional
[List
[CapacityProviderStrategy
]]
-
circuit_breaker
¶ Whether to enable the deployment circuit breaker.
If this property is defined, circuit breaker will be implicitly enabled.
- Default
disabled
- Return type
Optional
[DeploymentCircuitBreaker
]
-
cloud_map_options
¶ The options for configuring an Amazon ECS service to use service discovery.
- Default
AWS Cloud Map service discovery is not enabled.
- Return type
Optional
[CloudMapOptions
]
-
deployment_controller
¶ Specifies which deployment controller to use for the service.
For more information, see Amazon ECS Deployment Types
- Default
Rolling update (ECS)
- Return type
Optional
[DeploymentController
]
-
desired_count
¶ The desired number of instantiations of the task definition to keep running on the service.
- Default
When creating the service, default is 1; when updating the service, default uses
the current task number.
- Return type
Union
[int
,float
,None
]
Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
For more information, see Tagging Your Amazon ECS Resources
- Default
false
- Return type
Optional
[bool
]
-
health_check_grace_period
¶ The period of time, in seconds, that the Amazon ECS service scheduler ignores unhealthy Elastic Load Balancing target health checks after a task has first started.
- Default
defaults to 60 seconds if at least one load balancer is in-use and it is not already set
- Return type
Optional
[Duration
]
-
max_healthy_percent
¶ The maximum number of tasks, specified as a percentage of the Amazon ECS service’s DesiredCount value, that can run in a service during a deployment.
- Default
100 if daemon, otherwise 200
- Return type
Union
[int
,float
,None
]
-
min_healthy_percent
¶ The minimum number of tasks, specified as a percentage of the Amazon ECS service’s DesiredCount value, that must continue to run and remain healthy during a deployment.
- Default
0 if daemon, otherwise 50
- Return type
Union
[int
,float
,None
]
-
platform_version
¶ The platform version on which to run your service.
If one is not specified, the LATEST platform version is used by default. For more information, see AWS Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.
- Default
Latest
- Return type
Optional
[FargatePlatformVersion
]
Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.
Valid values are: PropagatedTagSource.SERVICE, PropagatedTagSource.TASK_DEFINITION or PropagatedTagSource.NONE
- Default
PropagatedTagSource.NONE
- Return type
Optional
[PropagatedTagSource
]
(deprecated) Specifies whether to propagate the tags from the task definition or the service to the tasks in the service.
Tags can only be propagated to the tasks within the service during service creation.
- Default
PropagatedTagSource.NONE
- Deprecated
Use
propagateTags
instead.- Stability
deprecated
- Return type
Optional
[PropagatedTagSource
]
-
security_group
¶ (deprecated) The security groups to associate with the service.
If you do not specify a security group, the default security group for the VPC is used.
- Default
A new security group is created.
- Deprecated
use securityGroups instead.
- Stability
deprecated
- Return type
Optional
[ISecurityGroup
]
-
security_groups
¶ The security groups to associate with the service.
If you do not specify a security group, the default security group for the VPC is used.
- Default
A new security group is created.
- Return type
Optional
[List
[ISecurityGroup
]]
-
service_name
¶ The name of the service.
- Default
CloudFormation-generated name.
- Return type
Optional
[str
]
-
task_definition
¶ The task definition to use for tasks in the service.
[disable-awslint:ref-via-interface]
- Return type
-
vpc_subnets
¶ The subnets to associate with the service.
- Default
Public subnets if
assignPublicIp
is set, otherwise the first available one of Private, Isolated, Public, in that order.
- Return type
Optional
[SubnetSelection
]