Skip to content
v2.273.0

ExternalServiceProps Struct ​

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

Example ​

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

new ecs.Ec2Service(this, 'Ec2Service', {
  cluster,
  taskDefinition,
  daemon: true,
});

new ecs.ExternalService(this, 'ExternalService', {
  cluster,
  taskDefinition,
  daemon: true,
});

Properties ​

bakeTimeDurationbake_timeDurationbakeTimeDurationBakeTimeDurationBakeTimeDuration= none#
bake time minutes for service.
canaryConfigurationTrafficShiftConfigcanary_configurationTrafficShiftConfigcanaryConfigurationTrafficShiftConfigCanaryConfigurationTrafficShiftConfigCanaryConfigurationTrafficShiftConfig= no canary configuration#
Configuration for canary deployment strategy.

Only valid when deploymentStrategy is set to CANARY.

capacityProviderStrategiesCapacityProviderStrategy[]capacity_provider_strategiestyping.List[CapacityProviderStrategy]capacityProviderStrategiesList<CapacityProviderStrategy>CapacityProviderStrategiesCapacityProviderStrategy[]CapacityProviderStrategies*[]CapacityProviderStrategy= undefined#
A list of Capacity Provider strategies used to place a service.
circuitBreakerDeploymentCircuitBreakercircuit_breakerDeploymentCircuitBreakercircuitBreakerDeploymentCircuitBreakerCircuitBreakerDeploymentCircuitBreakerCircuitBreakerDeploymentCircuitBreaker= disabled#
Whether to enable the deployment circuit breaker.

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

cloudMapOptionsCloudMapOptionscloud_map_optionsCloudMapOptionscloudMapOptionsCloudMapOptionsCloudMapOptionsCloudMapOptionsCloudMapOptionsCloudMapOptions= AWS Cloud Map service discovery …#
The options for configuring an Amazon ECS service to use service discovery.
default

Default: AWS Cloud Map service discovery is not enabled.

clusterIClusterclusterIClusterclusterIClusterClusterIClusterClusterIClusterrequired#
The name of the cluster that hosts the service.
daemonbooleandaemonbooldaemonBooleanDaemonboolDaemon*bool= false#
By default, service use REPLICA scheduling strategy, this parameter enable DAEMON scheduling strategy.
notes

If true, the service scheduler deploys exactly one task on each container instance in your cluster.

When you are using this strategy, do not specify a desired number of tasks or any task placement strategies. Tasks using the Fargate launch type or the CODE_DEPLOY or EXTERNAL deployment controller types don't support the DAEMON scheduling strategy.

deploymentAlarmsDeploymentAlarmConfigdeployment_alarmsDeploymentAlarmConfigdeploymentAlarmsDeploymentAlarmConfigDeploymentAlarmsDeploymentAlarmConfigDeploymentAlarmsDeploymentAlarmConfig= No alarms will be monitored duri…#
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.
default

Default: No alarms will be monitored during deployment.

deploymentControllerDeploymentControllerdeployment_controllerDeploymentControllerdeploymentControllerDeploymentControllerDeploymentControllerDeploymentControllerDeploymentControllerDeploymentController= Rolling update (ECS)#
Specifies which deployment controller to use for the service.

For more information, see Amazon ECS Deployment Types

deploymentStrategyDeploymentStrategydeployment_strategyDeploymentStrategydeploymentStrategyDeploymentStrategyDeploymentStrategyDeploymentStrategyDeploymentStrategyDeploymentStrategy= ROLLING#
The deployment strategy to use for the service.
desiredCountnumberdesired_countint | floatdesiredCountNumberDesiredCountdoubleDesiredCount*float64= When creating the service, defau…#
The desired number of instantiations of the task definition to keep running on the service.
default

Default: When creating the service, default is 1; when updating the service, default uses the current task number.

enableECSManagedTagsbooleanenable_ecs_managed_tagsboolenableECSManagedTagsBooleanEnableECSManagedTagsboolEnableECSManagedTags*bool= false#
Specifies whether to enable Amazon ECS managed tags for the tasks within the service.

For more information, see Tagging Your Amazon ECS Resources

