This documentation is for the developer preview release of the AWS CDK. Do not use this version of the AWS CDK in production. Subsequent releases of the AWS CDK will likely include breaking changes.

Amazon ECS

This package contains constructs for working with Amazon Elastic Container Service (Amazon ECS).

Amazon ECS is a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster of Amazon EC2 instances.

For further information on Amazon ECS, see the Amazon ECS documentation

The following example creates an Amazon ECS cluster, adds capacity to it, and instantiates the Amazon ECS Service with an automatic load balancer.

// Create an ECS cluster
const cluster = new ecs.Cluster(this, 'Cluster', {
  vpc,
});

// Add capacity to it
cluster.addDefaultAutoScalingGroupCapacity('Capacity', {
  instanceType: new ec2.InstanceType("t2.xlarge"),
  instanceCount: 3,
});

// Instantiate Amazon ECS Service with an automatic load balancer
const ecsService = new ecs.LoadBalancedEc2Service(this, 'Service', {
  cluster,
  memoryLimitMiB: 512,
  image: ecs.ContainerImage.fromDockerHub("amazon/amazon-ecs-sample"),
});

AWS Fargate vs Amazon ECS

There are two sets of constructs in this library; one to run tasks on Amazon ECS and one to run tasks on AWS Fargate.

  • Use the Ec2TaskDefinition and Ec2Service constructs to run tasks on Amazon EC2 instances running in your account.
  • Use the FargateTaskDefinition and FargateService constructs to run tasks on instances that are managed for you by AWS.

Here are the main differences:

  • Amazon EC2: instances are under your control. Complete control of task to host allocation. Required to specify at least a memory reseration or limit for every container. Can use Host, Bridge and AwsVpc networking modes. Can attach Classic Load Balancer. Can share volumes between container and host.
  • AWS Fargate: tasks run on AWS-managed instances, AWS manages task to host allocation for you. Requires specification of memory and cpu sizes at the taskdefinition level. Only supports AwsVpc networking modes and Application/Network Load Balancers. Only the AWS log driver is supported. Many host features are not supported such as adding kernel capabilities and mounting host devices/volumes inside the container.

For more information on Amazon EC2 vs AWS Fargate and networking see the AWS Documentation: AWS Fargate and Task Networking.

Clusters

A Cluster defines the infrastructure to run your tasks on. You can run many tasks on a single cluster.

The following code creates a cluster that can run AWS Fargate tasks:

const cluster = new ecs.Cluster(this, 'Cluster', {
  vpc: vpc
});

To use tasks with Amazon EC2 launch-type, you have to add capacity to the cluster in order for tasks to be scheduled on your instances. Typically, you add an AutoScalingGroup with instances running the latest Amazon ECS-optimized AMI to the cluster. There is a method to build and add such an AutoScalingGroup automatically, or you can supply a customized AutoScalingGroup that you construct yourself. It’s possible to add multiple AutoScalingGroups with various instance types.

The following example creates an Amazon ECS cluster and adds capacity to it:

const cluster = new ecs.Cluster(this, 'Cluster', {
  vpc: vpc
});

// Either add default capacity
cluster.addDefaultAutoScalingGroupCapacity({
  instanceType: new ec2.InstanceType("t2.xlarge"),
  instanceCount: 3,
});

// Or add customized capacity. Be sure to start the Amazon ECS-optimized AMI.
const autoScalingGroup = new autoscaling.AutoScalingGroup(this, 'ASG', {
  vpc,
  instanceType: new ec2.InstanceType('t2.xlarge'),
  machineImage: new EcsOptimizedAmi(),
  // Or use Amazon ECS-Optimized Amazon Linux 2 AMI
  // machineImage: new EcsOptimizedAmi({ generation: ec2.AmazonLinuxGeneration.AmazonLinux2 }),
  desiredCapacity: 3,
  // ... other options here ...
});

cluster.addAutoScalingGroupCapacity(autoScalingGroup);

Task definitions

A task Definition describes what a single copy of a task should look like. A task definition has one or more containers; typically, it has one main container (the default container is the first one that’s added to the task definition, and it is marked essential) and optionally some supporting containers which are used to support the main container, doings things like upload logs or metrics to monitoring services.

To run a task or service with Amazon EC2 launch type, use the Ec2TaskDefinition. For AWS Fargate tasks/services, use the FargateTaskDefinition. These classes provide a simplified API that only contain properties relevant for that specific launch type.

For a FargateTaskDefinition, specify the task size (memoryMiB and cpu):

const fargateTaskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDef', {
  memoryMiB: '512',
  cpu: '256'
});

To add containers to a task definition, call addContainer():

const container = fargateTaskDefinition.addContainer("WebContainer", {
  // Use an image from DockerHub
  image: ecs.ContainerImage.fromDockerHub("amazon/amazon-ecs-sample"),
  // ... other options here ...
});

For a Ec2TaskDefinition:

const ec2TaskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef', {
  networkMode: bridge
});

const container = ec2TaskDefinition.addContainer("WebContainer", {
  // Use an image from DockerHub
  image: ecs.ContainerImage.fromDockerHub("amazon/amazon-ecs-sample"),
  memoryLimitMiB: 1024
  // ... other options here ...
});

You can specify container properties when you add them to the task definition, or with various methods, e.g.:

container.addPortMappings({
  containerPort: 3000
})

To use a TaskDefinition that can be used with either Amazon EC2 or AWS Fargate launch types, use the TaskDefinition construct.

When creating a task definition you have to specify what kind of tasks you intend to run: Amazon EC2, AWS Fargate, or both. The following example uses both:

const taskDefinition = new ecs.TaskDefinition(this, 'TaskDef', {
  memoryMiB: '512',
  cpu: 256,
  networkMode: 'awsvpc',
  compatibility: ecs.Compatibility.Ec2AndFargate,
});

Images

Images supply the software that runs inside the container. Images can be obtained from either DockerHub or from ECR repositories, or built directly from a local Dockerfile.

  • ecs.ContainerImage.fromDockerHub(imageName): use a publicly available image from DockerHub.
  • ecs.ContainerImage.fromEcrRepository(repo, tag): use the given ECR repository as the image to start. If no tag is provided, “latest” is assumed.
  • ecs.ContainerImage.fromAsset(this, 'Image', { directory: './image' }): build and upload an image directly from a Dockerfile in your source directory.

Service

A Service instantiates a TaskDefinition on a Cluster a given number of times, optionally associating them with a load balancer. If a task fails, Amazon ECS automatically restarts the task.

const taskDefinition;

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

Include a load balancer

Services are load balancing targets and can be directly attached to load balancers:

import elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');

const service = new ecs.FargateService(this, 'Service', { /* ... */ });

const lb = new elbv2.ApplicationLoadBalancer(this, 'LB', { vpc, internetFacing: true });
const listener = lb.addListener('Listener', { port: 80 });
const target = listener.addTargets('ECS', {
  port: 80,
  targets: [service]
});

There are two higher-level constructs available which include a load balancer for you:

  • LoadBalancedFargateService
  • LoadBalancedEc2Service

Task Auto-Scaling

You can configure the task count of a service to match demand. Task auto-scaling is configured by calling autoScaleTaskCount():

const scaling = service.autoScaleTaskCount({ maxCapacity: 10 });
scaling.scaleOnCpuUtilization('CpuScaling', {
  targetUtilizationPercent: 50
});

scaling.scaleOnRequestCount('RequestScaling', {
  requestsPerTarget: 10000,
  targetGroup: target
})

Task auto-scaling is powered by Application Auto-Scaling. See that section for details.

Instance Auto-Scaling

If you’re running on AWS Fargate, AWS manages the physical machines that your containers are running on for you. If you’re running an Amazon ECS cluster however, your Amazon EC2 instances might fill up as your number of Tasks goes up.

To avoid placement errors, configure auto-scaling for your Amazon EC2 instance group so that your instance count scales with demand. To keep your Amazon EC2 instances halfway loaded, scaling up to a maximum of 30 instances if required:

const autoScalingGroup = cluster.addDefaultAutoScalingGroupCapacity({
  instanceType: new ec2.InstanceType("t2.xlarge"),
  minCapacity: 3,
  maxCapacity: 30
  instanceCount: 3,

  // Give instances 5 minutes to drain running tasks when an instance is
  // terminated. This is the default, turn this off by specifying 0 or
  // change the timeout up to 900 seconds.
  taskDrainTimeSec: 300,
});

autoScalingGroup.scaleOnCpuUtilization('KeepCpuHalfwayLoaded', {
  targetUtilizationPercent: 50
});

See the @aws-cdk/aws-autoscaling library for more autoscaling options you can configure on your instances.

Integration with CloudWatch Events

To start an Amazon ECS task on an Amazon EC2-backed Cluster, instantiate an Ec2TaskEventRuleTarget instead of an Ec2Service:

// Create a Task Definition for the container to start
const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
taskDefinition.addContainer('TheContainer', {
  image: ecs.ContainerImage.fromAsset(this, 'EventImage', { directory: 'eventhandler-image' }),
  memoryLimitMiB: 256,
  logging: new ecs.AwsLogDriver(this, 'TaskLogging', { streamPrefix: 'EventDemo' })
});

// An EventRule that describes the event trigger (in this case a scheduled run)
const rule = new events.EventRule(this, 'Rule', {
  scheduleExpression: 'rate(1 minute)',
});

// Use Ec2TaskEventRuleTarget as the target of the EventRule
const target = new ecs.Ec2EventRuleTarget(this, 'EventTarget', {
  cluster,
  taskDefinition,
  taskCount: 1
});

// Pass an environment variable to the container 'TheContainer' in the task
rule.addTarget(target, {
  jsonTemplate: JSON.stringify({
    containerOverrides: [{
      name: 'TheContainer',
      environment: [{ name: 'I_WAS_TRIGGERED', value: 'From CloudWatch Events' }]
    }]
  })
});
Note: it is currently not possible to start AWS Fargate tasks in this way.

Roadmap

  • [ ] Service Discovery Integration
  • [ ] Private registry authentication

Reference

View in Nuget

csproj:

<PackageReference Include="Amazon.CDK.AWS.ECS" Version="0.25.3" />

dotnet:

dotnet add package Amazon.CDK.AWS.ECS --version 0.25.3

packages.config:

<package id="Amazon.CDK.AWS.ECS" version="0.25.3" />

View in Maven Central

Apache Buildr:

'software.amazon.awscdk:ecs:jar:0.25.3'

Apache Ivy:

<dependency groupId="software.amazon.awscdk" name="ecs" rev="0.25.3"/>

Apache Maven:

<dependency>
  <groupId>software.amazon.awscdk</groupId>
  <artifactId>ecs</artifactId>
  <version>0.25.3</version>
</dependency>

Gradle / Grails:

compile 'software.amazon.awscdk:ecs:0.25.3'

Groovy Grape:

@Grapes(
@Grab(group='software.amazon.awscdk', module='ecs', version='0.25.3')
)

View in NPM

npm:

$ npm i @aws-cdk/aws-ecs@0.25.3

package.json:

