Module ecs

@pulumi/aws > ecs

class Cluster

extends CustomResource

Provides an ECS cluster.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const foo = new aws.ecs.Cluster("foo", {});

constructor

new Cluster(name: string, args?: ClusterArgs, opts?: pulumi.CustomResourceOptions)

Create a Cluster resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ClusterState, opts?: pulumi.CustomResourceOptions): Cluster

Get an existing Cluster resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The Amazon Resource Name (ARN) that identifies the cluster

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the cluster (up to 255 letters, numbers, hyphens, and underscores)

property tags

public tags: pulumi.Output<{[key: string]: any} | undefined>;

Key-value mapping of resource tags

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Service

extends CustomResource

Note: To prevent a race condition during service deletion, make sure to set depends_on to the related aws_iam_role_policy; otherwise, the policy may be destroyed too soon and the ECS service will then get stuck in the DRAINING state.

Provides an ECS service - effectively a task that is expected to run until an error occurs or a user terminates it (typically a webserver or a database).

See ECS Services section in AWS developer guide.

Example Usage

Ignoring Changes to Desired Count

You can utilize the generic Terraform resource lifecycle configuration block with ignore_changes to create an ECS service with an initial count of running instances, then ignore any changes to that count caused externally (e.g. Application Autoscaling).

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.ecs.Service("example", {
    // Example: Create service with 2 instances to start
    desiredCount: 2,
});

Daemon Scheduling Strategy

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const bar = new aws.ecs.Service("bar", {
    cluster: aws_ecs_cluster_foo.id,
    schedulingStrategy: "DAEMON",
    taskDefinition: aws_ecs_task_definition_bar.arn,
});

deployment_controller

The deployment_controller configuration block supports the following:

  • type - (Optional) Type of deployment controller. Valid values: CODE_DEPLOY, ECS. Default: ECS.

load_balancer

load_balancer supports the following:

  • elb_name - (Required for ELB Classic) The name of the ELB (Classic) to associate with the service.
  • target_group_arn - (Required for ALB/NLB) The ARN of the Load Balancer target group to associate with the service.
  • container_name - (Required) The name of the container to associate with the load balancer (as it appears in a container definition).
  • container_port - (Required) The port on the container to associate with the load balancer.

Note: As a result of an AWS limitation, a single load_balancer can be attached to the ECS service at most. See related docs.

ordered_placement_strategy

ordered_placement_strategy supports the following:

  • type - (Required) The type of placement strategy. Must be one of: binpack, random, or spread
  • field - (Optional) For the spread placement strategy, valid values are instanceId (or host, which has the same effect), or any platform or custom attribute that is applied to a container instance. For the binpack type, valid values are memory and cpu. For the random type, this attribute is not needed. For more information, see Placement Strategy.

Note: for spread, host and instanceId will be normalized, by AWS, to be instanceId. This means the statefile will show instanceId but your config will differ if you use host.

placement_constraints

placement_constraints support the following:

network_configuration

network_configuration support the following:

  • subnets - (Required) The subnets associated with the task or service.
  • security_groups - (Optional) The security groups associated with the task or service. If you do not specify a security group, the default security group for the VPC is used.
  • assign_public_ip - (Optional) Assign a public IP address to the ENI (Fargate launch type only). Valid values are true or false. Default false.

For more information, see Task Networking

service_registries

service_registries support the following:

  • registry_arn - (Required) The ARN of the Service Registry. The currently supported service registry is Amazon Route 53 Auto Naming Service(aws_service_discovery_service). For more information, see Service
  • port - (Optional) The port value used if your Service Discovery service specified an SRV record.
  • container_port - (Optional) The port value, already specified in the task definition, to be used for your service discovery service.
  • container_name - (Optional) The container name value, already specified in the task definition, to be used for your service discovery service.

constructor

new Service(name: string, args: ServiceArgs, opts?: pulumi.CustomResourceOptions)

Create a Service resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ServiceState, opts?: pulumi.CustomResourceOptions): Service

Get an existing Service resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property cluster

public cluster: pulumi.Output<string>;

ARN of an ECS cluster

property deploymentController

public deploymentController: pulumi.Output<{
    type: undefined | string;
} | undefined>;

Configuration block containing deployment controller configuration. Defined below.

property deploymentMaximumPercent

public deploymentMaximumPercent: pulumi.Output<number | undefined>;

