aws-cdk-lib.aws_ecs.ExternalServiceProps

interface ExternalServiceProps

LanguageType name
.NETAmazon.CDK.AWS.ECS.ExternalServiceProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecs#ExternalServiceProps
Javasoftware.amazon.awscdk.services.ecs.ExternalServiceProps
Pythonaws_cdk.aws_ecs.ExternalServiceProps
TypeScript (source)aws-cdk-lib » aws_ecs » ExternalServiceProps

The properties for defining a service using the External launch type.

Example

declare const cluster: ecs.Cluster;
declare const taskDefinition: ecs.TaskDefinition;

const service = new ecs.ExternalService(this, 'Service', {
  cluster,
  taskDefinition,
  desiredCount: 5,
});

Properties

NameTypeDescription
clusterIClusterThe name of the cluster that hosts the service.
taskDefinitionTaskDefinitionThe task definition to use for tasks in the service.
capacityProviderStrategies?CapacityProviderStrategy[]A list of Capacity Provider strategies used to place a service.
circuitBreaker?DeploymentCircuitBreakerWhether to enable the deployment circuit breaker.
cloudMapOptions?CloudMapOptionsThe options for configuring an Amazon ECS service to use service discovery.
deploymentAlarms?DeploymentAlarmConfigThe alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time.
deploymentController?DeploymentControllerSpecifies which deployment controller to use for the service.
desiredCount?numberThe desired number of instantiations of the task definition to keep running on the service.
enableECSManagedTags?booleanSpecifies whether to enable Amazon ECS managed tags for the tasks within the service.
enableExecuteCommand?booleanWhether to enable the ability to execute into a container.
healthCheckGracePeriod?DurationThe 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.
maxHealthyPercent?numberThe 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.
minHealthyPercent?numberThe 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.
propagateTags?PropagatedTagSourceSpecifies whether to propagate the tags from the task definition or the service to the tasks in the service.
securityGroups?ISecurityGroup[]The security groups to associate with the service.
serviceConnectConfiguration?ServiceConnectPropsConfiguration for Service Connect.
serviceName?stringThe name of the service.

cluster

Type: ICluster

The name of the cluster that hosts the service.


taskDefinition

Type: TaskDefinition

The task definition to use for tasks in the service.

[disable-awslint:ref-via-interface]


capacityProviderStrategies?

Type: CapacityProviderStrategy[] (optional, default: undefined)

A list of Capacity Provider strategies used to place a service.


circuitBreaker?

Type: DeploymentCircuitBreaker (optional, default: disabled)

Whether to enable the deployment circuit breaker.

If this property is defined, circuit breaker will be implicitly enabled.


cloudMapOptions?

Type: CloudMapOptions (optional, default: AWS Cloud Map service discovery is not enabled.)

The options for configuring an Amazon ECS service to use service discovery.


deploymentAlarms?

Type: DeploymentAlarmConfig (optional, default: No alarms will be monitored during deployment.)

The alarm(s) to monitor during deployment, and behavior to apply if at least one enters a state of alarm during the deployment or bake time.


deploymentController?

Type: DeploymentController (optional, default: Rolling update (ECS))

Specifies which deployment controller to use for the service.

For more information, see Amazon ECS Deployment Types


desiredCount?

Type: number (optional, default: When creating the service, default is 1; when updating the service, default uses the current task number.)

The desired number of instantiations of the task definition to keep running on the service.


enableECSManagedTags?

Type: boolean (optional, default: false)

Specifies whether to enable Amazon ECS managed tags for the tasks within the service.

For more information, see Tagging Your Amazon ECS Resources


enableExecuteCommand?

Type: boolean (optional, default: undefined)

Whether to enable the ability to execute into a container.


healthCheckGracePeriod?

Type: Duration (optional, default: defaults to 60 seconds if at least one load balancer is in-use and it is not already set)

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.


maxHealthyPercent?

Type: number (optional, default: 100 if daemon, otherwise 200)

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.


minHealthyPercent?

Type: number (optional, default: 0 if daemon, otherwise 50)

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.


propagateTags?

Type: PropagatedTagSource (optional, default: PropagatedTagSource.NONE)

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


securityGroups?

Type: ISecurityGroup[] (optional, default: A new security group is created.)

The security groups to associate with the service.

If you do not specify a security group, a new security group is created.


serviceConnectConfiguration?

Type: ServiceConnectProps (optional, default: No ports are advertised via Service Connect on this service, and the service cannot make requests to other services via Service Connect.)

Configuration for Service Connect.


serviceName?

Type: string (optional, default: CloudFormation-generated name.)

The name of the service.