{
  "@aws-cdk/aws-ecs": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/aws-ecs@0.25.3

View in NPM

npm:

$ npm i @aws-cdk/aws-ecs@0.25.3

package.json:

{
  "@aws-cdk/aws-ecs": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/aws-ecs@0.25.3

AddAutoScalingGroupCapacityOptions (interface)

class @aws-cdk/aws-ecs.AddAutoScalingGroupCapacityOptions

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.AddAutoScalingGroupCapacityOptions;
// AddAutoScalingGroupCapacityOptions is an interface
import { AddAutoScalingGroupCapacityOptions } from '@aws-cdk/aws-ecs';

Properties for adding an autoScalingGroup

containersAccessInstanceRole

Whether or not the containers can access the instance role

Type:boolean (optional)
Default:false
taskDrainTimeSeconds

Give tasks this many seconds to complete when instances are being scaled in.

Task draining adds a Lambda and a Lifecycle hook to your AutoScalingGroup

that will delay instance termination until all ECS tasks have drained from

the instance.

Set to 0 to disable task draining.

Type:number (optional)
Default:300

AddCapacityOptions (interface)

class @aws-cdk/aws-ecs.AddCapacityOptions

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.AddCapacityOptions;
// AddCapacityOptions is an interface
import { AddCapacityOptions } from '@aws-cdk/aws-ecs';

Properties for adding autoScalingGroup

Extends:AddAutoScalingGroupCapacityOptions
Extends:@aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps
instanceType

The type of EC2 instance to launch into your Autoscaling Group

Type:@aws-cdk/aws-ec2.InstanceType
allowAllOutbound

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

Whether the instances can initiate connections to anywhere by default

Type:boolean (optional)
Default:true
associatePublicIpAddress

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

Whether instances in the Auto Scaling Group should have public

IP addresses associated with them.

Type:boolean (optional)
Default:Use subnet setting
cooldownSeconds

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

Default scaling cooldown for this AutoScalingGroup

Type:number (optional)
Default:300 (5 minutes)
desiredCapacity

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

Initial amount of instances in the fleet

Type:number (optional)
Default:1
ignoreUnmodifiedSizeProperties

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

If the ASG has scheduled actions, don’t reset unchanged group sizes

Only used if the ASG has scheduled actions (which may scale your ASG up

or down regardless of cdk deployments). If true, the size of the group

will only be reset if it has been changed in the CDK app. If false, the

sizes will always be changed back to what they were in the CDK app

on deployment.

Type:boolean (optional)
Default:true
keyName

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

Name of SSH keypair to grant access to instances

Type:string (optional)
Default:No SSH access will be possible
maxCapacity

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

Maximum number of instances in the fleet

Type:number (optional)
Default:desiredCapacity
minCapacity

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

Minimum number of instances in the fleet

Type:number (optional)
Default:1
notificationsTopic

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

SNS topic to send notifications about fleet changes

Type:@aws-cdk/aws-sns.ITopic (optional)
Default:No fleet change notifications will be sent.
replacingUpdateMinSuccessfulInstancesPercent

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

Configuration for replacing updates.

Only used if updateType == UpdateType.ReplacingUpdate. Specifies how

many instances must signal success for the update to succeed.

Type:number (optional)
resourceSignalCount

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

How many ResourceSignal calls CloudFormation expects before the resource is considered created

Type:number (optional)
Default:1
resourceSignalTimeoutSec

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

The length of time to wait for the resourceSignalCount

The maximum value is 43200 (12 hours).

Type:number (optional)
Default:300 (5 minutes)
rollingUpdateConfiguration

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

Configuration for rolling updates

Only used if updateType == UpdateType.RollingUpdate.

Type:@aws-cdk/aws-autoscaling.RollingUpdateConfiguration (optional)
updateType

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

What to do when an AutoScalingGroup’s instance configuration is changed

This is applied when any of the settings on the ASG are changed that

affect how the instances should be created (VPC, instance type, startup

scripts, etc.). It indicates how the existing instances should be

replaced with new instances matching the new config. By default, nothing

is done and only new instances are launched with the new config.

Type:@aws-cdk/aws-autoscaling.UpdateType (optional)
Default:UpdateType.None
vpcPlacement

Inherited from @aws-cdk/aws-autoscaling.CommonAutoScalingGroupProps

Where to place instances within the VPC

Type:@aws-cdk/aws-ec2.VpcPlacementStrategy (optional)
containersAccessInstanceRole

Inherited from @aws-cdk/aws-ecs.AddAutoScalingGroupCapacityOptions

Whether or not the containers can access the instance role

Type:boolean (optional)
Default:false
taskDrainTimeSeconds

Inherited from @aws-cdk/aws-ecs.AddAutoScalingGroupCapacityOptions

Give tasks this many seconds to complete when instances are being scaled in.

Task draining adds a Lambda and a Lifecycle hook to your AutoScalingGroup

that will delay instance termination until all ECS tasks have drained from

the instance.

Set to 0 to disable task draining.

Type:number (optional)
Default:300

AssetImage

class @aws-cdk/aws-ecs.AssetImage(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.AssetImage;
const { AssetImage } = require('@aws-cdk/aws-ecs');
import { AssetImage } from '@aws-cdk/aws-ecs';

An image that will be built at synthesis time

Extends:

ContainerImage

Parameters:
bind(containerDefinition)

Implements @aws-cdk/aws-ecs.ContainerImage.bind()

Called when the image is used by a ContainerDefinition

Parameters:containerDefinition (ContainerDefinition) –
imageName

Implements @aws-cdk/aws-ecs.ContainerImage.imageName()

Name of the image

Type:string (readonly)

AssetImageProps (interface)

class @aws-cdk/aws-ecs.AssetImageProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.AssetImageProps;
// AssetImageProps is an interface
import { AssetImageProps } from '@aws-cdk/aws-ecs';
directory

The directory where the Dockerfile is stored

Type:string

AwsLogDriver

class @aws-cdk/aws-ecs.AwsLogDriver(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.AwsLogDriver;
const { AwsLogDriver } = require('@aws-cdk/aws-ecs');
import { AwsLogDriver } from '@aws-cdk/aws-ecs';

A log driver that will log to an AWS Log Group

Extends:

LogDriver

Parameters:
bind(containerDefinition)

Implements @aws-cdk/aws-ecs.LogDriver.bind()

Called when the log driver is configured on a container

Parameters:containerDefinition (ContainerDefinition) –
renderLogDriver() → @aws-cdk/aws-ecs.CfnTaskDefinition.LogConfigurationProperty

Implements @aws-cdk/aws-ecs.LogDriver.renderLogDriver()

Return the log driver CloudFormation JSON

Return type:LogConfigurationProperty
logGroup

The log group that the logs will be sent to

Type:@aws-cdk/aws-logs.ILogGroup (readonly)
props
Type:AwsLogDriverProps (readonly)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

AwsLogDriverProps (interface)

class @aws-cdk/aws-ecs.AwsLogDriverProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.AwsLogDriverProps;
// AwsLogDriverProps is an interface
import { AwsLogDriverProps } from '@aws-cdk/aws-ecs';

Properties for defining a new AWS Log Driver

streamPrefix

Prefix for the log streams

The awslogs-stream-prefix option allows you to associate a log stream

with the specified prefix, the container name, and the ID of the Amazon

ECS task to which the container belongs. If you specify a prefix with

this option, then the log stream takes the following format:

prefix-name/container-name/ecs-task-id
Type:string
datetimeFormat

This option defines a multiline start pattern in Python strftime format.

A log message consists of a line that matches the pattern and any

following lines that don’t match the pattern. Thus the matched line is

the delimiter between log messages.

Type:string (optional)
logGroup

The log group to log to

Type:@aws-cdk/aws-logs.ILogGroup (optional)
Default:A log group is automatically created
multilinePattern

This option defines a multiline start pattern using a regular expression.

A log message consists of a line that matches the pattern and any

following lines that don’t match the pattern. Thus the matched line is

the delimiter between log messages.

Type:string (optional)

BaseService

class @aws-cdk/aws-ecs.BaseService(scope, id, props, additionalProps, clusterName, taskDefinition)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.BaseService;
const { BaseService } = require('@aws-cdk/aws-ecs');
import { BaseService } from '@aws-cdk/aws-ecs';

Base class for Ecs and Fargate services

Extends:

@aws-cdk/cdk.Construct

Implements:

@aws-cdk/aws-elasticloadbalancingv2.IApplicationLoadBalancerTarget

Implements:

@aws-cdk/aws-elasticloadbalancingv2.INetworkLoadBalancerTarget

Abstract:

Yes

Parameters:
attachToApplicationTargetGroup(targetGroup) → @aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps

Implements @aws-cdk/aws-elasticloadbalancingv2.IApplicationLoadBalancerTarget.attachToApplicationTargetGroup()

Called when the service is attached to an ALB

Don’t call this function directly. Instead, call listener.addTarget()

to add this service to a load balancer.

Parameters:targetGroup (@aws-cdk/aws-elasticloadbalancingv2.ApplicationTargetGroup) –
Return type:@aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps
attachToNetworkTargetGroup(targetGroup) → @aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps

Implements @aws-cdk/aws-elasticloadbalancingv2.INetworkLoadBalancerTarget.attachToNetworkTargetGroup()

Called when the service is attached to an NLB

Don’t call this function directly. Instead, call listener.addTarget()

to add this service to a load balancer.

Parameters:targetGroup (@aws-cdk/aws-elasticloadbalancingv2.NetworkTargetGroup) –
Return type:@aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps
autoScaleTaskCount(props) → @aws-cdk/aws-ecs.ScalableTaskCount

Enable autoscaling for the number of tasks in this service

Parameters:props (@aws-cdk/aws-applicationautoscaling.EnableScalingProps) –
Return type:ScalableTaskCount
configureAwsVpcNetworking(vpc[, assignPublicIp[, vpcPlacement[, securityGroup]]])

Set up AWSVPC networking for this construct

Protected method

Parameters:
metric(metricName[, props]) → @aws-cdk/aws-cloudwatch.Metric

Return the given named metric for this Service

Parameters:
Return type:

@aws-cdk/aws-cloudwatch.Metric

clusterName

Name of this service’s cluster

Type:string (readonly)
connections

Manage allowed network traffic for this service

Type:@aws-cdk/aws-ec2.Connections (readonly)
serviceArn

ARN of this service

Type:string (readonly)
serviceName

Name of this service

Type:string (readonly)
taskDefinition

Task definition this service is associated with

Type:TaskDefinition (readonly)
loadBalancers

Protected property

Type:LoadBalancerProperty[]
networkConfiguration

Protected property

Type:NetworkConfigurationProperty (optional)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

BaseServiceProps (interface)

class @aws-cdk/aws-ecs.BaseServiceProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.BaseServiceProps;
// BaseServiceProps is an interface
import { BaseServiceProps } from '@aws-cdk/aws-ecs';

Basic service properties

desiredCount

Number of desired copies of running tasks

Type:number (optional)
Default:1
healthCheckGracePeriodSeconds

Time after startup to ignore unhealthy load balancer checks.

Type:number (optional)
Default:??? FIXME
maximumPercent

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.

Type:number (optional)
Default:200
minimumHealthyPercent

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.

Type:number (optional)
Default:50
serviceName

A name for the service.

Type:string (optional)
Default:CloudFormation-generated name

BinPackResource (enum)

class @aws-cdk/aws-ecs.BinPackResource

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.BinPackResource;
const { BinPackResource } = require('@aws-cdk/aws-ecs');
import { BinPackResource } from '@aws-cdk/aws-ecs';

Instance resource used for bin packing

Cpu

Fill up hosts’ CPU allocations first

Memory

Fill up hosts’ memory allocations first

BuiltInAttributes

class @aws-cdk/aws-ecs.BuiltInAttributes

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.BuiltInAttributes;
const { BuiltInAttributes } = require('@aws-cdk/aws-ecs');
import { BuiltInAttributes } from '@aws-cdk/aws-ecs';

Built-in container instance attributes

AmiId

The AMI ID of the instance

Type:string (readonly) (static)
AvailabilityZone

The AZ where the instance is running

Type:string (readonly) (static)
InstanceId

The Instance ID of the instance

Type:string (readonly) (static)
InstanceType

The instance type

Type:string (readonly) (static)
OsType

The OS type

Either ‘linux’ or ‘windows’.

Type:string (readonly) (static)

Capability (enum)

class @aws-cdk/aws-ecs.Capability

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.Capability;
const { Capability } = require('@aws-cdk/aws-ecs');
import { Capability } from '@aws-cdk/aws-ecs';

A Linux capability

All
AuditControl
AuditWrite
BlockSuspend
Chown
DacOverride
DacReadSearch
Fowner
Fsetid
IpcLock
IpcOwner
Kill
Lease
LinuxImmutable
MacAdmin
MacOverride
Mknod
NetAdmin
NetBindService
NetBroadcast
NetRaw
Setfcap
Setgid
Setpcap
Setuid
SysAdmin
SysBoot
SysChroot
SysModule
SysNice
SysPacct
SysPtrace
SysRawio
SysResource
SysTime
SysTtyConfig
Syslog
WakeAlarm

CfnCluster

class @aws-cdk/aws-ecs.CfnCluster(scope, id[, props])

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnCluster;
const { CfnCluster } = require('@aws-cdk/aws-ecs');
import { CfnCluster } from '@aws-cdk/aws-ecs';
Extends:

@aws-cdk/cdk.Resource

Parameters:
renderProperties(properties) → string => any

Overrides @aws-cdk/cdk.Resource.renderProperties()

Protected method

Parameters:properties (any) –
Return type:string => any
resourceTypeName

The CloudFormation resource type name for this resource class.

Type:string (readonly) (static)
clusterArn
Type:string (readonly)
clusterName
Type:string (readonly)
propertyOverrides
Type:CfnClusterProps (readonly)
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)
ref

Inherited from @aws-cdk/cdk.Referenceable

Returns a token to a CloudFormation { Ref } that references this entity based on it’s logical ID.

Type:string (readonly)
addDeletionOverride(path)

Inherited from @aws-cdk/cdk.Resource

Syntactic sugar for addOverride(path, undefined).

Parameters:path (string) – The path of the value to delete
addDependsOn(resource)

Inherited from @aws-cdk/cdk.Resource

Indicates that this resource depends on another resource and cannot be provisioned

unless the other resource has been successfully provisioned.

Parameters:resource (@aws-cdk/cdk.Resource) –
addOverride(path, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to the synthesized CloudFormation resource. To add a

property override, either use addPropertyOverride or prefix path with

“Properties.” (i.e. Properties.TopicName).

Parameters:
  • path (string) – The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
  • value (any) – The value. Could be primitive or complex.
addPropertyDeletionOverride(propertyPath)

Inherited from @aws-cdk/cdk.Resource

Adds an override that deletes the value of a property from the resource definition.

Parameters:propertyPath (string) – The path to the property.
addPropertyOverride(propertyPath, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to a resource property.

Syntactic sugar for addOverride(“Properties.<…>”, value).

Parameters:
  • propertyPath (string) – The path of the property
  • value (any) – The value
getAtt(attributeName) → @aws-cdk/cdk.CfnReference

Inherited from @aws-cdk/cdk.Resource

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility

in case there is no generated attribute.

Parameters:attributeName (string) – The name of the attribute.
Return type:@aws-cdk/cdk.CfnReference
toCloudFormation() → json

Inherited from @aws-cdk/cdk.Resource

Emits CloudFormation for this resource.

Return type:json
options

Inherited from @aws-cdk/cdk.Resource

Options for this resource, such as condition, update policy etc.

Type:@aws-cdk/cdk.ResourceOptions (readonly)
properties

Inherited from @aws-cdk/cdk.Resource

AWS resource properties.

This object is rendered via a call to “renderProperties(this.properties)”.

Protected property

Type:any (readonly)
resourceType

Inherited from @aws-cdk/cdk.Resource

AWS resource type.

Type:string (readonly)
untypedPropertyOverrides

Inherited from @aws-cdk/cdk.Resource

AWS resource property overrides.

During synthesis, the method “renderProperties(this.overrides)” is called

with this object, and merged on top of the output of

“renderProperties(this.properties)”.

Derived classes should expose a strongly-typed version of this object as

a public property called propertyOverrides.

Protected property

Type:any (readonly)
overrideLogicalId(newLogicalId)

Inherited from @aws-cdk/cdk.StackElement

Overrides the auto-generated logical ID with a specific ID.

Parameters:newLogicalId (string) – The new logical ID to use for this stack element.
prepare()

Inherited from @aws-cdk/cdk.StackElement

Automatically detect references in this StackElement

Protected method

creationStackTrace

Inherited from @aws-cdk/cdk.StackElement

Type:string[] (readonly)
logicalId

Inherited from @aws-cdk/cdk.StackElement

The logical ID for this CloudFormation stack element. The logical ID of the element

is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Type:string (readonly)
stackPath

Inherited from @aws-cdk/cdk.StackElement

Return the path with respect to the stack

Type:string (readonly)

CfnClusterProps (interface)

class @aws-cdk/aws-ecs.CfnClusterProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnClusterProps;
// CfnClusterProps is an interface
import { CfnClusterProps } from '@aws-cdk/aws-ecs';
clusterName

AWS::ECS::Cluster.ClusterName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-clustername

Type:string (optional)

CfnService

class @aws-cdk/aws-ecs.CfnService(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnService;
const { CfnService } = require('@aws-cdk/aws-ecs');
import { CfnService } from '@aws-cdk/aws-ecs';
Extends:

@aws-cdk/cdk.Resource

Parameters:
renderProperties(properties) → string => any

Overrides @aws-cdk/cdk.Resource.renderProperties()

Protected method

Parameters:properties (any) –
Return type:string => any
resourceTypeName

The CloudFormation resource type name for this resource class.

Type:string (readonly) (static)
propertyOverrides
Type:CfnServiceProps (readonly)
serviceArn
Type:string (readonly)
serviceName
Type:string (readonly)
class AwsVpcConfigurationProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnService.AwsVpcConfigurationProperty;
// CfnService.AwsVpcConfigurationProperty is an interface
import { CfnService.AwsVpcConfigurationProperty } from '@aws-cdk/aws-ecs';
subnets

CfnService.AwsVpcConfigurationProperty.Subnets

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-awsvpcconfiguration.html#cfn-ecs-service-awsvpcconfiguration-subnets

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[]
assignPublicIp

CfnService.AwsVpcConfigurationProperty.AssignPublicIp

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-awsvpcconfiguration.html#cfn-ecs-service-awsvpcconfiguration-assignpublicip

Type:string (optional)
securityGroups

CfnService.AwsVpcConfigurationProperty.SecurityGroups

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-awsvpcconfiguration.html#cfn-ecs-service-awsvpcconfiguration-securitygroups

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
class DeploymentConfigurationProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnService.DeploymentConfigurationProperty;
// CfnService.DeploymentConfigurationProperty is an interface
import { CfnService.DeploymentConfigurationProperty } from '@aws-cdk/aws-ecs';
maximumPercent

CfnService.DeploymentConfigurationProperty.MaximumPercent

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentconfiguration.html#cfn-ecs-service-deploymentconfiguration-maximumpercent

Type:number or @aws-cdk/cdk.Token (optional)
minimumHealthyPercent

CfnService.DeploymentConfigurationProperty.MinimumHealthyPercent

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentconfiguration.html#cfn-ecs-service-deploymentconfiguration-minimumhealthypercent

Type:number or @aws-cdk/cdk.Token (optional)
class LoadBalancerProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnService.LoadBalancerProperty;
// CfnService.LoadBalancerProperty is an interface
import { CfnService.LoadBalancerProperty } from '@aws-cdk/aws-ecs';
containerPort

CfnService.LoadBalancerProperty.ContainerPort

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-loadbalancers.html#cfn-ecs-service-loadbalancers-containerport

Type:number or @aws-cdk/cdk.Token
containerName

CfnService.LoadBalancerProperty.ContainerName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-loadbalancers.html#cfn-ecs-service-loadbalancers-containername

Type:string (optional)
loadBalancerName

CfnService.LoadBalancerProperty.LoadBalancerName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-loadbalancers.html#cfn-ecs-service-loadbalancers-loadbalancername

Type:string (optional)
targetGroupArn

CfnService.LoadBalancerProperty.TargetGroupArn

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-loadbalancers.html#cfn-ecs-service-loadbalancers-targetgrouparn

Type:string (optional)
class NetworkConfigurationProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnService.NetworkConfigurationProperty;
// CfnService.NetworkConfigurationProperty is an interface
import { CfnService.NetworkConfigurationProperty } from '@aws-cdk/aws-ecs';
awsvpcConfiguration

CfnService.NetworkConfigurationProperty.AwsvpcConfiguration

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-networkconfiguration.html#cfn-ecs-service-networkconfiguration-awsvpcconfiguration

Type:@aws-cdk/cdk.Token or AwsVpcConfigurationProperty (optional)
class PlacementConstraintProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnService.PlacementConstraintProperty;
// CfnService.PlacementConstraintProperty is an interface
import { CfnService.PlacementConstraintProperty } from '@aws-cdk/aws-ecs';
type

CfnService.PlacementConstraintProperty.Type

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-placementconstraint.html#cfn-ecs-service-placementconstraint-type

Type:string
expression

CfnService.PlacementConstraintProperty.Expression

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-placementconstraint.html#cfn-ecs-service-placementconstraint-expression

Type:string (optional)
class PlacementStrategyProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnService.PlacementStrategyProperty;
// CfnService.PlacementStrategyProperty is an interface
import { CfnService.PlacementStrategyProperty } from '@aws-cdk/aws-ecs';
type

CfnService.PlacementStrategyProperty.Type

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-placementstrategy.html#cfn-ecs-service-placementstrategy-type

Type:string
field

CfnService.PlacementStrategyProperty.Field

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-placementstrategy.html#cfn-ecs-service-placementstrategy-field

Type:string (optional)
class ServiceRegistryProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnService.ServiceRegistryProperty;
// CfnService.ServiceRegistryProperty is an interface
import { CfnService.ServiceRegistryProperty } from '@aws-cdk/aws-ecs';
containerName

CfnService.ServiceRegistryProperty.ContainerName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceregistry.html#cfn-ecs-service-serviceregistry-containername

Type:string (optional)
containerPort

CfnService.ServiceRegistryProperty.ContainerPort

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceregistry.html#cfn-ecs-service-serviceregistry-containerport

Type:number or @aws-cdk/cdk.Token (optional)
port

CfnService.ServiceRegistryProperty.Port

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceregistry.html#cfn-ecs-service-serviceregistry-port

Type:number or @aws-cdk/cdk.Token (optional)
registryArn

CfnService.ServiceRegistryProperty.RegistryArn

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-serviceregistry.html#cfn-ecs-service-serviceregistry-registryarn

Type:string (optional)
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)
ref

Inherited from @aws-cdk/cdk.Referenceable

Returns a token to a CloudFormation { Ref } that references this entity based on it’s logical ID.

Type:string (readonly)
addDeletionOverride(path)

Inherited from @aws-cdk/cdk.Resource

Syntactic sugar for addOverride(path, undefined).

Parameters:path (string) – The path of the value to delete
addDependsOn(resource)

Inherited from @aws-cdk/cdk.Resource

Indicates that this resource depends on another resource and cannot be provisioned

unless the other resource has been successfully provisioned.

Parameters:resource (@aws-cdk/cdk.Resource) –
addOverride(path, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to the synthesized CloudFormation resource. To add a

property override, either use addPropertyOverride or prefix path with

“Properties.” (i.e. Properties.TopicName).

Parameters:
  • path (string) – The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
  • value (any) – The value. Could be primitive or complex.
addPropertyDeletionOverride(propertyPath)

Inherited from @aws-cdk/cdk.Resource

Adds an override that deletes the value of a property from the resource definition.

Parameters:propertyPath (string) – The path to the property.
addPropertyOverride(propertyPath, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to a resource property.

Syntactic sugar for addOverride(“Properties.<…>”, value).

Parameters:
  • propertyPath (string) – The path of the property
  • value (any) – The value
getAtt(attributeName) → @aws-cdk/cdk.CfnReference

Inherited from @aws-cdk/cdk.Resource

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility

in case there is no generated attribute.

Parameters:attributeName (string) – The name of the attribute.
Return type:@aws-cdk/cdk.CfnReference
toCloudFormation() → json

Inherited from @aws-cdk/cdk.Resource

Emits CloudFormation for this resource.

Return type:json
options

Inherited from @aws-cdk/cdk.Resource

Options for this resource, such as condition, update policy etc.

Type:@aws-cdk/cdk.ResourceOptions (readonly)
properties

Inherited from @aws-cdk/cdk.Resource

AWS resource properties.

This object is rendered via a call to “renderProperties(this.properties)”.

Protected property

Type:any (readonly)
resourceType

Inherited from @aws-cdk/cdk.Resource

AWS resource type.

Type:string (readonly)
untypedPropertyOverrides

Inherited from @aws-cdk/cdk.Resource

AWS resource property overrides.

During synthesis, the method “renderProperties(this.overrides)” is called

with this object, and merged on top of the output of

“renderProperties(this.properties)”.

Derived classes should expose a strongly-typed version of this object as

a public property called propertyOverrides.

Protected property

Type:any (readonly)
overrideLogicalId(newLogicalId)

Inherited from @aws-cdk/cdk.StackElement

Overrides the auto-generated logical ID with a specific ID.

Parameters:newLogicalId (string) – The new logical ID to use for this stack element.
prepare()

Inherited from @aws-cdk/cdk.StackElement

Automatically detect references in this StackElement

Protected method

creationStackTrace

Inherited from @aws-cdk/cdk.StackElement

Type:string[] (readonly)
logicalId

Inherited from @aws-cdk/cdk.StackElement

The logical ID for this CloudFormation stack element. The logical ID of the element

is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Type:string (readonly)
stackPath

Inherited from @aws-cdk/cdk.StackElement

Return the path with respect to the stack

Type:string (readonly)

CfnServiceProps (interface)

class @aws-cdk/aws-ecs.CfnServiceProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnServiceProps;
// CfnServiceProps is an interface
import { CfnServiceProps } from '@aws-cdk/aws-ecs';
taskDefinition

AWS::ECS::Service.TaskDefinition

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-taskdefinition

Type:string
cluster

AWS::ECS::Service.Cluster

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-cluster

Type:string (optional)
deploymentConfiguration

AWS::ECS::Service.DeploymentConfiguration

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-deploymentconfiguration

Type:DeploymentConfigurationProperty or @aws-cdk/cdk.Token (optional)
desiredCount

AWS::ECS::Service.DesiredCount

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-desiredcount

Type:number or @aws-cdk/cdk.Token (optional)
healthCheckGracePeriodSeconds

AWS::ECS::Service.HealthCheckGracePeriodSeconds

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-healthcheckgraceperiodseconds

Type:number or @aws-cdk/cdk.Token (optional)
launchType

AWS::ECS::Service.LaunchType

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-launchtype

Type:string (optional)
loadBalancers

AWS::ECS::Service.LoadBalancers

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-loadbalancers

Type:@aws-cdk/cdk.Token or (LoadBalancerProperty or @aws-cdk/cdk.Token)[] (optional)
networkConfiguration

AWS::ECS::Service.NetworkConfiguration

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-networkconfiguration

Type:NetworkConfigurationProperty or @aws-cdk/cdk.Token (optional)
placementConstraints

AWS::ECS::Service.PlacementConstraints

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-placementconstraints

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or PlacementConstraintProperty)[] (optional)
placementStrategies

AWS::ECS::Service.PlacementStrategies

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-placementstrategies

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or PlacementStrategyProperty)[] (optional)
platformVersion

AWS::ECS::Service.PlatformVersion

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-platformversion

Type:string (optional)
role

AWS::ECS::Service.Role

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-role

Type:string (optional)
schedulingStrategy

AWS::ECS::Service.SchedulingStrategy

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-schedulingstrategy

Type:string (optional)
serviceName

AWS::ECS::Service.ServiceName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-servicename

Type:string (optional)
serviceRegistries

AWS::ECS::Service.ServiceRegistries

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-serviceregistries

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or ServiceRegistryProperty)[] (optional)

CfnTaskDefinition

class @aws-cdk/aws-ecs.CfnTaskDefinition(scope, id[, props])

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition;
const { CfnTaskDefinition } = require('@aws-cdk/aws-ecs');
import { CfnTaskDefinition } from '@aws-cdk/aws-ecs';
Extends:

@aws-cdk/cdk.Resource

Parameters:
renderProperties(properties) → string => any

Overrides @aws-cdk/cdk.Resource.renderProperties()

Protected method

Parameters:properties (any) –
Return type:string => any
resourceTypeName

The CloudFormation resource type name for this resource class.

Type:string (readonly) (static)
propertyOverrides
Type:CfnTaskDefinitionProps (readonly)
taskDefinitionArn
Type:string (readonly)
class ContainerDefinitionProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.ContainerDefinitionProperty;
// CfnTaskDefinition.ContainerDefinitionProperty is an interface
import { CfnTaskDefinition.ContainerDefinitionProperty } from '@aws-cdk/aws-ecs';
command

CfnTaskDefinition.ContainerDefinitionProperty.Command

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-command

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
cpu

CfnTaskDefinition.ContainerDefinitionProperty.Cpu

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-cpu

Type:number or @aws-cdk/cdk.Token (optional)
disableNetworking

CfnTaskDefinition.ContainerDefinitionProperty.DisableNetworking

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-disablenetworking

Type:boolean or @aws-cdk/cdk.Token (optional)
dnsSearchDomains

CfnTaskDefinition.ContainerDefinitionProperty.DnsSearchDomains

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-dnssearchdomains

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
dnsServers

CfnTaskDefinition.ContainerDefinitionProperty.DnsServers

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-dnsservers

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
dockerLabels

CfnTaskDefinition.ContainerDefinitionProperty.DockerLabels

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-dockerlabels

Type:@aws-cdk/cdk.Token or string => (string or @aws-cdk/cdk.Token) (optional)
dockerSecurityOptions

CfnTaskDefinition.ContainerDefinitionProperty.DockerSecurityOptions

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-dockersecurityoptions

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
entryPoint

CfnTaskDefinition.ContainerDefinitionProperty.EntryPoint

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-entrypoint

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
environment

CfnTaskDefinition.ContainerDefinitionProperty.Environment

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-environment

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or KeyValuePairProperty)[] (optional)
essential

CfnTaskDefinition.ContainerDefinitionProperty.Essential

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-essential

Type:boolean or @aws-cdk/cdk.Token (optional)
extraHosts

CfnTaskDefinition.ContainerDefinitionProperty.ExtraHosts

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-extrahosts

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or HostEntryProperty)[] (optional)
healthCheck

CfnTaskDefinition.ContainerDefinitionProperty.HealthCheck

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-healthcheck

Type:@aws-cdk/cdk.Token or HealthCheckProperty (optional)
hostname

CfnTaskDefinition.ContainerDefinitionProperty.Hostname

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-hostname

Type:string (optional)
image

CfnTaskDefinition.ContainerDefinitionProperty.Image

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-image

Type:string (optional)

CfnTaskDefinition.ContainerDefinitionProperty.Links

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-links

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
linuxParameters

CfnTaskDefinition.ContainerDefinitionProperty.LinuxParameters

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-linuxparameters

Type:LinuxParametersProperty or @aws-cdk/cdk.Token (optional)
logConfiguration

CfnTaskDefinition.ContainerDefinitionProperty.LogConfiguration

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-logconfiguration

Type:LogConfigurationProperty or @aws-cdk/cdk.Token (optional)
memory

CfnTaskDefinition.ContainerDefinitionProperty.Memory

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-memory

Type:number or @aws-cdk/cdk.Token (optional)
memoryReservation

CfnTaskDefinition.ContainerDefinitionProperty.MemoryReservation

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-memoryreservation

Type:number or @aws-cdk/cdk.Token (optional)
mountPoints

CfnTaskDefinition.ContainerDefinitionProperty.MountPoints

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-mountpoints

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or MountPointProperty)[] (optional)
name

CfnTaskDefinition.ContainerDefinitionProperty.Name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-name

Type:string (optional)
portMappings

CfnTaskDefinition.ContainerDefinitionProperty.PortMappings

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-portmappings

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or PortMappingProperty)[] (optional)
privileged