enableExecuteCommandbooleanenable_execute_commandboolenableExecuteCommandBooleanEnableExecuteCommandboolEnableExecuteCommand*bool= undefined#
Whether to enable the ability to execute into a container.
forceNewDeploymentForceNewDeploymentforce_new_deploymentForceNewDeploymentforceNewDeploymentForceNewDeploymentForceNewDeploymentForceNewDeploymentForceNewDeploymentForceNewDeployment= no forced deployment#
Configuration for forcing a new deployment of the service.
notes

By default, deployments aren't forced. You can use this option to start a new deployment with no service definition changes. For example, you can update a service's tasks to use a newer Docker image with the same image/tag combination (my_image:latest) or to roll Fargate tasks onto a newer platform version.

This is equivalent to calling the forceNewDeployment() method, but allows you to configure it declaratively at construction time, including the ability to explicitly disable it with enabled: false.

healthCheckGracePeriodDurationhealth_check_grace_periodDurationhealthCheckGracePeriodDurationHealthCheckGracePeriodDurationHealthCheckGracePeriodDuration= defaults to 60 seconds if at lea…#
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

Default: defaults to 60 seconds if at least one load balancer is in-use and it is not already set

lifecycleHooksIDeploymentLifecycleHookTarget[]lifecycle_hookstyping.List[IDeploymentLifecycleHookTarget]lifecycleHooksList<IDeploymentLifecycleHookTarget>LifecycleHooksIDeploymentLifecycleHookTarget[]LifecycleHooks*[]IDeploymentLifecycleHookTarget= none;#
The lifecycle hooks to execute during deployment stages.
linearConfigurationTrafficShiftConfiglinear_configurationTrafficShiftConfiglinearConfigurationTrafficShiftConfigLinearConfigurationTrafficShiftConfigLinearConfigurationTrafficShiftConfig= no linear configuration#
Configuration for linear deployment strategy.

Only valid when deploymentStrategy is set to LINEAR.

maxHealthyPercentnumbermax_healthy_percentint | floatmaxHealthyPercentNumberMaxHealthyPercentdoubleMaxHealthyPercent*float64= 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.
minHealthyPercentnumbermin_healthy_percentint | floatminHealthyPercentNumberMinHealthyPercentdoubleMinHealthyPercent*float64= 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.
propagateTagsPropagatedTagSourcepropagate_tagsPropagatedTagSourcepropagateTagsPropagatedTagSourcePropagateTagsPropagatedTagSourcePropagateTagsPropagatedTagSource= 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

securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= 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.

serviceConnectConfigurationServiceConnectPropsservice_connect_configurationServiceConnectPropsserviceConnectConfigurationServiceConnectPropsServiceConnectConfigurationServiceConnectPropsServiceConnectConfigurationServiceConnectProps= No ports are advertised via Serv…#
Configuration for Service Connect.
default

Default: No ports are advertised via Service Connect on this service, and the service cannot make requests to other services via Service Connect.

serviceNamestringservice_namestrserviceNameStringServiceNamestringServiceName*string= CloudFormation-generated name.#
The name of the service.
taskDefinitionTaskDefinitiontask_definitionTaskDefinitiontaskDefinitionTaskDefinitionTaskDefinitionTaskDefinitionTaskDefinitionTaskDefinitionrequired#
The task definition to use for tasks in the service.

[disable-awslint:ref-via-interface]

taskDefinitionRevisionTaskDefinitionRevisiontask_definition_revisionTaskDefinitionRevisiontaskDefinitionRevisionTaskDefinitionRevisionTaskDefinitionRevisionTaskDefinitionRevisionTaskDefinitionRevisionTaskDefinitionRevision= Uses the revision of the passed …#
Revision number for the task definition or `latest` to use the latest active task revision.
default

Default: Uses the revision of the passed task definition deployed by CloudFormation

volumeConfigurationsServiceManagedVolume[]volume_configurationstyping.List[ServiceManagedVolume]volumeConfigurationsList<ServiceManagedVolume>VolumeConfigurationsServiceManagedVolume[]VolumeConfigurations*[]ServiceManagedVolume= undefined#
Configuration details for a volume used by the service.

This allows you to specify details about the EBS volume that can be attached to ECS tasks.

Used as props by ​