The upper limit (as a percentage of the service’s desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the DAEMON scheduling strategy.

property deploymentMinimumHealthyPercent

public deploymentMinimumHealthyPercent: pulumi.Output<number | undefined>;

The lower limit (as a percentage of the service’s desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment.

property desiredCount

public desiredCount: pulumi.Output<number | undefined>;

The number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the DAEMON scheduling strategy.

property enableEcsManagedTags

public enableEcsManagedTags: pulumi.Output<boolean | undefined>;

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

property healthCheckGracePeriodSeconds

public healthCheckGracePeriodSeconds: pulumi.Output<number | undefined>;

Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers.

property iamRole

public iamRole: pulumi.Output<string>;

ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is required if you are using a load balancer with your service, but only if your task definition does not use the awsvpc network mode. If using awsvpc network mode, do not specify this role. If your account has already created the Amazon ECS service-linked role, that role is used by default for your service unless you specify a role here.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property launchType

public launchType: pulumi.Output<string | undefined>;

The launch type on which to run your service. The valid values are EC2 and FARGATE. Defaults to EC2.

property loadBalancers

public loadBalancers: pulumi.Output<{
    containerName: string;
    containerPort: number;
    elbName: undefined | string;
    targetGroupArn: undefined | string;
}[] | undefined>;

A load balancer block. Load balancers documented below.

property name

public name: pulumi.Output<string>;

The name of the service (up to 255 letters, numbers, hyphens, and underscores)

property networkConfiguration

public networkConfiguration: pulumi.Output<{
    assignPublicIp: undefined | false | true;
    securityGroups: string[];
    subnets: string[];
} | undefined>;

The network configuration for the service. This parameter is required for task definitions that use the awsvpc network mode to receive their own Elastic Network Interface, and it is not supported for other network modes.

property orderedPlacementStrategies

public orderedPlacementStrategies: pulumi.Output<{
    field: undefined | string;
    type: string;
}[] | undefined>;

Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. The maximum number of ordered_placement_strategy blocks is 5. Defined below.

property placementConstraints

public placementConstraints: pulumi.Output<{
    expression: undefined | string;
    type: string;
}[] | undefined>;

rules that are taken into consideration during task placement. Maximum number of placement_constraints is 10. Defined below.

property platformVersion

public platformVersion: pulumi.Output<string>;

The platform version on which to run your service. Only applicable for launch_type set to FARGATE. Defaults to LATEST. More information about Fargate platform versions can be found in the AWS ECS User Guide.

property propagateTags

public propagateTags: pulumi.Output<string | undefined>;

Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are SERVICE and TASK_DEFINITION.

property schedulingStrategy

public schedulingStrategy: pulumi.Output<string | undefined>;

The scheduling strategy to use for the service. The valid values are REPLICA and DAEMON. Defaults to REPLICA. Note that Fargate tasks do not support the DAEMON scheduling strategy.

property serviceRegistries

public serviceRegistries: pulumi.Output<{
    containerName: undefined | string;
    containerPort: undefined | number;
    port: undefined | number;
    registryArn: string;
} | undefined>;

The service discovery registries for the service. The maximum number of service_registries blocks is 1.

property tags

public tags: pulumi.Output<{[key: string]: any} | undefined>;

Key-value mapping of resource tags

property taskDefinition

public taskDefinition: pulumi.Output<string>;

The family and revision (family:revision) or full ARN of the task definition that you want to run in your service.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property waitForSteadyState

public waitForSteadyState: pulumi.Output<boolean | undefined>;

If true, Terraform will wait for the service to reach a steady state (like aws ecs wait services-stable) before continuing. Default false.

class TaskDefinition

extends CustomResource

Manages a revision of an ECS task definition to be used in aws_ecs_service.

constructor

new TaskDefinition(name: string, args: TaskDefinitionArgs, opts?: pulumi.CustomResourceOptions)

Create a TaskDefinition resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TaskDefinitionState, opts?: pulumi.CustomResourceOptions): TaskDefinition

Get an existing TaskDefinition resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

Full ARN of the Task Definition (including both family and revision).

property containerDefinitions

public containerDefinitions: pulumi.Output<string>;

A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.

property cpu

public cpu: pulumi.Output<string | undefined>;

The number of cpu units used by the task. If the requires_compatibilities is FARGATE this field is required.

property executionRoleArn

public executionRoleArn: pulumi.Output<string | undefined>;

The Amazon Resource Name (ARN) of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.

property family

public family: pulumi.Output<string>;

A unique name for your task definition.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ipcMode

public ipcMode: pulumi.Output<string | undefined>;

The IPC resource namespace to be used for the containers in the task The valid values are host, task, and none.

property memory

public memory: pulumi.Output<string | undefined>;

The amount (in MiB) of memory used by the task. If the requires_compatibilities is FARGATE this field is required.

property networkMode

public networkMode: pulumi.Output<string>;

The Docker networking mode to use for the containers in the task. The valid values are none, bridge, awsvpc, and host.

property pidMode

public pidMode: pulumi.Output<string | undefined>;

The process namespace to use for the containers in the task. The valid values are host and task.

property placementConstraints

public placementConstraints: pulumi.Output<{
    expression: undefined | string;
    type: string;
}[] | undefined>;

A set of placement constraints rules that are taken into consideration during task placement. Maximum number of placement_constraints is 10.

property requiresCompatibilities

public requiresCompatibilities: pulumi.Output<string[] | undefined>;

A set of launch types required by the task. The valid values are EC2 and FARGATE.

property revision

public revision: pulumi.Output<number>;

The revision of the task in a particular family.

property tags

public tags: pulumi.Output<{[key: string]: any} | undefined>;

Key-value mapping of resource tags

property taskRoleArn

public taskRoleArn: pulumi.Output<string | undefined>;

The ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property volumes

public volumes: pulumi.Output<{
    dockerVolumeConfiguration: undefined | {
        autoprovision: undefined | false | true;
        driver: undefined | string;
        driverOpts: undefined | {[key: string]: string};
        labels: undefined | {[key: string]: string};
        scope: string;
    };
    hostPath: undefined | string;
    name: string;
}[] | undefined>;

A set of volume blocks that containers in your task may use.

function getCluster

getCluster(args: GetClusterArgs, opts?: pulumi.InvokeOptions): Promise<GetClusterResult>

The ECS Cluster data source allows access to details of a specific cluster within an AWS ECS service.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const ecs_mongo = pulumi.output(aws.ecs.getCluster({
    clusterName: "ecs-mongo-production",
}));

function getContainerDefinition

getContainerDefinition(args: GetContainerDefinitionArgs, opts?: pulumi.InvokeOptions): Promise<GetContainerDefinitionResult>

The ECS container definition data source allows access to details of a specific container within an AWS ECS service.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const ecs_mongo = aws_ecs_task_definition_mongo.id.apply(id => aws.ecs.getContainerDefinition({
    containerName: "mongodb",
    taskDefinition: id,
}));

function getService

getService(args: GetServiceArgs, opts?: pulumi.InvokeOptions): Promise<GetServiceResult>

The ECS Service data source allows access to details of a specific Service within a AWS ECS Cluster.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = aws_ecs_cluster_example.arn.apply(arn => aws.ecs.getService({
    clusterArn: arn,
    serviceName: "example",
}));

function getTaskDefinition

getTaskDefinition(args: GetTaskDefinitionArgs, opts?: pulumi.InvokeOptions): Promise<GetTaskDefinitionResult>

The ECS task definition data source allows access to details of a specific AWS ECS task definition.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const foo = new aws.ecs.Cluster("foo", {});
const mongoTaskDefinition = new aws.ecs.TaskDefinition("mongo", {
    containerDefinitions: `[
  {
    "cpu": 128,
    "environment": [{
      "name": "SECRET",
      "value": "KEY"
    }],
    "essential": true,
    "image": "mongo:latest",
    "memory": 128,
    "memoryReservation": 64,
    "name": "mongodb"
  }
]
`,
    family: "mongodb",
});
// Simply specify the family to find the latest ACTIVE revision in that family.
const mongoEcsTaskDefinition = mongoTaskDefinition.family.apply(family => aws.ecs.getTaskDefinition({
    taskDefinition: family,
}));
const mongoService = new aws.ecs.Service("mongo", {
    cluster: foo.id,
    desiredCount: 2,
    taskDefinition: pulumi.all([mongoTaskDefinition.family, mongoTaskDefinition.revision, mongoEcsTaskDefinition]).apply(([family, revision, mongoEcsTaskDefinition]) => `${family}:${(() => {
        throw "tf2pulumi error: NYI: call to max";
        return (() => { throw "NYI: call to max"; })();
    })()}`),
});

interface ClusterArgs

The set of arguments for constructing a Cluster resource.

property name

name?: pulumi.Input<string>;

The name of the cluster (up to 255 letters, numbers, hyphens, and underscores)

property tags

tags?: pulumi.Input<{[key: string]: any}>;

Key-value mapping of resource tags

interface ClusterState

Input properties used for looking up and filtering Cluster resources.

property arn

arn?: pulumi.Input<string>;

The Amazon Resource Name (ARN) that identifies the cluster

property name

name?: pulumi.Input<string>;

The name of the cluster (up to 255 letters, numbers, hyphens, and underscores)

property tags

tags?: pulumi.Input<{[key: string]: any}>;

Key-value mapping of resource tags

interface ContainerDefinition

property command

command?: string[];

property cpu

cpu?: undefined | number;

property disableNetworking

disableNetworking?: undefined | false | true;

property dnsSearchDomains

dnsSearchDomains?: string[];

property dnsServers

dnsServers?: string[];

property dockerLabels

dockerLabels?: undefined | {[label: string]: string};

property dockerSecurityOptions

dockerSecurityOptions?: string[];

property entryPoint

entryPoint?: string[];

property environment

environment?: KeyValuePair[];

property essential

essential?: undefined | false | true;

property extraHosts

extraHosts?: HostEntry[];

property healthCheck

healthCheck?: HealthCheck;

property hostname

hostname?: undefined | string;

property image

image?: undefined | string;
links?: string[];

property linuxParameters

linuxParameters?: LinuxParameters;

property logConfiguration

logConfiguration?: LogConfiguration;

property memory

memory?: undefined | number;

property memoryReservation

memoryReservation?: undefined | number;

property mountPoints

mountPoints?: MountPoint[];

property name

name: string;

property portMappings

portMappings?: PortMapping[];

property privileged

privileged?: undefined | false | true;

property readonlyRootFilesystem

readonlyRootFilesystem?: undefined | false | true;

property ulimits

ulimits?: Ulimit[];

property user

user?: undefined | string;

property volumesFrom

volumesFrom?: VolumeFrom[];

property workingDirectory

workingDirectory?: undefined | string;

interface Device

interface GetClusterArgs

A collection of arguments for invoking getCluster.

property clusterName

clusterName: string;

The name of the ECS Cluster

interface GetClusterResult

A collection of values returned by getCluster.

property arn

arn: string;

The ARN of the ECS Cluster

property clusterName

clusterName: string;

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property pendingTasksCount

pendingTasksCount: number;

The number of pending tasks for the ECS Cluster

property registeredContainerInstancesCount

registeredContainerInstancesCount: number;

The number of registered container instances for the ECS Cluster

property runningTasksCount

runningTasksCount: number;

The number of running tasks for the ECS Cluster

property status

status: string;

The status of the ECS Cluster

interface GetContainerDefinitionArgs

A collection of arguments for invoking getContainerDefinition.

property containerName

containerName: string;

The name of the container definition

property taskDefinition

taskDefinition: string;

The ARN of the task definition which contains the container

interface GetContainerDefinitionResult

A collection of values returned by getContainerDefinition.

property containerName

containerName: string;

property cpu

cpu: number;

The CPU limit for this container definition

property disableNetworking

disableNetworking: boolean;

Indicator if networking is disabled

property dockerLabels

dockerLabels: {[key: string]: string};

Set docker labels

property environment

environment: {[key: string]: string};

The environment in use

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property image

image: string;

The docker image in use, including the digest

property imageDigest

imageDigest: string;

The digest of the docker image in use

property memory

memory: number;

The memory limit for this container definition

property memoryReservation

memoryReservation: number;

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 to this soft limit

property taskDefinition

taskDefinition: string;

interface GetServiceArgs

A collection of arguments for invoking getService.

property clusterArn

clusterArn: string;

The arn of the ECS Cluster

property serviceName

serviceName: string;

The name of the ECS Service

interface GetServiceResult

A collection of values returned by getService.

property arn

arn: string;

The ARN of the ECS Service

property clusterArn

clusterArn: string;

property desiredCount

desiredCount: number;

The number of tasks for the ECS Service

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property launchType

launchType: string;

The launch type for the ECS Service

property schedulingStrategy

schedulingStrategy: string;

The scheduling strategy for the ECS Service

property serviceName

serviceName: string;

property taskDefinition

taskDefinition: string;

The family for the latest ACTIVE revision

interface GetTaskDefinitionArgs

A collection of arguments for invoking getTaskDefinition.

property taskDefinition

taskDefinition: string;

The family for the latest ACTIVE revision, family and revision (family:revision) for a specific revision in the family, the ARN of the task definition to access to.

interface GetTaskDefinitionResult

A collection of values returned by getTaskDefinition.

property family

family: string;

The family of this task definition

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property networkMode

networkMode: string;

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

property revision

revision: number;

The revision of this task definition

property status

status: string;

The status of this task definition

property taskDefinition

taskDefinition: string;

property taskRoleArn

taskRoleArn: string;

The ARN of the IAM role that containers in this task can assume

interface HealthCheck

The health check command and associated configuration parameters for the container. This parameter maps to HealthCheck in the Create a container section of the Docker Remote API and the HEALTHCHECK parameter of docker run.

https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_HealthCheck.html

property command

command?: string[];

A string array representing the command that the container runs to determine if it is healthy. The string array must start with CMD to execute the command arguments directly, or CMD-SHELL to run the command with the container’s default shell. For example:

[ “CMD-SHELL”, “curl -f http://localhost/ || exit 1” ]

An exit code of 0 indicates success, and non-zero exit code indicates failure. For more information, see HealthCheck in the Create a container section of the Docker Remote API.

property interval

interval?: undefined | number;

The time period in seconds between each health check execution. You may specify between 5 and 300 seconds. The default value is 30 seconds.

property retries

retries?: undefined | number;

The number of times to retry a failed health check before the container is considered unhealthy. You may specify between 1 and 10 retries. The default value is 3.

property startPeriod

startPeriod?: undefined | number;

The optional grace period within which to provide containers time to bootstrap before failed health checks count towards the maximum number of retries. You may specify between 0 and 300 seconds. The startPeriod is disabled by default.

Note: If a health check succeeds within the startPeriod, then the container is considered healthy and any subsequent failures count toward the maximum number of retries.

property timeout

timeout?: undefined | number;

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. The default value is 5.

interface HostEntry

interface KernelCapabilities

interface KeyValuePair

interface LinuxParameters

property capabilities

capabilities?: KernelCapabilities;

property devices

devices?: Device[];

property initProcessEnabled

initProcessEnabled?: undefined | false | true;

interface LogConfiguration

interface MountPoint

property containerPath

containerPath?: undefined | string;

property readOnly

readOnly?: undefined | false | true;

property sourceVolume

sourceVolume?: undefined | string;

interface PortMapping

interface ServiceArgs

The set of arguments for constructing a Service resource.

property cluster

cluster?: pulumi.Input<string>;

ARN of an ECS cluster

property deploymentController

deploymentController?: pulumi.Input<{
    type: pulumi.Input<string>;
}>;

Configuration block containing deployment controller configuration. Defined below.

property deploymentMaximumPercent

deploymentMaximumPercent?: pulumi.Input<number>;

The upper limit (as a percentage of the service’s desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the DAEMON scheduling strategy.

property deploymentMinimumHealthyPercent

deploymentMinimumHealthyPercent?: pulumi.Input<number>;

The lower limit (as a percentage of the service’s desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment.

property desiredCount

desiredCount?: pulumi.Input<number>;

The number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the DAEMON scheduling strategy.

property enableEcsManagedTags

enableEcsManagedTags?: pulumi.Input<boolean>;

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

property healthCheckGracePeriodSeconds

healthCheckGracePeriodSeconds?: pulumi.Input<number>;

Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers.

property iamRole

iamRole?: pulumi.Input<string>;

ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is required if you are using a load balancer with your service, but only if your task definition does not use the awsvpc network mode. If using awsvpc network mode, do not specify this role. If your account has already created the Amazon ECS service-linked role, that role is used by default for your service unless you specify a role here.

property launchType

launchType?: pulumi.Input<string>;

The launch type on which to run your service. The valid values are EC2 and FARGATE. Defaults to EC2.

property loadBalancers

loadBalancers?: pulumi.Input<pulumi.Input<{
    containerName: pulumi.Input<string>;
    containerPort: pulumi.Input<number>;
    elbName: pulumi.Input<string>;
    targetGroupArn: pulumi.Input<string>;
}>[]>;

A load balancer block. Load balancers documented below.

property name

name?: pulumi.Input<string>;

The name of the service (up to 255 letters, numbers, hyphens, and underscores)

property networkConfiguration

networkConfiguration?: pulumi.Input<{
    assignPublicIp: pulumi.Input<boolean>;
    securityGroups: pulumi.Input<pulumi.Input<string>[]>;
    subnets: pulumi.Input<pulumi.Input<string>[]>;
}>;

The network configuration for the service. This parameter is required for task definitions that use the awsvpc network mode to receive their own Elastic Network Interface, and it is not supported for other network modes.

property orderedPlacementStrategies

orderedPlacementStrategies?: pulumi.Input<pulumi.Input<{
    field: pulumi.Input<string>;
    type: pulumi.Input<string>;
}>[]>;

Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. The maximum number of ordered_placement_strategy blocks is 5. Defined below.

property placementConstraints

placementConstraints?: pulumi.Input<pulumi.Input<{
    expression: pulumi.Input<string>;
    type: pulumi.Input<string>;
}>[]>;

rules that are taken into consideration during task placement. Maximum number of placement_constraints is 10. Defined below.

property platformVersion

platformVersion?: pulumi.Input<string>;

The platform version on which to run your service. Only applicable for launch_type set to FARGATE. Defaults to LATEST. More information about Fargate platform versions can be found in the AWS ECS User Guide.

property propagateTags

propagateTags?: pulumi.Input<string>;

Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are SERVICE and TASK_DEFINITION.

property schedulingStrategy

schedulingStrategy?: pulumi.Input<string>;

The scheduling strategy to use for the service. The valid values are REPLICA and DAEMON. Defaults to REPLICA. Note that Fargate tasks do not support the DAEMON scheduling strategy.

property serviceRegistries

serviceRegistries?: pulumi.Input<{
    containerName: pulumi.Input<string>;
    containerPort: pulumi.Input<number>;
    port: pulumi.Input<number>;
    registryArn: pulumi.Input<string>;
}>;

The service discovery registries for the service. The maximum number of service_registries blocks is 1.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

Key-value mapping of resource tags

property taskDefinition

taskDefinition: pulumi.Input<string>;

The family and revision (family:revision) or full ARN of the task definition that you want to run in your service.

property waitForSteadyState

waitForSteadyState?: pulumi.Input<boolean>;

If true, Terraform will wait for the service to reach a steady state (like aws ecs wait services-stable) before continuing. Default false.

interface ServiceState

Input properties used for looking up and filtering Service resources.

property cluster

cluster?: pulumi.Input<string>;

ARN of an ECS cluster

property deploymentController

deploymentController?: pulumi.Input<{
    type: pulumi.Input<string>;
}>;

Configuration block containing deployment controller configuration. Defined below.

property deploymentMaximumPercent

deploymentMaximumPercent?: pulumi.Input<number>;

The upper limit (as a percentage of the service’s desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the DAEMON scheduling strategy.

property deploymentMinimumHealthyPercent

deploymentMinimumHealthyPercent?: pulumi.Input<number>;

The lower limit (as a percentage of the service’s desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment.

property desiredCount

desiredCount?: pulumi.Input<number>;

The number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the DAEMON scheduling strategy.

property enableEcsManagedTags

enableEcsManagedTags?: pulumi.Input<boolean>;

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

property healthCheckGracePeriodSeconds

healthCheckGracePeriodSeconds?: pulumi.Input<number>;

Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers.

property iamRole

iamRole?: pulumi.Input<string>;

ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is required if you are using a load balancer with your service, but only if your task definition does not use the awsvpc network mode. If using awsvpc network mode, do not specify this role. If your account has already created the Amazon ECS service-linked role, that role is used by default for your service unless you specify a role here.

property launchType

launchType?: pulumi.Input<string>;

The launch type on which to run your service. The valid values are EC2 and FARGATE. Defaults to EC2.

property loadBalancers

loadBalancers?: pulumi.Input<pulumi.Input<{
    containerName: pulumi.Input<string>;
    containerPort: pulumi.Input<number>;
    elbName: pulumi.Input<string>;
    targetGroupArn: pulumi.Input<string>;
}>[]>;

A load balancer block. Load balancers documented below.

property name

name?: pulumi.Input<string>;

The name of the service (up to 255 letters, numbers, hyphens, and underscores)

property networkConfiguration

networkConfiguration?: pulumi.Input<{
    assignPublicIp: pulumi.Input<boolean>;
    securityGroups: pulumi.Input<pulumi.Input<string>[]>;
    subnets: pulumi.Input<pulumi.Input<string>[]>;
}>;

The network configuration for the service. This parameter is required for task definitions that use the awsvpc network mode to receive their own Elastic Network Interface, and it is not supported for other network modes.

property orderedPlacementStrategies

orderedPlacementStrategies?: pulumi.Input<pulumi.Input<{
    field: pulumi.Input<string>;
    type: pulumi.Input<string>;
}>[]>;

Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. The maximum number of ordered_placement_strategy blocks is 5. Defined below.

property placementConstraints

placementConstraints?: pulumi.Input<pulumi.Input<{
    expression: pulumi.Input<string>;
    type: pulumi.Input<string>;
}>[]>;

rules that are taken into consideration during task placement. Maximum number of placement_constraints is 10. Defined below.

property platformVersion

platformVersion?: pulumi.Input<string>;

The platform version on which to run your service. Only applicable for launch_type set to FARGATE. Defaults to LATEST. More information about Fargate platform versions can be found in the AWS ECS User Guide.

property propagateTags

propagateTags?: pulumi.Input<string>;

Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are SERVICE and TASK_DEFINITION.

property schedulingStrategy

schedulingStrategy?: pulumi.Input<string>;

The scheduling strategy to use for the service. The valid values are REPLICA and DAEMON. Defaults to REPLICA. Note that Fargate tasks do not support the DAEMON scheduling strategy.

property serviceRegistries

serviceRegistries?: pulumi.Input<{
    containerName: pulumi.Input<string>;
    containerPort: pulumi.Input<number>;
    port: pulumi.Input<number>;
    registryArn: pulumi.Input<string>;
}>;

The service discovery registries for the service. The maximum number of service_registries blocks is 1.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

Key-value mapping of resource tags

property taskDefinition

taskDefinition?: pulumi.Input<string>;

The family and revision (family:revision) or full ARN of the task definition that you want to run in your service.

property waitForSteadyState

waitForSteadyState?: pulumi.Input<boolean>;

If true, Terraform will wait for the service to reach a steady state (like aws ecs wait services-stable) before continuing. Default false.

interface TaskDefinitionArgs

The set of arguments for constructing a TaskDefinition resource.

property containerDefinitions

containerDefinitions: pulumi.Input<string>;

A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.

property cpu

cpu?: pulumi.Input<string>;

The number of cpu units used by the task. If the requires_compatibilities is FARGATE this field is required.

property executionRoleArn

executionRoleArn?: pulumi.Input<string>;

The Amazon Resource Name (ARN) of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.

property family

family: pulumi.Input<string>;

A unique name for your task definition.

property ipcMode

ipcMode?: pulumi.Input<string>;

The IPC resource namespace to be used for the containers in the task The valid values are host, task, and none.

property memory

memory?: pulumi.Input<string>;

The amount (in MiB) of memory used by the task. If the requires_compatibilities is FARGATE this field is required.

property networkMode

networkMode?: pulumi.Input<string>;

The Docker networking mode to use for the containers in the task. The valid values are none, bridge, awsvpc, and host.

property pidMode

pidMode?: pulumi.Input<string>;

The process namespace to use for the containers in the task. The valid values are host and task.

property placementConstraints

placementConstraints?: pulumi.Input<pulumi.Input<{
    expression: pulumi.Input<string>;
    type: pulumi.Input<string>;
}>[]>;

A set of placement constraints rules that are taken into consideration during task placement. Maximum number of placement_constraints is 10.

property requiresCompatibilities

requiresCompatibilities?: pulumi.Input<pulumi.Input<string>[]>;

A set of launch types required by the task. The valid values are EC2 and FARGATE.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

Key-value mapping of resource tags

property taskRoleArn

taskRoleArn?: pulumi.Input<string>;

The ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.

property volumes

volumes?: pulumi.Input<pulumi.Input<{
    dockerVolumeConfiguration: pulumi.Input<{
        autoprovision: pulumi.Input<boolean>;
        driver: pulumi.Input<string>;
        driverOpts: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
        labels: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
        scope: pulumi.Input<string>;
    }>;
    hostPath: pulumi.Input<string>;
    name: pulumi.Input<string>;
}>[]>;

A set of volume blocks that containers in your task may use.

interface TaskDefinitionState

Input properties used for looking up and filtering TaskDefinition resources.

property arn

arn?: pulumi.Input<string>;

Full ARN of the Task Definition (including both family and revision).

property containerDefinitions

containerDefinitions?: pulumi.Input<string>;

A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.

property cpu

cpu?: pulumi.Input<string>;

The number of cpu units used by the task. If the requires_compatibilities is FARGATE this field is required.

property executionRoleArn

executionRoleArn?: pulumi.Input<string>;

The Amazon Resource Name (ARN) of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.

property family

family?: pulumi.Input<string>;

A unique name for your task definition.

property ipcMode

ipcMode?: pulumi.Input<string>;

The IPC resource namespace to be used for the containers in the task The valid values are host, task, and none.

property memory

memory?: pulumi.Input<string>;

The amount (in MiB) of memory used by the task. If the requires_compatibilities is FARGATE this field is required.

property networkMode

networkMode?: pulumi.Input<string>;

The Docker networking mode to use for the containers in the task. The valid values are none, bridge, awsvpc, and host.

property pidMode

pidMode?: pulumi.Input<string>;

The process namespace to use for the containers in the task. The valid values are host and task.

property placementConstraints

placementConstraints?: pulumi.Input<pulumi.Input<{
    expression: pulumi.Input<string>;
    type: pulumi.Input<string>;
}>[]>;

A set of placement constraints rules that are taken into consideration during task placement. Maximum number of placement_constraints is 10.

property requiresCompatibilities

requiresCompatibilities?: pulumi.Input<pulumi.Input<string>[]>;

A set of launch types required by the task. The valid values are EC2 and FARGATE.

property revision

revision?: pulumi.Input<number>;

The revision of the task in a particular family.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

Key-value mapping of resource tags

property taskRoleArn

taskRoleArn?: pulumi.Input<string>;

The ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.

property volumes

volumes?: pulumi.Input<pulumi.Input<{
    dockerVolumeConfiguration: pulumi.Input<{
        autoprovision: pulumi.Input<boolean>;
        driver: pulumi.Input<string>;
        driverOpts: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
        labels: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
        scope: pulumi.Input<string>;
    }>;
    hostPath: pulumi.Input<string>;
    name: pulumi.Input<string>;
}>[]>;

A set of volume blocks that containers in your task may use.

interface Ulimit

interface VolumeFrom

property readOnly

readOnly?: undefined | false | true;

property sourceContainer

sourceContainer?: undefined | string;

type KernelCapability

type KernelCapability = “ALL” | “AUDIT_CONTROL” | “AUDIT_WRITE” | “BLOCK_SUSPEND” | “CHOWN” | “DAC_OVERRIDE” | “DAC_READ_SEARCH” | “FOWNER” | “FSETID” | “IPC_LOCK” | “IPC_OWNER” | “KILL” | “LEASE” | “LINUX_IMMUTABLE” | “MAC_ADMIN” | “MAC_OVERRIDE” | “MKNOD” | “NET_ADMIN” | “NET_BIND_SERVICE” | “NET_BROADCAST” | “NET_RAW” | “SETFCAP” | “SETGID” | “SETPCAP” | “SETUID” | “SYS_ADMIN” | “SYS_BOOT” | “SYS_CHROOT” | “SYS_MODULE” | “SYS_NICE” | “SYS_PACCT” | “SYS_PTRACE” | “SYS_RAWIO” | “SYS_RESOURCE” | “SYS_TIME” | “SYS_TTY_CONFIG” | “SYSLOG” | “WAKE_ALARM”;

type LogDriver

type LogDriver = “json-file” | “syslog” | “journald” | “gelf” | “fluentd” | “awslogs” | “splunk”;

type Protocol

type Protocol = “tcp” | “udp”;

type UlimitName

type UlimitName = “core” | “cpu” | “data” | “fsize” | “locks” | “memlock” | “msgqueue” | “nice” | “nofile” | “nproc” | “rss” | “rtprio” | “rttime” | “sigpending” | “stack”;