CfnTaskDefinition.ContainerDefinitionProperty.Privileged

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-privileged

Type:boolean or @aws-cdk/cdk.Token (optional)
readonlyRootFilesystem

CfnTaskDefinition.ContainerDefinitionProperty.ReadonlyRootFilesystem

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-readonlyrootfilesystem

Type:boolean or @aws-cdk/cdk.Token (optional)
repositoryCredentials

CfnTaskDefinition.ContainerDefinitionProperty.RepositoryCredentials

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-repositorycredentials

Type:@aws-cdk/cdk.Token or RepositoryCredentialsProperty (optional)
ulimits

CfnTaskDefinition.ContainerDefinitionProperty.Ulimits

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-ulimits

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or UlimitProperty)[] (optional)
user

CfnTaskDefinition.ContainerDefinitionProperty.User

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-user

Type:string (optional)
volumesFrom

CfnTaskDefinition.ContainerDefinitionProperty.VolumesFrom

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-volumesfrom

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or VolumeFromProperty)[] (optional)
workingDirectory

CfnTaskDefinition.ContainerDefinitionProperty.WorkingDirectory

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-workingdirectory

Type:string (optional)
class DeviceProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.DeviceProperty;
// CfnTaskDefinition.DeviceProperty is an interface
import { CfnTaskDefinition.DeviceProperty } from '@aws-cdk/aws-ecs';
hostPath

CfnTaskDefinition.DeviceProperty.HostPath

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-device.html#cfn-ecs-taskdefinition-device-hostpath

Type:string
containerPath

CfnTaskDefinition.DeviceProperty.ContainerPath

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-device.html#cfn-ecs-taskdefinition-device-containerpath

Type:string (optional)
permissions

CfnTaskDefinition.DeviceProperty.Permissions

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-device.html#cfn-ecs-taskdefinition-device-permissions

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
class DockerVolumeConfigurationProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.DockerVolumeConfigurationProperty;
// CfnTaskDefinition.DockerVolumeConfigurationProperty is an interface
import { CfnTaskDefinition.DockerVolumeConfigurationProperty } from '@aws-cdk/aws-ecs';
autoprovision

CfnTaskDefinition.DockerVolumeConfigurationProperty.Autoprovision

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-dockervolumeconfiguration.html#cfn-ecs-taskdefinition-dockervolumeconfiguration-autoprovision

Type:boolean or @aws-cdk/cdk.Token (optional)
driver

CfnTaskDefinition.DockerVolumeConfigurationProperty.Driver

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-dockervolumeconfiguration.html#cfn-ecs-taskdefinition-dockervolumeconfiguration-driver

Type:string (optional)
driverOpts

CfnTaskDefinition.DockerVolumeConfigurationProperty.DriverOpts

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-dockervolumeconfiguration.html#cfn-ecs-taskdefinition-dockervolumeconfiguration-driveropts

Type:@aws-cdk/cdk.Token or string => (string or @aws-cdk/cdk.Token) (optional)
labels

CfnTaskDefinition.DockerVolumeConfigurationProperty.Labels

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-dockervolumeconfiguration.html#cfn-ecs-taskdefinition-dockervolumeconfiguration-labels

Type:@aws-cdk/cdk.Token or string => (string or @aws-cdk/cdk.Token) (optional)
scope

CfnTaskDefinition.DockerVolumeConfigurationProperty.Scope

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-dockervolumeconfiguration.html#cfn-ecs-taskdefinition-dockervolumeconfiguration-scope

Type:string (optional)
class HealthCheckProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.HealthCheckProperty;
// CfnTaskDefinition.HealthCheckProperty is an interface
import { CfnTaskDefinition.HealthCheckProperty } from '@aws-cdk/aws-ecs';
command

CfnTaskDefinition.HealthCheckProperty.Command

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html#cfn-ecs-taskdefinition-healthcheck-command

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[]
interval

CfnTaskDefinition.HealthCheckProperty.Interval

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html#cfn-ecs-taskdefinition-healthcheck-interval

Type:number or @aws-cdk/cdk.Token (optional)
retries

CfnTaskDefinition.HealthCheckProperty.Retries

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html#cfn-ecs-taskdefinition-healthcheck-retries

Type:number or @aws-cdk/cdk.Token (optional)
startPeriod

CfnTaskDefinition.HealthCheckProperty.StartPeriod

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html#cfn-ecs-taskdefinition-healthcheck-startperiod

Type:number or @aws-cdk/cdk.Token (optional)
timeout

CfnTaskDefinition.HealthCheckProperty.Timeout

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html#cfn-ecs-taskdefinition-healthcheck-timeout

