com.pulumi.aws.ecs.TaskSet Maven / Gradle / Ivy
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.ecs;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.ecs.TaskSetArgs;
import com.pulumi.aws.ecs.inputs.TaskSetState;
import com.pulumi.aws.ecs.outputs.TaskSetCapacityProviderStrategy;
import com.pulumi.aws.ecs.outputs.TaskSetLoadBalancer;
import com.pulumi.aws.ecs.outputs.TaskSetNetworkConfiguration;
import com.pulumi.aws.ecs.outputs.TaskSetScale;
import com.pulumi.aws.ecs.outputs.TaskSetServiceRegistries;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* 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](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-external.html).
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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(exampleAwsEcsService.id())
* .cluster(exampleAwsEcsCluster.id())
* .taskDefinition(exampleAwsEcsTaskDefinition.arn())
* .loadBalancers(TaskSetLoadBalancerArgs.builder()
* .targetGroupArn(exampleAwsLbTargetGroup.arn())
* .containerName("mongo")
* .containerPort(8080)
* .build())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ### 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).
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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()
* .scale(TaskSetScaleArgs.builder()
* .value(50)
* .build())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Using `pulumi import`, import ECS Task Sets using the `task_set_id`, `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
* ```
*
*/
@ResourceType(type="aws:ecs/taskSet:TaskSet")
public class TaskSet extends com.pulumi.resources.CustomResource {
/**
* The Amazon Resource Name (ARN) that identifies the task set.
*
*/
@Export(name="arn", refs={String.class}, tree="[0]")
private Output arn;
/**
* @return The Amazon Resource Name (ARN) that identifies the task set.
*
*/
public Output arn() {
return this.arn;
}
/**
* The capacity provider strategy to use for the service. Can be one or more. Defined below.
*
*/
@Export(name="capacityProviderStrategies", refs={List.class,TaskSetCapacityProviderStrategy.class}, tree="[0,1]")
private Output* @Nullable */ List> capacityProviderStrategies;
/**
* @return The capacity provider strategy to use for the service. Can be one or more. Defined below.
*
*/
public Output>> capacityProviderStrategies() {
return Codegen.optional(this.capacityProviderStrategies);
}
/**
* The short name or ARN of the cluster that hosts the service to create the task set in.
*
*/
@Export(name="cluster", refs={String.class}, tree="[0]")
private Output cluster;
/**
* @return The short name or ARN of the cluster that hosts the service to create the task set in.
*
*/
public Output cluster() {
return this.cluster;
}
/**
* The external ID associated with the task set.
*
*/
@Export(name="externalId", refs={String.class}, tree="[0]")
private Output externalId;
/**
* @return The external ID associated with the task set.
*
*/
public Output externalId() {
return this.externalId;
}
/**
* 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.
*
*/
@Export(name="forceDelete", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> forceDelete;
/**
* @return 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.
*
*/
public Output> forceDelete() {
return Codegen.optional(this.forceDelete);
}
/**
* The launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`.
*
*/
@Export(name="launchType", refs={String.class}, tree="[0]")
private Output launchType;
/**
* @return The launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`.
*
*/
public Output launchType() {
return this.launchType;
}
/**
* Details on load balancers that are used with a task set. Detailed below.
*
*/
@Export(name="loadBalancers", refs={List.class,TaskSetLoadBalancer.class}, tree="[0,1]")
private Output* @Nullable */ List> loadBalancers;
/**
* @return Details on load balancers that are used with a task set. Detailed below.
*
*/
public Output>> loadBalancers() {
return Codegen.optional(this.loadBalancers);
}
/**
* 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.
*
*/
@Export(name="networkConfiguration", refs={TaskSetNetworkConfiguration.class}, tree="[0]")
private Output* @Nullable */ TaskSetNetworkConfiguration> networkConfiguration;
/**
* @return 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.
*
*/
public Output> networkConfiguration() {
return Codegen.optional(this.networkConfiguration);
}
/**
* 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](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
*
*/
@Export(name="platformVersion", refs={String.class}, tree="[0]")
private Output platformVersion;
/**
* @return 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](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
*
*/
public Output platformVersion() {
return this.platformVersion;
}
/**
* A floating-point percentage of the desired number of tasks to place and keep running in the task set. Detailed below.
*
*/
@Export(name="scale", refs={TaskSetScale.class}, tree="[0]")
private Output scale;
/**
* @return A floating-point percentage of the desired number of tasks to place and keep running in the task set. Detailed below.
*
*/
public Output scale() {
return this.scale;
}
/**
* The short name or ARN of the ECS service.
*
*/
@Export(name="service", refs={String.class}, tree="[0]")
private Output service;
/**
* @return The short name or ARN of the ECS service.
*
*/
public Output service() {
return this.service;
}
/**
* The service discovery registries for the service. The maximum number of `service_registries` blocks is `1`. Detailed below.
*
*/
@Export(name="serviceRegistries", refs={TaskSetServiceRegistries.class}, tree="[0]")
private Output* @Nullable */ TaskSetServiceRegistries> serviceRegistries;
/**
* @return The service discovery registries for the service. The maximum number of `service_registries` blocks is `1`. Detailed below.
*
*/
public Output> serviceRegistries() {
return Codegen.optional(this.serviceRegistries);
}
/**
* The stability status. This indicates whether the task set has reached a steady state.
*
*/
@Export(name="stabilityStatus", refs={String.class}, tree="[0]")
private Output stabilityStatus;
/**
* @return The stability status. This indicates whether the task set has reached a steady state.
*
*/
public Output stabilityStatus() {
return this.stabilityStatus;
}
/**
* The status of the task set.
*
*/
@Export(name="status", refs={String.class}, tree="[0]")
private Output status;
/**
* @return The status of the task set.
*
*/
public Output status() {
return this.status;
}
/**
* 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.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return 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.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
*
* @deprecated
* Please use `tags` instead.
*
*/
@Deprecated /* Please use `tags` instead. */
@Export(name="tagsAll", refs={Map.class,String.class}, tree="[0,1,1]")
private Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy