Package com.pulumi.aws.ecs
Class TaskSet
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.ecs.TaskSet
-
public class TaskSet extends com.pulumi.resources.CustomResourceProvides 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](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-external.html). ## Example Usage
### Ignoring Changes to Scale You can utilize the Pulumi `ignoreChanges` resource option to create an ECS service with an initial count of running instances, then ignore any changes to that count caused externally (e.g. Application Auto Scaling).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.ArrayList; import java.util.Arrays; 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() .loadBalancers(TaskSetLoadBalancerArgs.builder() .targetGroupArn(exampleAwsLbTargetGroup.arn()) .containerName("mongo") .containerPort(8080) .build()) .service(exampleAwsEcsService.id()) .cluster(exampleAwsEcsCluster.id()) .taskDefinition(exampleAwsEcsTaskDefinition.arn()) .build()); } }
## Import Using `pulumi import`, import ECS Task Sets using the `taskSetId`, `service`, and `cluster` separated by commas (`,`). For example: ```sh $ 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 ```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 com.pulumi.resources.CustomResourceOptions; import java.util.ArrayList; import java.util.Arrays; 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() .scale(TaskSetScaleArgs.builder() .value(50.0) .build()) .build(), CustomResourceOptions.builder() .ignoreChanges("scale") .build()); } }
-
-
Constructor Summary
Constructors Constructor Description TaskSet(java.lang.String name)TaskSet(java.lang.String name, TaskSetArgs args)TaskSet(java.lang.String name, TaskSetArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<java.util.Optional<java.util.List<TaskSetCapacityProviderStrategy>>>capacityProviderStrategies()com.pulumi.core.Output<java.lang.String>cluster()com.pulumi.core.Output<java.lang.String>externalId()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>forceDelete()static TaskSetget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, TaskSetState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>launchType()com.pulumi.core.Output<java.util.Optional<java.util.List<TaskSetLoadBalancer>>>loadBalancers()com.pulumi.core.Output<java.util.Optional<TaskSetNetworkConfiguration>>networkConfiguration()com.pulumi.core.Output<java.lang.String>platformVersion()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<TaskSetScale>scale()com.pulumi.core.Output<java.lang.String>service()com.pulumi.core.Output<java.util.Optional<TaskSetServiceRegistries>>serviceRegistries()com.pulumi.core.Output<java.lang.String>stabilityStatus()com.pulumi.core.Output<java.lang.String>status()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()com.pulumi.core.Output<java.lang.String>taskDefinition()com.pulumi.core.Output<java.lang.String>taskSetId()com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>waitUntilStable()com.pulumi.core.Output<java.util.Optional<java.lang.String>>waitUntilStableTimeout()
-
-
-
Constructor Detail
-
TaskSet
public TaskSet(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
TaskSet
public TaskSet(java.lang.String name, TaskSetArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
TaskSet
public TaskSet(java.lang.String name, TaskSetArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN that identifies the task set.
-
capacityProviderStrategies
public com.pulumi.core.Output<java.util.Optional<java.util.List<TaskSetCapacityProviderStrategy>>> capacityProviderStrategies()
- Returns:
- Capacity provider strategy to use for the service. Can be one or more. Defined below.
-
cluster
public com.pulumi.core.Output<java.lang.String> cluster()
- Returns:
- Short name or ARN of the cluster that hosts the service to create the task set in.
-
externalId
public com.pulumi.core.Output<java.lang.String> externalId()
- Returns:
- External ID associated with the task set.
-
forceDelete
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> forceDelete()
- Returns:
- 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.
-
launchType
public com.pulumi.core.Output<java.lang.String> launchType()
- Returns:
- Launch type on which to run your service. Valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`.
-
loadBalancers
public com.pulumi.core.Output<java.util.Optional<java.util.List<TaskSetLoadBalancer>>> loadBalancers()
- Returns:
- Details on load balancers that are used with a task set. Detailed below.
-
networkConfiguration
public com.pulumi.core.Output<java.util.Optional<TaskSetNetworkConfiguration>> networkConfiguration()
- Returns:
- Network configuration for the service. Required for task definitions that use the `awsvpc` network mode to receive their own Elastic Network Interface, and not supported for other network modes. Detailed below.
-
platformVersion
public com.pulumi.core.Output<java.lang.String> platformVersion()
- Returns:
- Platform version on which to run your service. Only applicable for `launchType` set to `FARGATE`. Defaults to `LATEST`. More information about Fargate platform versions can be found in the [AWS ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
scale
public com.pulumi.core.Output<TaskSetScale> scale()
- Returns:
- Floating-point percentage of the desired number of tasks to place and keep running in the task set. Detailed below.
-
service
public com.pulumi.core.Output<java.lang.String> service()
- Returns:
- Short name or ARN of the ECS service.
-
serviceRegistries
public com.pulumi.core.Output<java.util.Optional<TaskSetServiceRegistries>> serviceRegistries()
- Returns:
- Service discovery registries for the service. The maximum number of `serviceRegistries` blocks is `1`. Detailed below.
-
stabilityStatus
public com.pulumi.core.Output<java.lang.String> stabilityStatus()
- Returns:
- Stability status. This indicates whether the task set has reached a steady state.
-
status
public com.pulumi.core.Output<java.lang.String> status()
- Returns:
- Status of the task set.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- Map of tags to assign to the file system. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. If you have set `copyTagsToBackups` to true, and you specify one or more tags, no existing file system tags are copied from the file system to the backup.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
taskDefinition
public com.pulumi.core.Output<java.lang.String> taskDefinition()
- Returns:
- Family and revision (`family:revision`) or full ARN of the task definition to run in your service. The following arguments are optional:
-
taskSetId
public com.pulumi.core.Output<java.lang.String> taskSetId()
- Returns:
- ID of the task set.
-
waitUntilStable
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> waitUntilStable()
- Returns:
- Whether the provider should wait until the task set has reached `STEADY_STATE`.
-
waitUntilStableTimeout
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> waitUntilStableTimeout()
- Returns:
- Wait timeout for task set to reach `STEADY_STATE`. Valid time units include `ns`, `us` (or `µs`), `ms`, `s`, `m`, and `h`. Default `10m`.
-
get
public static TaskSet get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable TaskSetState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-