TaskSetArgs

data class TaskSetArgs(val capacityProviderStrategies: Output<List<TaskSetCapacityProviderStrategyArgs>>? = null, val cluster: Output<String>? = null, val externalId: Output<String>? = null, val forceDelete: Output<Boolean>? = null, val launchType: Output<String>? = null, val loadBalancers: Output<List<TaskSetLoadBalancerArgs>>? = null, val networkConfiguration: Output<TaskSetNetworkConfigurationArgs>? = null, val platformVersion: Output<String>? = null, val scale: Output<TaskSetScaleArgs>? = null, val service: Output<String>? = null, val serviceRegistries: Output<TaskSetServiceRegistriesArgs>? = null, val tags: Output<Map<String, String>>? = null, val taskDefinition: Output<String>? = null, val waitUntilStable: Output<Boolean>? = null, val waitUntilStableTimeout: Output<String>? = null) : ConvertibleToJava<TaskSetArgs>

Provides an ECS task set - 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 Task Set section in AWS developer guide.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ecs.TaskSet;
import com.pulumi.aws.ecs.TaskSetArgs;
import com.pulumi.aws.ecs.inputs.TaskSetLoadBalancerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new TaskSet("example", TaskSetArgs.builder()
.service(aws_ecs_service.example().id())
.cluster(aws_ecs_cluster.example().id())
.taskDefinition(aws_ecs_task_definition.example().arn())
.loadBalancers(TaskSetLoadBalancerArgs.builder()
.targetGroupArn(aws_lb_target_group.example().arn())
.containerName("mongo")
.containerPort(8080)
.build())
.build());
}
}

Ignoring Changes to Scale

You can utilize the generic 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).

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ecs.TaskSet;
import com.pulumi.aws.ecs.TaskSetArgs;
import com.pulumi.aws.ecs.inputs.TaskSetScaleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new TaskSet("example", TaskSetArgs.builder()
.lifecycle(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.scale(TaskSetScaleArgs.builder()
.value(50)
.build())
.build());
}
}

Import

ECS Task Sets can be imported via the task_set_id, service, and cluster separated by commas (,) e.g.

$ pulumi import aws:ecs/taskSet:TaskSet example ecs-svc/7177320696926227436,arn:aws:ecs:us-west-2:123456789101:service/example/example-1234567890,arn:aws:ecs:us-west-2:123456789101:cluster/example

Constructors

Link copied to clipboard
constructor(capacityProviderStrategies: Output<List<TaskSetCapacityProviderStrategyArgs>>? = null, cluster: Output<String>? = null, externalId: Output<String>? = null, forceDelete: Output<Boolean>? = null, launchType: Output<String>? = null, loadBalancers: Output<List<TaskSetLoadBalancerArgs>>? = null, networkConfiguration: Output<TaskSetNetworkConfigurationArgs>? = null, platformVersion: Output<String>? = null, scale: Output<TaskSetScaleArgs>? = null, service: Output<String>? = null, serviceRegistries: Output<TaskSetServiceRegistriesArgs>? = null, tags: Output<Map<String, String>>? = null, taskDefinition: Output<String>? = null, waitUntilStable: Output<Boolean>? = null, waitUntilStableTimeout: Output<String>? = null)

Properties

Link copied to clipboard

The capacity provider strategy to use for the service. Can be one or more. Defined below.

Link copied to clipboard
val cluster: Output<String>? = null

The short name or ARN of the cluster that hosts the service to create the task set in.

Link copied to clipboard
val externalId: Output<String>? = null

The external ID associated with the task set.

Link copied to clipboard
val forceDelete: Output<Boolean>? = null

Whether to allow deleting the task set without waiting for scaling down to 0. You can force a task set to delete even if it's in the process of scaling a resource. Normally, the provider drains all the tasks before deleting the task set. This bypasses that behavior and potentially leaves resources dangling.

Link copied to clipboard
val launchType: Output<String>? = null

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

Link copied to clipboard

Details on load balancers that are used with a task set. Detailed below.

Link copied to clipboard

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. Detailed below.

Link copied to clipboard
val platformVersion: Output<String>? = null

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.

Link copied to clipboard
val scale: Output<TaskSetScaleArgs>? = null

A floating-point percentage of the desired number of tasks to place and keep running in the task set. Detailed below.

Link copied to clipboard
val service: Output<String>? = null

The short name or ARN of the ECS service.

Link copied to clipboard

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

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A map of tags to assign to the file system. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. If you have set copy_tags_to_backups to true, and you specify one or more tags, no existing file system tags are copied from the file system to the backup.

Link copied to clipboard
val taskDefinition: Output<String>? = null

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

Link copied to clipboard
val waitUntilStable: Output<Boolean>? = null

Whether the provider should wait until the task set has reached STEADY_STATE.

Link copied to clipboard
val waitUntilStableTimeout: Output<String>? = null

Wait timeout for task set to reach STEADY_STATE. Valid time units include ns, us (or µs), ms, s, m, and h. Default 10m.

Functions

Link copied to clipboard
open override fun toJava(): TaskSetArgs