Type:number or @aws-cdk/cdk.Token (optional)
class HostEntryProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.HostEntryProperty;
// CfnTaskDefinition.HostEntryProperty is an interface
import { CfnTaskDefinition.HostEntryProperty } from '@aws-cdk/aws-ecs';
hostname

CfnTaskDefinition.HostEntryProperty.Hostname

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-hostentry.html#cfn-ecs-taskdefinition-containerdefinition-hostentry-hostname

Type:string
ipAddress

CfnTaskDefinition.HostEntryProperty.IpAddress

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-hostentry.html#cfn-ecs-taskdefinition-containerdefinition-hostentry-ipaddress

Type:string
class HostVolumePropertiesProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.HostVolumePropertiesProperty;
// CfnTaskDefinition.HostVolumePropertiesProperty is an interface
import { CfnTaskDefinition.HostVolumePropertiesProperty } from '@aws-cdk/aws-ecs';
sourcePath

CfnTaskDefinition.HostVolumePropertiesProperty.SourcePath

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volumes-host.html#cfn-ecs-taskdefinition-volumes-host-sourcepath

Type:string (optional)
class KernelCapabilitiesProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.KernelCapabilitiesProperty;
// CfnTaskDefinition.KernelCapabilitiesProperty is an interface
import { CfnTaskDefinition.KernelCapabilitiesProperty } from '@aws-cdk/aws-ecs';
add

CfnTaskDefinition.KernelCapabilitiesProperty.Add

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-kernelcapabilities.html#cfn-ecs-taskdefinition-kernelcapabilities-add

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
drop

CfnTaskDefinition.KernelCapabilitiesProperty.Drop

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-kernelcapabilities.html#cfn-ecs-taskdefinition-kernelcapabilities-drop

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
class KeyValuePairProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.KeyValuePairProperty;
// CfnTaskDefinition.KeyValuePairProperty is an interface
import { CfnTaskDefinition.KeyValuePairProperty } from '@aws-cdk/aws-ecs';
name

CfnTaskDefinition.KeyValuePairProperty.Name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-environment.html#cfn-ecs-taskdefinition-containerdefinition-environment-name

Type:string (optional)
value

CfnTaskDefinition.KeyValuePairProperty.Value

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-environment.html#cfn-ecs-taskdefinition-containerdefinition-environment-value

Type:string (optional)
class LinuxParametersProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.LinuxParametersProperty;
// CfnTaskDefinition.LinuxParametersProperty is an interface
import { CfnTaskDefinition.LinuxParametersProperty } from '@aws-cdk/aws-ecs';
capabilities

CfnTaskDefinition.LinuxParametersProperty.Capabilities

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-capabilities

Type:@aws-cdk/cdk.Token or KernelCapabilitiesProperty (optional)
devices

CfnTaskDefinition.LinuxParametersProperty.Devices

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-devices

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or DeviceProperty)[] (optional)
initProcessEnabled

CfnTaskDefinition.LinuxParametersProperty.InitProcessEnabled

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-initprocessenabled

Type:boolean or @aws-cdk/cdk.Token (optional)
sharedMemorySize

CfnTaskDefinition.LinuxParametersProperty.SharedMemorySize

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-sharedmemorysize

Type:number or @aws-cdk/cdk.Token (optional)
tmpfs

CfnTaskDefinition.LinuxParametersProperty.Tmpfs

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-linuxparameters.html#cfn-ecs-taskdefinition-linuxparameters-tmpfs

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or TmpfsProperty)[] (optional)
class LogConfigurationProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.LogConfigurationProperty;
// CfnTaskDefinition.LogConfigurationProperty is an interface
import { CfnTaskDefinition.LogConfigurationProperty } from '@aws-cdk/aws-ecs';
logDriver

CfnTaskDefinition.LogConfigurationProperty.LogDriver

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-logconfiguration.html#cfn-ecs-taskdefinition-containerdefinition-logconfiguration-logdriver

Type:string
options

CfnTaskDefinition.LogConfigurationProperty.Options

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-logconfiguration.html#cfn-ecs-taskdefinition-containerdefinition-logconfiguration-options

Type:@aws-cdk/cdk.Token or string => (string or @aws-cdk/cdk.Token) (optional)
class MountPointProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.MountPointProperty;
// CfnTaskDefinition.MountPointProperty is an interface
import { CfnTaskDefinition.MountPointProperty } from '@aws-cdk/aws-ecs';
containerPath

CfnTaskDefinition.MountPointProperty.ContainerPath

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-mountpoints.html#cfn-ecs-taskdefinition-containerdefinition-mountpoints-containerpath

Type:string (optional)
readOnly

CfnTaskDefinition.MountPointProperty.ReadOnly

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-mountpoints.html#cfn-ecs-taskdefinition-containerdefinition-mountpoints-readonly

Type:boolean or @aws-cdk/cdk.Token (optional)
sourceVolume

CfnTaskDefinition.MountPointProperty.SourceVolume

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-mountpoints.html#cfn-ecs-taskdefinition-containerdefinition-mountpoints-sourcevolume

Type:string (optional)
class PortMappingProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.PortMappingProperty;
// CfnTaskDefinition.PortMappingProperty is an interface
import { CfnTaskDefinition.PortMappingProperty } from '@aws-cdk/aws-ecs';
containerPort

CfnTaskDefinition.PortMappingProperty.ContainerPort

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-containerport

Type:number or @aws-cdk/cdk.Token (optional)
hostPort

CfnTaskDefinition.PortMappingProperty.HostPort

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-readonly

Type:number or @aws-cdk/cdk.Token (optional)
protocol

CfnTaskDefinition.PortMappingProperty.Protocol

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-portmappings.html#cfn-ecs-taskdefinition-containerdefinition-portmappings-sourcevolume

Type:string (optional)
class RepositoryCredentialsProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.RepositoryCredentialsProperty;
// CfnTaskDefinition.RepositoryCredentialsProperty is an interface
import { CfnTaskDefinition.RepositoryCredentialsProperty } from '@aws-cdk/aws-ecs';
credentialsParameter

CfnTaskDefinition.RepositoryCredentialsProperty.CredentialsParameter

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-repositorycredentials.html#cfn-ecs-taskdefinition-repositorycredentials-credentialsparameter

Type:string (optional)
class TaskDefinitionPlacementConstraintProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.TaskDefinitionPlacementConstraintProperty;
// CfnTaskDefinition.TaskDefinitionPlacementConstraintProperty is an interface
import { CfnTaskDefinition.TaskDefinitionPlacementConstraintProperty } from '@aws-cdk/aws-ecs';
type

CfnTaskDefinition.TaskDefinitionPlacementConstraintProperty.Type

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-taskdefinitionplacementconstraint.html#cfn-ecs-taskdefinition-taskdefinitionplacementconstraint-type

Type:string
expression

CfnTaskDefinition.TaskDefinitionPlacementConstraintProperty.Expression

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-taskdefinitionplacementconstraint.html#cfn-ecs-taskdefinition-taskdefinitionplacementconstraint-expression

Type:string (optional)
class TmpfsProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.TmpfsProperty;
// CfnTaskDefinition.TmpfsProperty is an interface
import { CfnTaskDefinition.TmpfsProperty } from '@aws-cdk/aws-ecs';
containerPath

CfnTaskDefinition.TmpfsProperty.ContainerPath

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-tmpfs.html#cfn-ecs-taskdefinition-tmpfs-containerpath

Type:string (optional)
mountOptions

CfnTaskDefinition.TmpfsProperty.MountOptions

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-tmpfs.html#cfn-ecs-taskdefinition-tmpfs-mountoptions

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
size

CfnTaskDefinition.TmpfsProperty.Size

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-tmpfs.html#cfn-ecs-taskdefinition-tmpfs-size

Type:number or @aws-cdk/cdk.Token (optional)
class UlimitProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.UlimitProperty;
// CfnTaskDefinition.UlimitProperty is an interface
import { CfnTaskDefinition.UlimitProperty } from '@aws-cdk/aws-ecs';
hardLimit

CfnTaskDefinition.UlimitProperty.HardLimit

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-ulimit.html#cfn-ecs-taskdefinition-containerdefinition-ulimit-hardlimit

Type:number or @aws-cdk/cdk.Token
name

CfnTaskDefinition.UlimitProperty.Name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-ulimit.html#cfn-ecs-taskdefinition-containerdefinition-ulimit-name

Type:string
softLimit

CfnTaskDefinition.UlimitProperty.SoftLimit

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-ulimit.html#cfn-ecs-taskdefinition-containerdefinition-ulimit-softlimit

Type:number or @aws-cdk/cdk.Token
class VolumeFromProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.VolumeFromProperty;
// CfnTaskDefinition.VolumeFromProperty is an interface
import { CfnTaskDefinition.VolumeFromProperty } from '@aws-cdk/aws-ecs';
readOnly

CfnTaskDefinition.VolumeFromProperty.ReadOnly

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-volumesfrom.html#cfn-ecs-taskdefinition-containerdefinition-volumesfrom-readonly

Type:boolean or @aws-cdk/cdk.Token (optional)
sourceContainer

CfnTaskDefinition.VolumeFromProperty.SourceContainer

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions-volumesfrom.html#cfn-ecs-taskdefinition-containerdefinition-volumesfrom-sourcecontainer

Type:string (optional)
class VolumeProperty

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinition.VolumeProperty;
// CfnTaskDefinition.VolumeProperty is an interface
import { CfnTaskDefinition.VolumeProperty } from '@aws-cdk/aws-ecs';
dockerVolumeConfiguration

CfnTaskDefinition.VolumeProperty.DockerVolumeConfiguration

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volumes.html#cfn-ecs-taskdefinition-volume-dockervolumeconfiguration

Type:@aws-cdk/cdk.Token or DockerVolumeConfigurationProperty (optional)
host

CfnTaskDefinition.VolumeProperty.Host

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volumes.html#cfn-ecs-taskdefinition-volumes-host

Type:@aws-cdk/cdk.Token or HostVolumePropertiesProperty (optional)
name

CfnTaskDefinition.VolumeProperty.Name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-volumes.html#cfn-ecs-taskdefinition-volumes-name

Type:string (optional)
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)
ref

Inherited from @aws-cdk/cdk.Referenceable

Returns a token to a CloudFormation { Ref } that references this entity based on it’s logical ID.

Type:string (readonly)
addDeletionOverride(path)

Inherited from @aws-cdk/cdk.Resource

Syntactic sugar for addOverride(path, undefined).

Parameters:path (string) – The path of the value to delete
addDependsOn(resource)

Inherited from @aws-cdk/cdk.Resource

Indicates that this resource depends on another resource and cannot be provisioned

unless the other resource has been successfully provisioned.

