interface BaseServiceProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ECS.BaseServiceProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#BaseServiceProps |
Java | software.amazon.awscdk.services.ecs.BaseServiceProps |
Python | aws_cdk.aws_ecs.BaseServiceProps |
TypeScript (source) | aws-cdk-lib » aws_ecs » BaseServiceProps |
Complete base service properties that are required to be supplied by the implementation of the BaseService class.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_servicediscovery as servicediscovery } from 'aws-cdk-lib';
declare const cluster: ecs.Cluster;
declare const containerDefinition: ecs.ContainerDefinition;
declare const logDriver: ecs.LogDriver;
declare const namespace: servicediscovery.INamespace;
declare const serviceManagedVolume: ecs.ServiceManagedVolume;
declare const taskDefinitionRevision: ecs.TaskDefinitionRevision;
const baseServiceProps: ecs.BaseServiceProps = {
cluster: cluster,
launchType: ecs.LaunchType.EC2,
// the properties below are optional
capacityProviderStrategies: [{
capacityProvider: 'capacityProvider',
// the properties below are optional
base: 123,
weight: 123,
}],
circuitBreaker: {
enable: false,
rollback: false,
},
cloudMapOptions: {
cloudMapNamespace: namespace,
container: containerDefinition,
containerPort: 123,
dnsRecordType: servicediscovery.DnsRecordType.A,
dnsTtl: cdk.Duration.minutes(30),
failureThreshold: 123,
name: 'name',
},
deploymentAlarms: {
alarmNames: ['alarmNames'],
// the properties below are optional
behavior: ecs.AlarmBehavior.ROLLBACK_ON_ALARM,
},
deploymentController: {
type: ecs.DeploymentControllerType.ECS,
},
desiredCount: 123,
enableECSManagedTags: false,
enableExecuteCommand: false,
healthCheckGracePeriod: cdk.Duration.minutes(30),
maxHealthyPercent: 123,
minHealthyPercent: 123,
propagateTags: ecs.PropagatedTagSource.SERVICE,
serviceConnectConfiguration: {
logDriver: logDriver,
namespace: 'namespace',
services: [{
portMappingName: 'portMappingName',
// the properties below are optional
discoveryName: 'discoveryName',
dnsName: 'dnsName',
idleTimeout: cdk.Duration.minutes(30),
ingressPortOverride: 123,
perRequestTimeout: cdk.Duration.minutes(30),
port: 123,
}],
},
serviceName: 'serviceName',
taskDefinitionRevision: taskDefinitionRevision,
volumeConfigurations: [serviceManagedVolume],
};
Properties
Name | Type | Description |
---|---|---|
cluster | ICluster | The name of the cluster that hosts the service. |
launch | Launch | The launch type on which to run your service. |
capacity | Capacity [] | A list of Capacity Provider strategies used to place a service. |
circuit | Deployment | Whether to enable the deployment circuit breaker. |
cloud | Cloud | The options for configuring an Amazon ECS service to use service discovery. |
deployment | 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. |
deployment | Deployment | Specifies which deployment controller to use for the service. |
desired | number | The desired number of instantiations of the task definition to keep running on the service. |
enable | boolean | Specifies whether to enable Amazon ECS managed tags for the tasks within the service. |
enable | boolean | Whether to enable the ability to execute into a container. |
health | 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. |
max | number | 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. |
min | number | 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. |
propagate | Propagated | Specifies whether to propagate the tags from the task definition or the service to the tasks in the service. |
service | Service | Configuration for Service Connect. |
service | string | The name of the service. |
task | Task | Revision number for the task definition or latest to use the latest active task revision. |
volume | Service [] | Configuration details for a volume used by the service. |
cluster
Type:
ICluster
The name of the cluster that hosts the service.
launchType
Type:
Launch
The launch type on which to run your service.
LaunchType will be omitted if capacity provider strategies are specified on the service.
Valid values are: LaunchType.ECS or LaunchType.FARGATE or LaunchType.EXTERNAL](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-capacityproviderstrategy
Valid values are: LaunchType.ECS or LaunchType.FARGATE or LaunchType.EXTERNAL)
capacityProviderStrategies?
Type:
Capacity
[]
(optional, default: undefined)
A list of Capacity Provider strategies used to place a service.
circuitBreaker?
Type:
Deployment
(optional, default: disabled)
Whether to enable the deployment circuit breaker.
If this property is defined, circuit breaker will be implicitly enabled.
cloudMapOptions?
Type:
Cloud
(optional, default: AWS Cloud Map service discovery is not enabled.)
The options for configuring an Amazon ECS service to use service discovery.
deploymentAlarms?
Type:
Deployment
(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:
Deployment
(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:
Propagated
(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
serviceConnectConfiguration?
Type:
Service
(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.
taskDefinitionRevision?
Type:
Task
(optional, default: Uses the revision of the passed task definition deployed by CloudFormation)
Revision number for the task definition or latest
to use the latest active task revision.
volumeConfigurations?
Type:
Service
[]
(optional, default: undefined)
Configuration details for a volume used by the service.
This allows you to specify details about the EBS volume that can be attched to ECS tasks.