Parameters:resource (@aws-cdk/cdk.Resource) –
addOverride(path, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to the synthesized CloudFormation resource. To add a

property override, either use addPropertyOverride or prefix path with

“Properties.” (i.e. Properties.TopicName).

Parameters:
  • path (string) – The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
  • value (any) – The value. Could be primitive or complex.
addPropertyDeletionOverride(propertyPath)

Inherited from @aws-cdk/cdk.Resource

Adds an override that deletes the value of a property from the resource definition.

Parameters:propertyPath (string) – The path to the property.
addPropertyOverride(propertyPath, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to a resource property.

Syntactic sugar for addOverride(“Properties.<…>”, value).

Parameters:
  • propertyPath (string) – The path of the property
  • value (any) – The value
getAtt(attributeName) → @aws-cdk/cdk.CfnReference

Inherited from @aws-cdk/cdk.Resource

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility

in case there is no generated attribute.

Parameters:attributeName (string) – The name of the attribute.
Return type:@aws-cdk/cdk.CfnReference
toCloudFormation() → json

Inherited from @aws-cdk/cdk.Resource

Emits CloudFormation for this resource.

Return type:json
options

Inherited from @aws-cdk/cdk.Resource

Options for this resource, such as condition, update policy etc.

Type:@aws-cdk/cdk.ResourceOptions (readonly)
properties

Inherited from @aws-cdk/cdk.Resource

AWS resource properties.

This object is rendered via a call to “renderProperties(this.properties)”.

Protected property

Type:any (readonly)
resourceType

Inherited from @aws-cdk/cdk.Resource

AWS resource type.

Type:string (readonly)
untypedPropertyOverrides

Inherited from @aws-cdk/cdk.Resource

AWS resource property overrides.

During synthesis, the method “renderProperties(this.overrides)” is called

with this object, and merged on top of the output of

“renderProperties(this.properties)”.

Derived classes should expose a strongly-typed version of this object as

a public property called propertyOverrides.

Protected property

Type:any (readonly)
overrideLogicalId(newLogicalId)

Inherited from @aws-cdk/cdk.StackElement

Overrides the auto-generated logical ID with a specific ID.

Parameters:newLogicalId (string) – The new logical ID to use for this stack element.
prepare()

Inherited from @aws-cdk/cdk.StackElement

Automatically detect references in this StackElement

Protected method

creationStackTrace

Inherited from @aws-cdk/cdk.StackElement

Type:string[] (readonly)
logicalId

Inherited from @aws-cdk/cdk.StackElement

The logical ID for this CloudFormation stack element. The logical ID of the element

is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Type:string (readonly)
stackPath

Inherited from @aws-cdk/cdk.StackElement

Return the path with respect to the stack

Type:string (readonly)

CfnTaskDefinitionProps (interface)

class @aws-cdk/aws-ecs.CfnTaskDefinitionProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CfnTaskDefinitionProps;
// CfnTaskDefinitionProps is an interface
import { CfnTaskDefinitionProps } from '@aws-cdk/aws-ecs';
containerDefinitions

AWS::ECS::TaskDefinition.ContainerDefinitions

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-containerdefinitions

Type:@aws-cdk/cdk.Token or (ContainerDefinitionProperty or @aws-cdk/cdk.Token)[] (optional)
cpu

AWS::ECS::TaskDefinition.Cpu

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-cpu

Type:string (optional)
executionRoleArn

AWS::ECS::TaskDefinition.ExecutionRoleArn

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-executionrolearn

Type:string (optional)
family

AWS::ECS::TaskDefinition.Family

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-family

Type:string (optional)
memory

AWS::ECS::TaskDefinition.Memory

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-memory

Type:string (optional)
networkMode

AWS::ECS::TaskDefinition.NetworkMode

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-networkmode

Type:string (optional)
placementConstraints

AWS::ECS::TaskDefinition.PlacementConstraints

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-placementconstraints

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or TaskDefinitionPlacementConstraintProperty)[] (optional)
requiresCompatibilities

AWS::ECS::TaskDefinition.RequiresCompatibilities

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-requirescompatibilities

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
taskRoleArn

AWS::ECS::TaskDefinition.TaskRoleArn

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-taskrolearn

Type:string (optional)
volumes

AWS::ECS::TaskDefinition.Volumes

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-volumes

Type:@aws-cdk/cdk.Token or (@aws-cdk/cdk.Token or VolumeProperty)[] (optional)

Cluster

class @aws-cdk/aws-ecs.Cluster(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.Cluster;
const { Cluster } = require('@aws-cdk/aws-ecs');
import { Cluster } from '@aws-cdk/aws-ecs';

A container cluster that runs on your EC2 instances

Extends:

@aws-cdk/cdk.Construct

Implements:

ICluster

Parameters:
static import(scope, id, props) → @aws-cdk/aws-ecs.ICluster

Import an existing cluster

Parameters:
Return type:

ICluster

addAutoScalingGroup(autoScalingGroup[, options])

Add compute capacity to this ECS cluster in the form of an AutoScalingGroup

Parameters:
addCapacity(id, options) → @aws-cdk/aws-autoscaling.AutoScalingGroup

Add a default-configured AutoScalingGroup running the ECS-optimized AMI to this Cluster

Returns the AutoScalingGroup so you can add autoscaling settings to it.

Parameters:
Return type:

@aws-cdk/aws-autoscaling.AutoScalingGroup

export() → @aws-cdk/aws-ecs.ClusterImportProps

Implements @aws-cdk/aws-ecs.ICluster.export()

Export the Cluster

Return type:ClusterImportProps
metric(metricName[, props]) → @aws-cdk/aws-cloudwatch.Metric

Return the given named metric for this Cluster

Parameters:
Return type:

@aws-cdk/aws-cloudwatch.Metric

metricCpuReservation([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for cluster CPU reservation

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricMemoryReservation([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for cluster Memory reservation

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
clusterArn

Implements @aws-cdk/aws-ecs.ICluster.clusterArn()

The ARN of this cluster

Type:string (readonly)
clusterName

Implements @aws-cdk/aws-ecs.ICluster.clusterName()

The name of this cluster

Type:string (readonly)
connections

Implements @aws-cdk/aws-ecs.ICluster.connections()

Connections manager for the EC2 cluster

Type:@aws-cdk/aws-ec2.Connections (readonly)
hasEc2Capacity

Implements @aws-cdk/aws-ecs.ICluster.hasEc2Capacity()

Whether the cluster has EC2 capacity associated with it

Type:boolean (readonly)
vpc

Implements @aws-cdk/aws-ecs.ICluster.vpc()

The VPC this cluster was created in.

Type:@aws-cdk/aws-ec2.IVpcNetwork (readonly)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

ClusterImportProps (interface)

class @aws-cdk/aws-ecs.ClusterImportProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.ClusterImportProps;
// ClusterImportProps is an interface
import { ClusterImportProps } from '@aws-cdk/aws-ecs';

Properties to import an ECS cluster

clusterName

Name of the cluster

Type:string
securityGroups

Security group of the cluster instances

Type:@aws-cdk/aws-ec2.SecurityGroupImportProps[]
vpc

VPC that the cluster instances are running in

Type:@aws-cdk/aws-ec2.VpcNetworkImportProps
clusterArn

ARN of the cluster

Type:string (optional)
Default:Derived from clusterName
hasEc2Capacity

Whether the given cluster has EC2 capacity

Type:boolean (optional)
Default:true

ClusterProps (interface)

class @aws-cdk/aws-ecs.ClusterProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.ClusterProps;
// ClusterProps is an interface
import { ClusterProps } from '@aws-cdk/aws-ecs';

Properties to define an ECS cluster

vpc

The VPC where your ECS instances will be running or your ENIs will be deployed

Type:@aws-cdk/aws-ec2.IVpcNetwork
clusterName

A name for the cluster.

Type:string (optional)
Default:CloudFormation-generated name

CommonTaskDefinitionProps (interface)

class @aws-cdk/aws-ecs.CommonTaskDefinitionProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CommonTaskDefinitionProps;
// CommonTaskDefinitionProps is an interface
import { CommonTaskDefinitionProps } from '@aws-cdk/aws-ecs';

Properties common to all Task definitions

executionRole

The IAM role assumed by the ECS agent.

The role will be used to retrieve container images from ECR and

create CloudWatch log groups.

Type:@aws-cdk/aws-iam.Role (optional)
Default:An execution role will be automatically created if you use ECR images in your task definition
family

Namespace for task definition versions

Type:string (optional)
Default:Automatically generated name
taskRole

The IAM role assumable by your application code running inside the container

Type:@aws-cdk/aws-iam.Role (optional)
Default:A task role is automatically created for you
volumes

See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide//task_definition_parameters.html#volumes

Type:Volume[] (optional)

Compatibility (enum)

class @aws-cdk/aws-ecs.Compatibility

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.Compatibility;
const { Compatibility } = require('@aws-cdk/aws-ecs');
import { Compatibility } from '@aws-cdk/aws-ecs';

Task compatibility

Ec2

Task should be launchable on EC2 clusters

Fargate

Task should be launchable on Fargate clusters

Ec2AndFargate

Task should be launchable on both types of clusters

ContainerDefinition

class @aws-cdk/aws-ecs.ContainerDefinition(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.ContainerDefinition;
const { ContainerDefinition } = require('@aws-cdk/aws-ecs');
import { ContainerDefinition } from '@aws-cdk/aws-ecs';

A definition for a single container in a Task

Extends:

@aws-cdk/cdk.Construct

Parameters:

Add a link from this container to a different container

The link parameter allows containers to communicate with each other without the need for port mappings.

Only supported if the network mode of a task definition is set to bridge.

Warning: The –link flag is a legacy feature of Docker. It may eventually be removed.

Parameters:
addMountPoints(*mountPoints)

Add one or more mount points to this container.

Parameters:*mountPoints (MountPoint) –
addPortMappings(*portMappings)

Add one or more port mappings to this container

Parameters:*portMappings (PortMapping) –
addScratch(scratch)

Mount temporary disc space to a container.

This adds the correct container mountPoint and task definition volume.

Parameters:scratch (ScratchSpace) –
addToExecutionPolicy(statement)

Add a statement to the Task Definition’s Execution policy

Parameters:statement (@aws-cdk/aws-iam.PolicyStatement) –
addUlimits(*ulimits)

Add one or more ulimits to this container

Parameters:*ulimits (Ulimit) –
addVolumesFrom(*volumesFrom)

Add one or more volumes to this container

Parameters:*volumesFrom (VolumeFrom) –
renderContainerDefinition() → @aws-cdk/aws-ecs.CfnTaskDefinition.ContainerDefinitionProperty

Render this container definition to a CloudFormation object

Return type:ContainerDefinitionProperty
containerPort

Return the port that the container will be listening on by default

Type:number (readonly)
essential

Whether or not this container is essential

Type:boolean (readonly)
ingressPort

Ingress Port is needed to set the security group ingress for the task/service

Type:number (readonly)
linuxParameters

Access Linux Parameters

Type:LinuxParameters (readonly)
memoryLimitSpecified

Whether there was at least one memory limit specified in this definition

Type:boolean (readonly)
mountPoints

The configured mount points

Type:MountPoint[] (readonly)
portMappings

The configured port mappings

Type:PortMapping[] (readonly)
props
Type:ContainerDefinitionProps (readonly)
taskDefinition

The task definition this container definition is part of

Type:TaskDefinition (readonly)
ulimits

The configured ulimits

Type:Ulimit[] (readonly)
volumesFrom

The configured volumes

Type:VolumeFrom[] (readonly)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

ContainerDefinitionOptions (interface)

class @aws-cdk/aws-ecs.ContainerDefinitionOptions

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.ContainerDefinitionOptions;
// ContainerDefinitionOptions is an interface
import { ContainerDefinitionOptions } from '@aws-cdk/aws-ecs';
image

The image to use for a container.

You can use images in the Docker Hub registry or specify other

repositories (repository-url/image:tag).

TODO: Update these to specify using classes of IContainerImage

Type:ContainerImage
command

The CMD value to pass to the container.

If you provide a shell command as a single string, you have to quote command-line arguments.

Type:string[] (optional)
Default:CMD value built into container image
cpu

The minimum number of CPU units to reserve for the container.

Type:number (optional)
disableNetworking

Indicates whether networking is disabled within the container.

Type:boolean (optional)
Default:false
dnsSearchDomains

A list of DNS search domains that are provided to the container.

Type:string[] (optional)
Default:No search domains
dnsServers

A list of DNS servers that Amazon ECS provides to the container.

Type:string[] (optional)
Default:Default DNS servers
dockerLabels

A key-value map of labels for the container.

Type:string => string (optional)
Default:No labels
dockerSecurityOptions

A list of custom labels for SELinux and AppArmor multi-level security systems.

Type:string[] (optional)
Default:No security labels
entryPoint

The ENTRYPOINT value to pass to the container.

Type:string[] (optional)
Default:Entry point configured in container
environment

The environment variables to pass to the container.

Type:string => string (optional)
Default:No environment variables
essential

Indicates whether the task stops if this container fails.

If you specify true and the container fails, all other containers in the

task stop. If you specify false and the container fails, none of the other

containers in the task is affected.

You must have at least one essential container in a task.

Type:boolean (optional)
Default:true
extraHosts

A list of hostnames and IP address mappings to append to the /etc/hosts file on the container.

Type:string => string (optional)
Default:No extra hosts
healthCheck

Container health check.

Type:HealthCheck (optional)
Default:Health check configuration from container
hostname

The name that Docker uses for the container hostname.

Type:string (optional)
Default:Automatic hostname
logging

Configures a custom log driver for the container.

Type:LogDriver (optional)
memoryLimitMiB

The hard limit (in MiB) of memory to present to the container.

If your container attempts to exceed the allocated memory, the container

is terminated.

At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.

Type:number (optional)
memoryReservationMiB

The soft limit (in MiB) of memory to reserve for the container.

When system memory is under contention, Docker attempts to keep the

container memory within the limit. If the container requires more memory,

it can consume up to the value specified by the Memory property or all of

the available memory on the container instance—whichever comes first.

At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.

Type:number (optional)
privileged

Indicates whether the container is given full access to the host container instance.

Type:boolean (optional)
Default:false
readonlyRootFilesystem

Indicates whether the container’s root file system is mounted as read only.

Type:boolean (optional)
Default:false
user

The user name to use inside the container.

Type:string (optional)
Default:root
workingDirectory

The working directory in the container to run commands in.

Type:string (optional)
Default:/

ContainerDefinitionProps (interface)

class @aws-cdk/aws-ecs.ContainerDefinitionProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.ContainerDefinitionProps;
// ContainerDefinitionProps is an interface
import { ContainerDefinitionProps } from '@aws-cdk/aws-ecs';

Properties of a container definition

Extends:ContainerDefinitionOptions
taskDefinition

The task this container definition belongs to.

Type:TaskDefinition
image

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

The image to use for a container.

You can use images in the Docker Hub registry or specify other

repositories (repository-url/image:tag).

TODO: Update these to specify using classes of IContainerImage

Type:ContainerImage
command

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

The CMD value to pass to the container.

If you provide a shell command as a single string, you have to quote command-line arguments.

Type:string[] (optional)
Default:CMD value built into container image
cpu

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

The minimum number of CPU units to reserve for the container.

Type:number (optional)
disableNetworking

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

Indicates whether networking is disabled within the container.

Type:boolean (optional)
Default:false
dnsSearchDomains

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

A list of DNS search domains that are provided to the container.

Type:string[] (optional)
Default:No search domains
dnsServers

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

A list of DNS servers that Amazon ECS provides to the container.

Type:string[] (optional)
Default:Default DNS servers
dockerLabels

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

A key-value map of labels for the container.

Type:string => string (optional)
Default:No labels
dockerSecurityOptions

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

A list of custom labels for SELinux and AppArmor multi-level security systems.

Type:string[] (optional)
Default:No security labels
entryPoint

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

The ENTRYPOINT value to pass to the container.

Type:string[] (optional)
Default:Entry point configured in container
environment

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

The environment variables to pass to the container.

Type:string => string (optional)
Default:No environment variables
essential

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

Indicates whether the task stops if this container fails.

If you specify true and the container fails, all other containers in the

task stop. If you specify false and the container fails, none of the other

containers in the task is affected.

You must have at least one essential container in a task.

Type:boolean (optional)
Default:true
extraHosts

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

A list of hostnames and IP address mappings to append to the /etc/hosts file on the container.

Type:string => string (optional)
Default:No extra hosts
healthCheck

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

Container health check.

Type:HealthCheck (optional)
Default:Health check configuration from container
hostname

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

The name that Docker uses for the container hostname.

Type:string (optional)
Default:Automatic hostname
logging

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

Configures a custom log driver for the container.

Type:LogDriver (optional)
memoryLimitMiB

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

The hard limit (in MiB) of memory to present to the container.

If your container attempts to exceed the allocated memory, the container

is terminated.

At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.

Type:number (optional)
memoryReservationMiB

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

The soft limit (in MiB) of memory to reserve for the container.

When system memory is under contention, Docker attempts to keep the

container memory within the limit. If the container requires more memory,

it can consume up to the value specified by the Memory property or all of

the available memory on the container instance—whichever comes first.

At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.

Type:number (optional)
privileged

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

Indicates whether the container is given full access to the host container instance.

Type:boolean (optional)
Default:false
readonlyRootFilesystem

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

Indicates whether the container’s root file system is mounted as read only.

Type:boolean (optional)
Default:false
user

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

The user name to use inside the container.

Type:string (optional)
Default:root
workingDirectory

Inherited from @aws-cdk/aws-ecs.ContainerDefinitionOptions

The working directory in the container to run commands in.

Type:string (optional)
Default:/

ContainerImage

class @aws-cdk/aws-ecs.ContainerImage

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.ContainerImage;
const { ContainerImage } = require('@aws-cdk/aws-ecs');
import { ContainerImage } from '@aws-cdk/aws-ecs';

Constructs for types of container images

Abstract:Yes
static fromAsset(scope, id, props) → @aws-cdk/aws-ecs.AssetImage

Reference an image that’s constructed directly from sources on disk

Parameters:
Return type:

AssetImage

static fromDockerHub(name) → @aws-cdk/aws-ecs.DockerHubImage

Reference an image on DockerHub

Parameters:name (string) –
Return type:DockerHubImage
static fromEcrRepository(repository[, tag]) → @aws-cdk/aws-ecs.EcrImage

Reference an image in an ECR repository

Parameters:
Return type:

EcrImage

bind(containerDefinition)

Called when the image is used by a ContainerDefinition

Parameters:containerDefinition (ContainerDefinition) –
Abstract:Yes
imageName

Name of the image

Type:string (readonly) (abstract)

CpuUtilizationScalingProps (interface)

class @aws-cdk/aws-ecs.CpuUtilizationScalingProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.CpuUtilizationScalingProps;
// CpuUtilizationScalingProps is an interface
import { CpuUtilizationScalingProps } from '@aws-cdk/aws-ecs';

Properties for enabling scaling based on CPU utilization

Extends:@aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps
targetUtilizationPercent

Target average CPU utilization across the task

Type:number
disableScaleIn

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

Indicates whether scale in by the target tracking policy is disabled.

If the value is true, scale in is disabled and the target tracking policy

won’t remove capacity from the scalable resource. Otherwise, scale in is

enabled and the target tracking policy can remove capacity from the

scalable resource.

Type:boolean (optional)
Default:false
policyName

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

A name for the scaling policy

Type:string (optional)
Default:Automatically generated name
scaleInCooldownSec

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

Period after a scale in activity completes before another scale in activity can start.

Type:number (optional)
Default:No scale in cooldown
scaleOutCooldownSec

Inherited from @aws-cdk/aws-applicationautoscaling.BaseTargetTrackingProps

Period after a scale out activity completes before another scale out activity can start.

Type:number (optional)
Default:No scale out cooldown

Device (interface)

class @aws-cdk/aws-ecs.Device

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.Device;
// Device is an interface
import { Device } from '@aws-cdk/aws-ecs';

A host device

hostPath

Path on the host

Type:string
containerPath

Path in the container

Type:string (optional)
Default:Same path as the host
permissions

Permissions

Type:DevicePermission[] (optional)
Default:Readonly

DevicePermission (enum)

class @aws-cdk/aws-ecs.DevicePermission

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.DevicePermission;
const { DevicePermission } = require('@aws-cdk/aws-ecs');
import { DevicePermission } from '@aws-cdk/aws-ecs';

Permissions for device access

Read

Read

Write

Write

Mknod

Make a node

DockerHubImage

class @aws-cdk/aws-ecs.DockerHubImage(imageName)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.DockerHubImage;
const { DockerHubImage } = require('@aws-cdk/aws-ecs');
import { DockerHubImage } from '@aws-cdk/aws-ecs';

A DockerHub image

Extends:ContainerImage
Parameters:imageName (string) –
bind(_containerDefinition)

Implements @aws-cdk/aws-ecs.ContainerImage.bind()

Called when the image is used by a ContainerDefinition

Parameters:_containerDefinition (ContainerDefinition) –
imageName

Implements @aws-cdk/aws-ecs.ContainerImage.imageName()

Type:string (readonly)

DockerVolumeConfiguration (interface)

class @aws-cdk/aws-ecs.DockerVolumeConfiguration

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.DockerVolumeConfiguration;
// DockerVolumeConfiguration is an interface
import { DockerVolumeConfiguration } from '@aws-cdk/aws-ecs';

A configuration of a Docker volume

driver

The Docker volume driver to use

Type:string
scope

The scope for the Docker volume which determines it’s lifecycle

Type:Scope
autoprovision

If true, the Docker volume is created if it does not already exist

Type:boolean (optional)
Default:false
driverOpts

A map of Docker driver specific options passed through

Type:string[] (optional)
Default:No options
labels

Custom metadata to add to your Docker volume

Type:string[] (optional)
Default:No labels

Ec2EventRuleTarget

class @aws-cdk/aws-ecs.Ec2EventRuleTarget(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.Ec2EventRuleTarget;
const { Ec2EventRuleTarget } = require('@aws-cdk/aws-ecs');
import { Ec2EventRuleTarget } from '@aws-cdk/aws-ecs';

Start a service on an EC2 cluster

Extends:

@aws-cdk/cdk.Construct

Implements:

@aws-cdk/aws-events.IEventRuleTarget

Parameters:
asEventRuleTarget(_ruleArn, _ruleUniqueId) → @aws-cdk/aws-events.EventRuleTargetProps

Implements @aws-cdk/aws-events.IEventRuleTarget.asEventRuleTarget()

Allows using containers as target of CloudWatch events

Parameters:
  • _ruleArn (string) –
  • _ruleUniqueId (string) –
Return type:

@aws-cdk/aws-events.EventRuleTargetProps

prepare()

Overrides @aws-cdk/cdk.Construct.prepare()

Prepare the Event Rule Target

Protected method

eventsRole

Create or get the IAM Role used to start this Task Definition.

We create it under the TaskDefinition object so that if we have multiple EventTargets

they can reuse the same role.

Type:@aws-cdk/aws-iam.IRole (readonly)
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

Ec2EventRuleTargetProps (interface)

class @aws-cdk/aws-ecs.Ec2EventRuleTargetProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.Ec2EventRuleTargetProps;
// Ec2EventRuleTargetProps is an interface
import { Ec2EventRuleTargetProps } from '@aws-cdk/aws-ecs';

Properties to define an EC2 Event Task

cluster

Cluster where service will be deployed

Type:ICluster
taskDefinition

Task Definition of the task that should be started

Type:TaskDefinition
taskCount

How many tasks should be started when this event is triggered

Type:number (optional)
Default:1

Ec2Service

class @aws-cdk/aws-ecs.Ec2Service(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.Ec2Service;
const { Ec2Service } = require('@aws-cdk/aws-ecs');
import { Ec2Service } from '@aws-cdk/aws-ecs';

Start a service on an ECS cluster

Extends:

BaseService

Implements:

@aws-cdk/aws-elasticloadbalancing.ILoadBalancerTarget

Parameters:
attachToClassicLB(loadBalancer)

Implements @aws-cdk/aws-elasticloadbalancing.ILoadBalancerTarget.attachToClassicLB()

Register this service as the target of a Classic Load Balancer

Don’t call this. Call loadBalancer.addTarget() instead.

Parameters:loadBalancer (@aws-cdk/aws-elasticloadbalancing.LoadBalancer) –
metric(metricName[, props]) → @aws-cdk/aws-cloudwatch.Metric

Overrides @aws-cdk/aws-ecs.BaseService.metric()

Return the given named metric for this Service

Parameters:
Return type:

@aws-cdk/aws-cloudwatch.Metric

metricCpuUtilization([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for cluster CPU utilization

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
metricMemoryUtilization([props]) → @aws-cdk/aws-cloudwatch.Metric

Metric for cluster Memory utilization

Parameters:props (@aws-cdk/aws-cloudwatch.MetricCustomization (optional)) –
Return type:@aws-cdk/aws-cloudwatch.Metric
placeOnMemberOf(*expressions)

Place services only on instances matching the given query expression

You can specify multiple expressions in one call. The tasks will only

be placed on instances matching all expressions.

Parameters:*expressions (string) –
placePackedBy(resource)

Try to place tasks on instances with the least amount of indicated resource available

This ensures the total consumption of this resource is lowest.

Parameters:resource (BinPackResource) –
placeRandomly()

Place tasks randomly across the available instances.

placeSpreadAcross(*fields)

Try to place tasks spread across instance attributes.

You can use one of the built-in attributes found on BuiltInAttributes

or supply your own custom instance attributes. If more than one attribute

is supplied, spreading is done in order.

Parameters:*fields (string) –
validate() → string[]

Overrides @aws-cdk/cdk.Construct.validate()

Validate this Ec2Service

Protected method

Return type:string[]
clusterName

Overrides @aws-cdk/aws-ecs.BaseService.clusterName

Name of the cluster

Type:string (readonly)
attachToApplicationTargetGroup(targetGroup) → @aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps

Inherited from @aws-cdk/aws-ecs.BaseService

Called when the service is attached to an ALB

Don’t call this function directly. Instead, call listener.addTarget()

to add this service to a load balancer.

Parameters:targetGroup (@aws-cdk/aws-elasticloadbalancingv2.ApplicationTargetGroup) –
Return type:@aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps
attachToNetworkTargetGroup(targetGroup) → @aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps

Inherited from @aws-cdk/aws-ecs.BaseService

Called when the service is attached to an NLB

Don’t call this function directly. Instead, call listener.addTarget()

to add this service to a load balancer.

Parameters:targetGroup (@aws-cdk/aws-elasticloadbalancingv2.NetworkTargetGroup) –
Return type:@aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps
autoScaleTaskCount(props) → @aws-cdk/aws-ecs.ScalableTaskCount

Inherited from @aws-cdk/aws-ecs.BaseService

Enable autoscaling for the number of tasks in this service

Parameters:props (@aws-cdk/aws-applicationautoscaling.EnableScalingProps) –
Return type:ScalableTaskCount
configureAwsVpcNetworking(vpc[, assignPublicIp[, vpcPlacement[, securityGroup]]])

Inherited from @aws-cdk/aws-ecs.BaseService

Set up AWSVPC networking for this construct

Protected method

Parameters:
connections

Inherited from @aws-cdk/aws-ecs.BaseService

Manage allowed network traffic for this service

Type:@aws-cdk/aws-ec2.Connections (readonly)
serviceArn

Inherited from @aws-cdk/aws-ecs.BaseService

ARN of this service

Type:string (readonly)
serviceName

Inherited from @aws-cdk/aws-ecs.BaseService

Name of this service

Type:string (readonly)
taskDefinition

Inherited from @aws-cdk/aws-ecs.BaseService

Task definition this service is associated with

Type:TaskDefinition (readonly)
loadBalancers

Inherited from @aws-cdk/aws-ecs.BaseService

Protected property

Type:LoadBalancerProperty[]
networkConfiguration

Inherited from @aws-cdk/aws-ecs.BaseService

Protected property

Type:NetworkConfigurationProperty (optional)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

Ec2ServiceProps (interface)

class @aws-cdk/aws-ecs.Ec2ServiceProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.Ec2ServiceProps;
// Ec2ServiceProps is an interface
import { Ec2ServiceProps } from '@aws-cdk/aws-ecs';

Properties to define an ECS service

Extends:BaseServiceProps
cluster

Cluster where service will be deployed

Type:ICluster
taskDefinition

Task Definition used for running tasks in the service

Type:TaskDefinition
daemon

Deploy exactly one task on each instance in your cluster.

When using this strategy, do not specify a desired number of tasks or any

task placement strategies.

Type:boolean (optional)
Default:false
placeOnDistinctInstances

Whether to start services on distinct instances

Type:boolean (optional)
Default:true
securityGroup

Existing security group to use for the task’s ENIs

(Only applicable in case the TaskDefinition is configured for AwsVpc networking)

Type:@aws-cdk/aws-ec2.ISecurityGroup (optional)
Default:A new security group is created
vpcPlacement

In what subnets to place the task’s ENIs

(Only applicable in case the TaskDefinition is configured for AwsVpc networking)

Type:@aws-cdk/aws-ec2.VpcPlacementStrategy (optional)
Default:Private subnets
desiredCount

Inherited from @aws-cdk/aws-ecs.BaseServiceProps

Number of desired copies of running tasks

Type:number (optional)
Default:1
healthCheckGracePeriodSeconds

Inherited from @aws-cdk/aws-ecs.BaseServiceProps

Time after startup to ignore unhealthy load balancer checks.

Type:number (optional)
Default:??? FIXME
maximumPercent

Inherited from @aws-cdk/aws-ecs.BaseServiceProps

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.

Type:number (optional)
Default:200
minimumHealthyPercent

Inherited from @aws-cdk/aws-ecs.BaseServiceProps

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.

Type:number (optional)
Default:50
serviceName

Inherited from @aws-cdk/aws-ecs.BaseServiceProps

A name for the service.

Type:string (optional)
Default:CloudFormation-generated name

Ec2TaskDefinition

class @aws-cdk/aws-ecs.Ec2TaskDefinition(scope, id[, props])

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.Ec2TaskDefinition;
const { Ec2TaskDefinition } = require('@aws-cdk/aws-ecs');
import { Ec2TaskDefinition } from '@aws-cdk/aws-ecs';

Define Tasks to run on an ECS cluster

Extends:

TaskDefinition

Parameters:
addContainer(id, props) → @aws-cdk/aws-ecs.ContainerDefinition

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Create a new container to this task definition

Parameters:
Return type:

ContainerDefinition

addExtension(extension)

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Extend this TaskDefinition with the given extension

Extension can be used to apply a packaged modification to

a task definition.

Parameters:extension (ITaskDefinitionExtension) –
addPlacementConstraint(constraint)

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Constrain where tasks can be placed

Parameters:constraint (PlacementConstraint) –
addToExecutionRolePolicy(statement)

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Add a policy statement to the Execution Role

Parameters:statement (@aws-cdk/aws-iam.PolicyStatement) –
addToTaskRolePolicy(statement)

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Add a policy statement to the Task Role

Parameters:statement (@aws-cdk/aws-iam.PolicyStatement) –
addVolume(volume)

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Add a volume to this task definition

Parameters:volume (Volume) –
obtainExecutionRole() → @aws-cdk/aws-iam.IRole

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Create the execution role if it doesn’t exist

Return type:@aws-cdk/aws-iam.IRole
validate() → string[]

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Validate this task definition

Protected method

Return type:string[]
containers

Inherited from @aws-cdk/aws-ecs.TaskDefinition

All containers

Protected property

Type:ContainerDefinition[] (readonly)
family

Inherited from @aws-cdk/aws-ecs.TaskDefinition

The family name of this task definition

Type:string (readonly)
networkMode

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Network mode used by this task definition

Type:NetworkMode (readonly)
taskDefinitionArn

Inherited from @aws-cdk/aws-ecs.TaskDefinition

ARN of this task definition

Type:string (readonly)
taskRole

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Task role used by this task definition

Type:@aws-cdk/aws-iam.Role (readonly)
compatibility

Inherited from @aws-cdk/aws-ecs.TaskDefinition

What launching modes this task is compatible with

Type:Compatibility
defaultContainer

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Default container for this task

Load balancers will send traffic to this container. The first

essential container that is added to this task will become the default

container.

Type:ContainerDefinition (optional)
executionRole

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Execution role for this task definition

May not exist, will be created as needed.

Type:@aws-cdk/aws-iam.IRole (optional)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

Ec2TaskDefinitionProps (interface)

class @aws-cdk/aws-ecs.Ec2TaskDefinitionProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.Ec2TaskDefinitionProps;
// Ec2TaskDefinitionProps is an interface
import { Ec2TaskDefinitionProps } from '@aws-cdk/aws-ecs';

Properties to define an ECS task definition

Extends:CommonTaskDefinitionProps
networkMode

The Docker networking mode to use for the containers in the task.

On Fargate, the only supported networking mode is AwsVpc.

Type:NetworkMode (optional)
Default:NetworkMode.Bridge for EC2 tasks, AwsVpc for Fargate tasks.
placementConstraints

An array of placement constraint objects to use for the task. You can

specify a maximum of 10 constraints per task (this limit includes

constraints in the task definition and those specified at run time).

Not supported in Fargate.

Type:PlacementConstraint[] (optional)
executionRole

Inherited from @aws-cdk/aws-ecs.CommonTaskDefinitionProps

The IAM role assumed by the ECS agent.

The role will be used to retrieve container images from ECR and

create CloudWatch log groups.

Type:@aws-cdk/aws-iam.Role (optional)
Default:An execution role will be automatically created if you use ECR images in your task definition
family

Inherited from @aws-cdk/aws-ecs.CommonTaskDefinitionProps

Namespace for task definition versions

Type:string (optional)
Default:Automatically generated name
taskRole

Inherited from @aws-cdk/aws-ecs.CommonTaskDefinitionProps

The IAM role assumable by your application code running inside the container

Type:@aws-cdk/aws-iam.Role (optional)
Default:A task role is automatically created for you
volumes

Inherited from @aws-cdk/aws-ecs.CommonTaskDefinitionProps

See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide//task_definition_parameters.html#volumes

Type:Volume[] (optional)

EcrImage

class @aws-cdk/aws-ecs.EcrImage(repository, tag)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.EcrImage;
const { EcrImage } = require('@aws-cdk/aws-ecs');
import { EcrImage } from '@aws-cdk/aws-ecs';

An image from an ECR repository

Extends:

ContainerImage

Parameters:
bind(containerDefinition)

Implements @aws-cdk/aws-ecs.ContainerImage.bind()

Called when the image is used by a ContainerDefinition

Parameters:containerDefinition (ContainerDefinition) –
imageName

Implements @aws-cdk/aws-ecs.ContainerImage.imageName()

Name of the image

Type:string (readonly)

EcsOptimizedAmi

class @aws-cdk/aws-ecs.EcsOptimizedAmi([props])

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.EcsOptimizedAmi;
const { EcsOptimizedAmi } = require('@aws-cdk/aws-ecs');
import { EcsOptimizedAmi } from '@aws-cdk/aws-ecs';

Construct a Linux machine image from the latest ECS Optimized AMI published in SSM

Implements:@aws-cdk/aws-ec2.IMachineImageSource
Parameters:props (EcsOptimizedAmiProps (optional)) –
getImage(scope) → @aws-cdk/aws-ec2.MachineImage

Implements @aws-cdk/aws-ec2.IMachineImageSource.getImage()

Return the correct image

Parameters:scope (@aws-cdk/cdk.Construct) –
Return type:@aws-cdk/aws-ec2.MachineImage

EcsOptimizedAmiProps (interface)

class @aws-cdk/aws-ecs.EcsOptimizedAmiProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.EcsOptimizedAmiProps;
// EcsOptimizedAmiProps is an interface
import { EcsOptimizedAmiProps } from '@aws-cdk/aws-ecs';
generation

What generation of Amazon Linux to use

Type:@aws-cdk/aws-ec2.AmazonLinuxGeneration (optional)
Default:AmazonLinux

FargatePlatformVersion (enum)

class @aws-cdk/aws-ecs.FargatePlatformVersion

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.FargatePlatformVersion;
const { FargatePlatformVersion } = require('@aws-cdk/aws-ecs');
import { FargatePlatformVersion } from '@aws-cdk/aws-ecs';

Fargate platform version

Latest

The latest, recommended platform version

Version1_3

Version 1.3.0

Supports secrets, task recycling.

Version1_2

Version 1.2.0

Supports private registries.

Version1_1

Version 1.1.0

Supports task metadata, health checks, service discovery.

Version1_0

Initial release

Based on Amazon Linux 2017.09.

FargateService

class @aws-cdk/aws-ecs.FargateService(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.FargateService;
const { FargateService } = require('@aws-cdk/aws-ecs');
import { FargateService } from '@aws-cdk/aws-ecs';

Start a service on an ECS cluster

Extends:

BaseService

Parameters:
attachToApplicationTargetGroup(targetGroup) → @aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps

Inherited from @aws-cdk/aws-ecs.BaseService

Called when the service is attached to an ALB

Don’t call this function directly. Instead, call listener.addTarget()

to add this service to a load balancer.

Parameters:targetGroup (@aws-cdk/aws-elasticloadbalancingv2.ApplicationTargetGroup) –
Return type:@aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps
attachToNetworkTargetGroup(targetGroup) → @aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps

Inherited from @aws-cdk/aws-ecs.BaseService

Called when the service is attached to an NLB

Don’t call this function directly. Instead, call listener.addTarget()

to add this service to a load balancer.

Parameters:targetGroup (@aws-cdk/aws-elasticloadbalancingv2.NetworkTargetGroup) –
Return type:@aws-cdk/aws-elasticloadbalancingv2.LoadBalancerTargetProps
autoScaleTaskCount(props) → @aws-cdk/aws-ecs.ScalableTaskCount

Inherited from @aws-cdk/aws-ecs.BaseService

Enable autoscaling for the number of tasks in this service

Parameters:props (@aws-cdk/aws-applicationautoscaling.EnableScalingProps) –
Return type:ScalableTaskCount
configureAwsVpcNetworking(vpc[, assignPublicIp[, vpcPlacement[, securityGroup]]])

Inherited from @aws-cdk/aws-ecs.BaseService

Set up AWSVPC networking for this construct

Protected method

Parameters:
metric(metricName[, props]) → @aws-cdk/aws-cloudwatch.Metric

Inherited from @aws-cdk/aws-ecs.BaseService

Return the given named metric for this Service

Parameters:
Return type:

@aws-cdk/aws-cloudwatch.Metric

clusterName

Inherited from @aws-cdk/aws-ecs.BaseService

Name of this service’s cluster

Type:string (readonly)
connections

Inherited from @aws-cdk/aws-ecs.BaseService

Manage allowed network traffic for this service

Type:@aws-cdk/aws-ec2.Connections (readonly)
serviceArn

Inherited from @aws-cdk/aws-ecs.BaseService

ARN of this service

Type:string (readonly)
serviceName

Inherited from @aws-cdk/aws-ecs.BaseService

Name of this service

Type:string (readonly)
taskDefinition

Inherited from @aws-cdk/aws-ecs.BaseService

Task definition this service is associated with

Type:TaskDefinition (readonly)
loadBalancers

Inherited from @aws-cdk/aws-ecs.BaseService

Protected property

Type:LoadBalancerProperty[]
networkConfiguration

Inherited from @aws-cdk/aws-ecs.BaseService

Protected property

Type:NetworkConfigurationProperty (optional)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

FargateServiceProps (interface)

class @aws-cdk/aws-ecs.FargateServiceProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.FargateServiceProps;
// FargateServiceProps is an interface
import { FargateServiceProps } from '@aws-cdk/aws-ecs';

Properties to define a Fargate service

Extends:BaseServiceProps
cluster

Cluster where service will be deployed

Type:ICluster
taskDefinition

Task Definition used for running tasks in the service

Type:TaskDefinition
assignPublicIp

Assign public IP addresses to each task

Type:boolean (optional)
Default:false
platformVersion

Fargate platform version to run this service on

Unless you have specific compatibility requirements, you don’t need to

specify this.

Type:FargatePlatformVersion (optional)
Default:Latest
securityGroup

Existing security group to use for the tasks

Type:@aws-cdk/aws-ec2.ISecurityGroup (optional)
Default:A new security group is created
vpcPlacement

In what subnets to place the task’s ENIs

Type:@aws-cdk/aws-ec2.VpcPlacementStrategy (optional)
Default:Private subnet if assignPublicIp, public subnets otherwise
desiredCount

Inherited from @aws-cdk/aws-ecs.BaseServiceProps

Number of desired copies of running tasks

Type:number (optional)
Default:1
healthCheckGracePeriodSeconds

Inherited from @aws-cdk/aws-ecs.BaseServiceProps

Time after startup to ignore unhealthy load balancer checks.

Type:number (optional)
Default:??? FIXME
maximumPercent

Inherited from @aws-cdk/aws-ecs.BaseServiceProps

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.

Type:number (optional)
Default:200
minimumHealthyPercent

Inherited from @aws-cdk/aws-ecs.BaseServiceProps

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.

Type:number (optional)
Default:50
serviceName

Inherited from @aws-cdk/aws-ecs.BaseServiceProps

A name for the service.

Type:string (optional)
Default:CloudFormation-generated name

FargateTaskDefinition

class @aws-cdk/aws-ecs.FargateTaskDefinition(scope, id[, props])

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.FargateTaskDefinition;
const { FargateTaskDefinition } = require('@aws-cdk/aws-ecs');
import { FargateTaskDefinition } from '@aws-cdk/aws-ecs';

A definition for Tasks on a Fargate cluster

Extends:

TaskDefinition

Parameters:
networkMode

Overrides @aws-cdk/aws-ecs.TaskDefinition.networkMode

The configured network mode

Type:NetworkMode (readonly)
addContainer(id, props) → @aws-cdk/aws-ecs.ContainerDefinition

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Create a new container to this task definition

Parameters:
Return type:

ContainerDefinition

addExtension(extension)

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Extend this TaskDefinition with the given extension

Extension can be used to apply a packaged modification to

a task definition.

Parameters:extension (ITaskDefinitionExtension) –
addPlacementConstraint(constraint)

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Constrain where tasks can be placed

Parameters:constraint (PlacementConstraint) –
addToExecutionRolePolicy(statement)

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Add a policy statement to the Execution Role

Parameters:statement (@aws-cdk/aws-iam.PolicyStatement) –
addToTaskRolePolicy(statement)

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Add a policy statement to the Task Role

Parameters:statement (@aws-cdk/aws-iam.PolicyStatement) –
addVolume(volume)

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Add a volume to this task definition

Parameters:volume (Volume) –
obtainExecutionRole() → @aws-cdk/aws-iam.IRole

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Create the execution role if it doesn’t exist

Return type:@aws-cdk/aws-iam.IRole
validate() → string[]

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Validate this task definition

Protected method

Return type:string[]
containers

Inherited from @aws-cdk/aws-ecs.TaskDefinition

All containers

Protected property

Type:ContainerDefinition[] (readonly)
family

Inherited from @aws-cdk/aws-ecs.TaskDefinition

The family name of this task definition

Type:string (readonly)
taskDefinitionArn

Inherited from @aws-cdk/aws-ecs.TaskDefinition

ARN of this task definition

Type:string (readonly)
taskRole

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Task role used by this task definition

Type:@aws-cdk/aws-iam.Role (readonly)
compatibility

Inherited from @aws-cdk/aws-ecs.TaskDefinition

What launching modes this task is compatible with

Type:Compatibility
defaultContainer

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Default container for this task

Load balancers will send traffic to this container. The first

essential container that is added to this task will become the default

container.

Type:ContainerDefinition (optional)
executionRole

Inherited from @aws-cdk/aws-ecs.TaskDefinition

Execution role for this task definition

May not exist, will be created as needed.

Type:@aws-cdk/aws-iam.IRole (optional)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

FargateTaskDefinitionProps (interface)

class @aws-cdk/aws-ecs.FargateTaskDefinitionProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.FargateTaskDefinitionProps;
// FargateTaskDefinitionProps is an interface
import { FargateTaskDefinitionProps } from '@aws-cdk/aws-ecs';

Properties to define a Fargate Task

Extends:CommonTaskDefinitionProps
cpu

The number of cpu units used by the task.

Valid values, which determines your range of valid values for the memory parameter:

256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB

512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB

1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB

2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments

4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments

Type:string (optional)
Default:256
memoryMiB

The amount (in MiB) of memory used by the task.

This field is required and you must use one of the following values, which determines your range of valid values

for the cpu parameter:

0.5GB, 1GB, 2GB - Available cpu values: 256 (.25 vCPU)

1GB, 2GB, 3GB, 4GB - Available cpu values: 512 (.5 vCPU)

2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB - Available cpu values: 1024 (1 vCPU)

Between 4GB and 16GB in 1GB increments - Available cpu values: 2048 (2 vCPU)

Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU)

Type:string (optional)
Default:512
executionRole

Inherited from @aws-cdk/aws-ecs.CommonTaskDefinitionProps

The IAM role assumed by the ECS agent.

The role will be used to retrieve container images from ECR and

create CloudWatch log groups.

Type:@aws-cdk/aws-iam.Role (optional)
Default:An execution role will be automatically created if you use ECR images in your task definition
family

Inherited from @aws-cdk/aws-ecs.CommonTaskDefinitionProps

Namespace for task definition versions

Type:string (optional)
Default:Automatically generated name
taskRole

Inherited from @aws-cdk/aws-ecs.CommonTaskDefinitionProps

The IAM role assumable by your application code running inside the container

Type:@aws-cdk/aws-iam.Role (optional)
Default:A task role is automatically created for you
volumes

Inherited from @aws-cdk/aws-ecs.CommonTaskDefinitionProps

See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide//task_definition_parameters.html#volumes

Type:Volume[] (optional)

HealthCheck (interface)

class @aws-cdk/aws-ecs.HealthCheck

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.HealthCheck;
// HealthCheck is an interface
import { HealthCheck } from '@aws-cdk/aws-ecs';

Container health check configuration

command

Command to run, as the binary path and arguments.

If you provide a shell command as a single string, you have to quote command-line arguments.

Type:string[]
intervalSeconds

Time period in seconds between each health check execution.

You may specify between 5 and 300 seconds.

Type:number (optional)
Default:30
retries

Number of times to retry a failed health check before the container is considered unhealthy.

You may specify between 1 and 10 retries.

Type:number (optional)
Default:3
startPeriod

Grace period after startup before failed health checks count.

You may specify between 0 and 300 seconds.

Type:number (optional)
Default:No start period
timeout

The time period in seconds to wait for a health check to succeed before it is considered a failure.

You may specify between 2 and 60 seconds.

Type:number (optional)
Default:5

Host (interface)

class @aws-cdk/aws-ecs.Host

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.Host;
// Host is an interface
import { Host } from '@aws-cdk/aws-ecs';

A volume host

sourcePath

Source path on the host

Type:string (optional)

ICluster (interface)

class @aws-cdk/aws-ecs.ICluster

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.ICluster;
// ICluster is an interface
import { ICluster } from '@aws-cdk/aws-ecs';

An ECS cluster

Extends:@aws-cdk/cdk.IConstruct
clusterArn

The ARN of this cluster

Type:string (readonly)
clusterName

Name of the cluster

Type:string (readonly)
connections

Connections manager of the cluster instances

Type:@aws-cdk/aws-ec2.Connections (readonly)
hasEc2Capacity

Whether the cluster has EC2 capacity associated with it

Type:boolean (readonly)
vpc

VPC that the cluster instances are running in

Type:@aws-cdk/aws-ec2.IVpcNetwork (readonly)
export() → @aws-cdk/aws-ecs.ClusterImportProps

Export the Cluster

Return type:ClusterImportProps
Abstract:Yes
node

Inherited from @aws-cdk/cdk.IConstruct

The construct node in the scope tree.

Type:@aws-cdk/cdk.ConstructNode (readonly)
dependencyRoots

Inherited from @aws-cdk/cdk.IDependable

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)

ITaskDefinitionExtension (interface)

class @aws-cdk/aws-ecs.ITaskDefinitionExtension

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.ITaskDefinitionExtension;
// ITaskDefinitionExtension is an interface
import { ITaskDefinitionExtension } from '@aws-cdk/aws-ecs';

An extension for Task Definitions

Classes that want to make changes to a TaskDefinition (such as

adding helper containers) can implement this interface, and can

then be “added” to a TaskDefinition like so:

taskDefinition.addExtension(new MyExtension(“some_parameter”));
extend(taskDefinition)

Apply the extension to the given TaskDefinition

Parameters:taskDefinition (TaskDefinition) –
Abstract:Yes

LinuxParameters

class @aws-cdk/aws-ecs.LinuxParameters

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.LinuxParameters;
const { LinuxParameters } = require('@aws-cdk/aws-ecs');
import { LinuxParameters } from '@aws-cdk/aws-ecs';

Linux parameter setup in a container

addCapabilities(*cap)

Add one or more capabilities

Only works with EC2 launch type.

Parameters:*cap (Capability) –
addDevices(*device)

Add one or more devices

Parameters:*device (Device) –
addTmpfs(*tmpfs)

Add one or more tmpfs mounts

Parameters:*tmpfs (Tmpfs) –
dropCapabilities(*cap)

Drop one or more capabilities

Only works with EC2 launch type.

Parameters:*cap (Capability) –
renderLinuxParameters() → @aws-cdk/aws-ecs.CfnTaskDefinition.LinuxParametersProperty

Render the Linux parameters to a CloudFormation object

Return type:LinuxParametersProperty
initProcessEnabled

Whether the init process is enabled

Type:boolean (optional)
sharedMemorySize

The shared memory size

Type:number (optional)

LoadBalancedEc2Service

class @aws-cdk/aws-ecs.LoadBalancedEc2Service(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.LoadBalancedEc2Service;
const { LoadBalancedEc2Service } = require('@aws-cdk/aws-ecs');
import { LoadBalancedEc2Service } from '@aws-cdk/aws-ecs';

A single task running on an ECS cluster fronted by a load balancer

Extends:

LoadBalancedServiceBase

Parameters:
addServiceAsTarget(service)

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBase

Protected method

Parameters:service (BaseService) –
listener

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBase

Type:@aws-cdk/aws-elasticloadbalancingv2.ApplicationListener or @aws-cdk/aws-elasticloadbalancingv2.NetworkListener (readonly)
loadBalancer

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBase

Type:@aws-cdk/aws-elasticloadbalancingv2.BaseLoadBalancer (readonly)
loadBalancerType

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBase

Type:LoadBalancerType (readonly)
targetGroup

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBase

Type:@aws-cdk/aws-elasticloadbalancingv2.ApplicationTargetGroup or @aws-cdk/aws-elasticloadbalancingv2.NetworkTargetGroup (readonly)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

LoadBalancedEc2ServiceProps (interface)

class @aws-cdk/aws-ecs.LoadBalancedEc2ServiceProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.LoadBalancedEc2ServiceProps;
// LoadBalancedEc2ServiceProps is an interface
import { LoadBalancedEc2ServiceProps } from '@aws-cdk/aws-ecs';

Properties for a LoadBalancedEc2Service

Extends:LoadBalancedServiceBaseProps
memoryLimitMiB

The hard limit (in MiB) of memory to present to the container.

If your container attempts to exceed the allocated memory, the container

is terminated.

At least one of memoryLimitMiB and memoryReservationMiB is required.

Type:number (optional)
memoryReservationMiB

The soft limit (in MiB) of memory to reserve for the container.

When system memory is under contention, Docker attempts to keep the

container memory within the limit. If the container requires more memory,

it can consume up to the value specified by the Memory property or all of

the available memory on the container instance—whichever comes first.

At least one of memoryLimitMiB and memoryReservationMiB is required.

Type:number (optional)
cluster

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

The cluster where your service will be deployed

Type:ICluster
image

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

The image to start.

Type:ContainerImage
certificate

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

Certificate Manager certificate to associate with the load balancer.

Setting this option will set the load balancer port to 443.

Type:@aws-cdk/aws-certificatemanager.ICertificate (optional)
containerPort

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

The container port of the application load balancer attached to your Fargate service. Corresponds to container port mapping.

Type:number (optional)
Default:80
desiredCount

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

Number of desired copies of running tasks

Type:number (optional)
Default:1
environment

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

Environment variables to pass to the container

Type:string => string (optional)
Default:No environment variables
loadBalancerType

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

Whether to create an application load balancer or a network load balancer

Type:LoadBalancerType (optional)
Default:application
publicLoadBalancer

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

Determines whether the Application Load Balancer will be internet-facing

Type:boolean (optional)
Default:true

LoadBalancedFargateService

class @aws-cdk/aws-ecs.LoadBalancedFargateService(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.LoadBalancedFargateService;
const { LoadBalancedFargateService } = require('@aws-cdk/aws-ecs');
import { LoadBalancedFargateService } from '@aws-cdk/aws-ecs';

A Fargate service running on an ECS cluster fronted by a load balancer

Extends:

LoadBalancedServiceBase

Parameters:
service
Type:FargateService (readonly)
addServiceAsTarget(service)

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBase

Protected method

Parameters:service (BaseService) –
listener

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBase

Type:@aws-cdk/aws-elasticloadbalancingv2.ApplicationListener or @aws-cdk/aws-elasticloadbalancingv2.NetworkListener (readonly)
loadBalancer

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBase

Type:@aws-cdk/aws-elasticloadbalancingv2.BaseLoadBalancer (readonly)
loadBalancerType

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBase

Type:LoadBalancerType (readonly)
targetGroup

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBase

Type:@aws-cdk/aws-elasticloadbalancingv2.ApplicationTargetGroup or @aws-cdk/aws-elasticloadbalancingv2.NetworkTargetGroup (readonly)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

LoadBalancedFargateServiceApplet

class @aws-cdk/aws-ecs.LoadBalancedFargateServiceApplet(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.LoadBalancedFargateServiceApplet;
const { LoadBalancedFargateServiceApplet } = require('@aws-cdk/aws-ecs');
import { LoadBalancedFargateServiceApplet } from '@aws-cdk/aws-ecs';

An applet for a LoadBalancedFargateService. Sets up a Fargate service, Application

load balancer, ECS cluster, VPC, and (optionally) Route53 alias record.

Extends:

@aws-cdk/cdk.Stack

Parameters:
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)
addDependency(stack)

Inherited from @aws-cdk/cdk.Stack

Add a dependency between this stack and another stack

Parameters:stack (@aws-cdk/cdk.Stack) –
dependencies() → @aws-cdk/cdk.Stack[]

Inherited from @aws-cdk/cdk.Stack

Return the stacks this stack depends on

Return type:@aws-cdk/cdk.Stack[]
findResource(path) → @aws-cdk/cdk.Resource

Inherited from @aws-cdk/cdk.Stack

Looks up a resource by path.

Parameters:path (string) –
Returns:The Resource or undefined if not found
Return type:@aws-cdk/cdk.Resource (optional)
formatArn(components) → string

Inherited from @aws-cdk/cdk.Stack

Creates an ARN from components.

If partition, region or account are not specified, the stack’s

partition, region and account will be used.

If any component is the empty string, an empty string will be inserted

into the generated ARN at the location that component corresponds to.

The ARN will be formatted as follows:

arn:{partition}:{service}:{region}:{account}:{resource}{sep}}{resource-name}

The required ARN pieces that are omitted will be taken from the stack that

the ‘scope’ is attached to. If all ARN pieces are supplied, the supplied scope

can be ‘undefined’.

Parameters:components (@aws-cdk/cdk.ArnComponents) –
Return type:string
parentApp() → @aws-cdk/cdk.App

Inherited from @aws-cdk/cdk.Stack

Return type:@aws-cdk/cdk.App (optional)
parseArn(arn[, sepIfToken[, hasName]]) → @aws-cdk/cdk.ArnComponents

Inherited from @aws-cdk/cdk.Stack

Given an ARN, parses it and returns components.

If the ARN is a concrete string, it will be parsed and validated. The

separator (sep) will be set to ‘/’ if the 6th component includes a ‘/’,

in which case, resource will be set to the value before the ‘/’ and

resourceName will be the rest. In case there is no ‘/’, resource will

be set to the 6th components and resourceName will be set to the rest

of the string.

If the ARN includes tokens (or is a token), the ARN cannot be validated,

since we don’t have the actual value yet at the time of this function

call. You will have to know the separator and the type of ARN. The

resulting ArnComponents object will contain tokens for the

subexpressions of the ARN, not string literals. In this case this

function cannot properly parse the complete final resourceName (path) out

of ARNs that use ‘/’ to both separate the ‘resource’ from the

‘resourceName’ AND to subdivide the resourceName further. For example, in

S3 ARNs:

arn:aws:s3:::my_corporate_bucket/path/to/exampleobject.png

After parsing the resourceName will not contain

‘path/to/exampleobject.png’ but simply ‘path’. This is a limitation

because there is no slicing functionality in CloudFormation templates.

Parameters:
  • arn (string) –
  • sepIfToken (string (optional)) –
  • hasName (boolean (optional)) – Whether there is a name component in the ARN at all. For example, SNS Topics ARNs have the ‘resource’ component contain the topic name, and no ‘resourceName’ component.
Returns:

an ArnComponents object which allows access to the various components of the ARN.

Return type:

@aws-cdk/cdk.ArnComponents

prepare()

Inherited from @aws-cdk/cdk.Stack

Prepare stack

Find all CloudFormation references and tell them we’re consuming them.

Find all dependencies as well and add the appropriate DependsOn fields.

Protected method

renameLogical(oldId, newId)

Inherited from @aws-cdk/cdk.Stack

Rename a generated logical identities

Parameters:
  • oldId (string) –
  • newId (string) –
reportMissingContext(key, details)

Inherited from @aws-cdk/cdk.Stack

Indicate that a context key was expected

Contains instructions on how the key should be supplied.

Parameters:
  • key (string) – Key that uniquely identifies this missing context.
  • details (@aws-cdk/cx-api.MissingContext) – The set of parameters needed to obtain the context (specific to context provider).
requireAccountId([why]) → string

Inherited from @aws-cdk/cdk.Stack

Returns the AWS account ID of this Stack,

or throws an exception if the account ID is not set in the environment.

Parameters:why (string (optional)) – more information about why is the account ID required
Returns:the AWS account ID of this Stack
Return type:string
requireRegion([why]) → string

Inherited from @aws-cdk/cdk.Stack

Parameters:why (string (optional)) – more information about why region is required.
Returns:The region in which this stack is deployed. Throws if region is not defined.
Return type:string
setParameterValue(parameter, value)

Inherited from @aws-cdk/cdk.Stack

Sets the value of a CloudFormation parameter.

Parameters:
  • parameter (@aws-cdk/cdk.Parameter) – The parameter to set the value for
  • value (string) – The value, can use ${} notation to reference other assembly block attributes.
synthesize(session)

Inherited from @aws-cdk/cdk.Stack

Protected method

Parameters:session (@aws-cdk/cdk.ISynthesisSession) –
toCloudFormation() → any

Inherited from @aws-cdk/cdk.Stack

Returns the CloudFormation template for this stack by traversing

the tree and invoking toCloudFormation() on all Entity objects.

Return type:any
accountId

Inherited from @aws-cdk/cdk.Stack

The account in which this stack is defined

Either returns the literal account for this stack if it was specified

literally upon Stack construction, or a symbolic value that will evaluate

to the correct account at deployment time.

Type:string (readonly)
env

Inherited from @aws-cdk/cdk.Stack

The environment in which this stack is deployed.

Type:@aws-cdk/cdk.Environment (readonly)
environment

Inherited from @aws-cdk/cdk.Stack

Returns the environment specification for this stack (aws://account/region).

Type:string (readonly)
logicalIds

Inherited from @aws-cdk/cdk.Stack

Logical ID generation strategy

Type:@aws-cdk/cdk.LogicalIDs (readonly)
missingContext

Inherited from @aws-cdk/cdk.Stack

Lists all missing contextual information.

This is returned when the stack is synthesized under the ‘missing’ attribute

and allows tooling to obtain the context and re-synthesize.

Type:string => @aws-cdk/cx-api.MissingContext (readonly)
name

Inherited from @aws-cdk/cdk.Stack

The CloudFormation stack name.

Type:string (readonly)
notificationArns

Inherited from @aws-cdk/cdk.Stack

Returns the list of notification Amazon Resource Names (ARNs) for the current stack.

Type:string[] (readonly)
partition

Inherited from @aws-cdk/cdk.Stack

The partition in which this stack is defined

Type:string (readonly)
region

Inherited from @aws-cdk/cdk.Stack

The region in which this stack is defined

Either returns the literal region for this stack if it was specified

literally upon Stack construction, or a symbolic value that will evaluate

to the correct region at deployment time.

Type:string (readonly)
stackId

Inherited from @aws-cdk/cdk.Stack

The ID of the stack

Type:string (readonly)
stackName

Inherited from @aws-cdk/cdk.Stack

The name of the stack currently being deployed

Only available at deployment time.

Type:string (readonly)
templateOptions

Inherited from @aws-cdk/cdk.Stack

Options for CloudFormation template (like version, transform, description).

Type:@aws-cdk/cdk.TemplateOptions (readonly)
urlSuffix

Inherited from @aws-cdk/cdk.Stack

The Amazon domain suffix for the region in which this stack is defined

Type:string (readonly)
props

Inherited from @aws-cdk/cdk.Stack

Stack properties.

Type:@aws-cdk/cdk.StackProps (optional) (readonly)

LoadBalancedFargateServiceAppletProps (interface)

class @aws-cdk/aws-ecs.LoadBalancedFargateServiceAppletProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.LoadBalancedFargateServiceAppletProps;
// LoadBalancedFargateServiceAppletProps is an interface
import { LoadBalancedFargateServiceAppletProps } from '@aws-cdk/aws-ecs';

Properties for a LoadBalancedEcsServiceApplet

Extends:@aws-cdk/cdk.StackProps
image

The image to start (from DockerHub)

Type:string
certificate

Certificate Manager certificate to associate with the load balancer.

Setting this option will set the load balancer port to 443.

Type:string (optional)
containerPort

The container port of the application load balancer attached to your Fargate service. Corresponds to container port mapping.

Type:number (optional)
Default:80
cpu

The number of cpu units used by the task.

Valid values, which determines your range of valid values for the memory parameter:

256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB

512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB

1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB

2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments

4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments

This default is set in the underlying FargateTaskDefinition construct.

Type:string (optional)
Default:256
desiredCount

Number of desired copies of running tasks

Type:number (optional)
Default:1
domainName
Type:string (optional)
domainZone

Route53 hosted zone for the domain, e.g. “example.com.”

Type:string (optional)
environment

Environment variables to pass to the container

Type:string => string (optional)
Default:No environment variables
memoryMiB

The amount (in MiB) of memory used by the task.

This field is required and you must use one of the following values, which determines your range of valid values

for the cpu parameter:

0.5GB, 1GB, 2GB - Available cpu values: 256 (.25 vCPU)

1GB, 2GB, 3GB, 4GB - Available cpu values: 512 (.5 vCPU)

2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB - Available cpu values: 1024 (1 vCPU)

Between 4GB and 16GB in 1GB increments - Available cpu values: 2048 (2 vCPU)

Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU)

This default is set in the underlying FargateTaskDefinition construct.

Type:string (optional)
Default:512
publicLoadBalancer

Determines whether the Application Load Balancer will be internet-facing

Type:boolean (optional)
Default:true
publicTasks

Determines whether your Fargate Service will be assigned a public IP address.

Type:boolean (optional)
Default:false
env

Inherited from @aws-cdk/cdk.StackProps

The AWS environment (account/region) where this stack will be deployed.

If not supplied, the default-account and default-region context parameters will be

used. If they are undefined, it will not be possible to deploy the stack.

Type:@aws-cdk/cdk.Environment (optional)
namingScheme

Inherited from @aws-cdk/cdk.StackProps

Strategy for logical ID generation

Optional. If not supplied, the HashedNamingScheme will be used.

Type:@aws-cdk/cdk.IAddressingScheme (optional)

LoadBalancedFargateServiceProps (interface)

class @aws-cdk/aws-ecs.LoadBalancedFargateServiceProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.LoadBalancedFargateServiceProps;
// LoadBalancedFargateServiceProps is an interface
import { LoadBalancedFargateServiceProps } from '@aws-cdk/aws-ecs';

Properties for a LoadBalancedEcsService

Extends:LoadBalancedServiceBaseProps
cpu

The number of cpu units used by the task.

Valid values, which determines your range of valid values for the memory parameter:

256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB

512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB

1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB

2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments

4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments

This default is set in the underlying FargateTaskDefinition construct.

Type:string (optional)
Default:256
createLogs

Whether to create an AWS log driver

Type:boolean (optional)
Default:true
domainName
Type:string (optional)
domainZone

Route53 hosted zone for the domain, e.g. “example.com.”

Type:@aws-cdk/aws-route53.IHostedZone (optional)
memoryMiB

The amount (in MiB) of memory used by the task.

This field is required and you must use one of the following values, which determines your range of valid values

for the cpu parameter:

0.5GB, 1GB, 2GB - Available cpu values: 256 (.25 vCPU)

1GB, 2GB, 3GB, 4GB - Available cpu values: 512 (.5 vCPU)

2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB - Available cpu values: 1024 (1 vCPU)

Between 4GB and 16GB in 1GB increments - Available cpu values: 2048 (2 vCPU)

Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU)

This default is set in the underlying FargateTaskDefinition construct.

Type:string (optional)
Default:512
publicTasks

Determines whether your Fargate Service will be assigned a public IP address.

Type:boolean (optional)
Default:false
cluster

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

The cluster where your service will be deployed

Type:ICluster
image

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

The image to start.

Type:ContainerImage
certificate

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

Certificate Manager certificate to associate with the load balancer.

Setting this option will set the load balancer port to 443.

Type:@aws-cdk/aws-certificatemanager.ICertificate (optional)
containerPort

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

The container port of the application load balancer attached to your Fargate service. Corresponds to container port mapping.

Type:number (optional)
Default:80
desiredCount

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

Number of desired copies of running tasks

Type:number (optional)
Default:1
environment

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

Environment variables to pass to the container

Type:string => string (optional)
Default:No environment variables
loadBalancerType

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

Whether to create an application load balancer or a network load balancer

Type:LoadBalancerType (optional)
Default:application
publicLoadBalancer

Inherited from @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

Determines whether the Application Load Balancer will be internet-facing

Type:boolean (optional)
Default:true

LoadBalancedServiceBase

class @aws-cdk/aws-ecs.LoadBalancedServiceBase(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.LoadBalancedServiceBase;
const { LoadBalancedServiceBase } = require('@aws-cdk/aws-ecs');
import { LoadBalancedServiceBase } from '@aws-cdk/aws-ecs';

Base class for load-balanced Fargate and ECS service

Extends:

@aws-cdk/cdk.Construct

Abstract:

Yes

Parameters:
addServiceAsTarget(service)

Protected method

Parameters:service (BaseService) –
listener
Type:@aws-cdk/aws-elasticloadbalancingv2.ApplicationListener or @aws-cdk/aws-elasticloadbalancingv2.NetworkListener (readonly)
loadBalancer
Type:@aws-cdk/aws-elasticloadbalancingv2.BaseLoadBalancer (readonly)
loadBalancerType
Type:LoadBalancerType (readonly)
targetGroup
Type:@aws-cdk/aws-elasticloadbalancingv2.ApplicationTargetGroup or @aws-cdk/aws-elasticloadbalancingv2.NetworkTargetGroup (readonly)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

LoadBalancedServiceBaseProps (interface)

class @aws-cdk/aws-ecs.LoadBalancedServiceBaseProps

Language-specific names:

using Amazon.CDK.AWS.ECS;
import software.amazon.awscdk.services.ecs.LoadBalancedServiceBaseProps;
// LoadBalancedServiceBaseProps is an interface
import { LoadBalancedServiceBaseProps } from '@aws-cdk/aws-ecs';
cluster

The cluster where your service will be deployed

Type:ICluster
image

The image to start.

Type:ContainerImage
certificate

Certificate Manager certificate to associate with the load balancer.

Setting this option will set the load balancer port to 443.

Type:@aws-cdk/aws-certificatemanager.ICertificate (optional)
containerPort

The container port of the application load balancer attached to your Fargate service. Corresponds to container port mapping.

Type:number (optional)
Default:80
desiredCount

Number of desired copies of running tasks

Type:number (optional)
Default:1
environment

Environment variables to pass to the container

Type:string => string (optional)
Default:No environment variables
loadBalancerType

Whether to create an application load balancer or a network load balancer

Type:LoadBalancerType (optional)
Default:application
publicLoadBalancer

Determines whether the Application Load Balancer will be internet-facing

Type:boolean (optional)
Default:true

LoadBalancerType (enum)

class @aws-cdk/aws-ecs.LoadBalancerType

Language-specific names:

using Amazon.CDK.AWS.ECS;