Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.aws.ecs.ServiceArgs 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.ecs.inputs.ServiceAlarmsArgs;
import com.pulumi.aws.ecs.inputs.ServiceCapacityProviderStrategyArgs;
import com.pulumi.aws.ecs.inputs.ServiceDeploymentCircuitBreakerArgs;
import com.pulumi.aws.ecs.inputs.ServiceDeploymentControllerArgs;
import com.pulumi.aws.ecs.inputs.ServiceLoadBalancerArgs;
import com.pulumi.aws.ecs.inputs.ServiceNetworkConfigurationArgs;
import com.pulumi.aws.ecs.inputs.ServiceOrderedPlacementStrategyArgs;
import com.pulumi.aws.ecs.inputs.ServicePlacementConstraintArgs;
import com.pulumi.aws.ecs.inputs.ServiceServiceConnectConfigurationArgs;
import com.pulumi.aws.ecs.inputs.ServiceServiceRegistriesArgs;
import com.pulumi.aws.ecs.inputs.ServiceVolumeConfigurationArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
public final class ServiceArgs extends com.pulumi.resources.ResourceArgs {
public static final ServiceArgs Empty = new ServiceArgs();
/**
* Information about the CloudWatch alarms. See below.
*
*/
@Import(name="alarms")
private @Nullable Output alarms;
/**
* @return Information about the CloudWatch alarms. See below.
*
*/
public Optional> alarms() {
return Optional.ofNullable(this.alarms);
}
/**
* Capacity provider strategies to use for the service. Can be one or more. These can be updated without destroying and recreating the service only if `force_new_deployment = true` and not changing from 0 `capacity_provider_strategy` blocks to greater than 0, or vice versa. See below. Conflicts with `launch_type`.
*
*/
@Import(name="capacityProviderStrategies")
private @Nullable Output> capacityProviderStrategies;
/**
* @return Capacity provider strategies to use for the service. Can be one or more. These can be updated without destroying and recreating the service only if `force_new_deployment = true` and not changing from 0 `capacity_provider_strategy` blocks to greater than 0, or vice versa. See below. Conflicts with `launch_type`.
*
*/
public Optional>> capacityProviderStrategies() {
return Optional.ofNullable(this.capacityProviderStrategies);
}
/**
* ARN of an ECS cluster.
*
*/
@Import(name="cluster")
private @Nullable Output cluster;
/**
* @return ARN of an ECS cluster.
*
*/
public Optional> cluster() {
return Optional.ofNullable(this.cluster);
}
/**
* Configuration block for deployment circuit breaker. See below.
*
*/
@Import(name="deploymentCircuitBreaker")
private @Nullable Output deploymentCircuitBreaker;
/**
* @return Configuration block for deployment circuit breaker. See below.
*
*/
public Optional> deploymentCircuitBreaker() {
return Optional.ofNullable(this.deploymentCircuitBreaker);
}
/**
* Configuration block for deployment controller configuration. See below.
*
*/
@Import(name="deploymentController")
private @Nullable Output deploymentController;
/**
* @return Configuration block for deployment controller configuration. See below.
*
*/
public Optional> deploymentController() {
return Optional.ofNullable(this.deploymentController);
}
/**
* 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.
*
*/
@Import(name="deploymentMaximumPercent")
private @Nullable Output deploymentMaximumPercent;
/**
* @return 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.
*
*/
public Optional> deploymentMaximumPercent() {
return Optional.ofNullable(this.deploymentMaximumPercent);
}
/**
* 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.
*
*/
@Import(name="deploymentMinimumHealthyPercent")
private @Nullable Output deploymentMinimumHealthyPercent;
/**
* @return 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.
*
*/
public Optional> deploymentMinimumHealthyPercent() {
return Optional.ofNullable(this.deploymentMinimumHealthyPercent);
}
/**
* Number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy.
*
*/
@Import(name="desiredCount")
private @Nullable Output desiredCount;
/**
* @return Number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy.
*
*/
public Optional> desiredCount() {
return Optional.ofNullable(this.desiredCount);
}
/**
* Whether to enable Amazon ECS managed tags for the tasks within the service.
*
*/
@Import(name="enableEcsManagedTags")
private @Nullable Output enableEcsManagedTags;
/**
* @return Whether to enable Amazon ECS managed tags for the tasks within the service.
*
*/
public Optional> enableEcsManagedTags() {
return Optional.ofNullable(this.enableEcsManagedTags);
}
/**
* Whether to enable Amazon ECS Exec for the tasks within the service.
*
*/
@Import(name="enableExecuteCommand")
private @Nullable Output enableExecuteCommand;
/**
* @return Whether to enable Amazon ECS Exec for the tasks within the service.
*
*/
public Optional> enableExecuteCommand() {
return Optional.ofNullable(this.enableExecuteCommand);
}
/**
* Enable to delete a service even if it wasn't scaled down to zero tasks. It's only necessary to use this if the service uses the `REPLICA` scheduling strategy.
*
*/
@Import(name="forceDelete")
private @Nullable Output forceDelete;
/**
* @return Enable to delete a service even if it wasn't scaled down to zero tasks. It's only necessary to use this if the service uses the `REPLICA` scheduling strategy.
*
*/
public Optional> forceDelete() {
return Optional.ofNullable(this.forceDelete);
}
/**
* Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates.
* When using the forceNewDeployment property you also need to configure the triggers property.
*
*/
@Import(name="forceNewDeployment")
private @Nullable Output forceNewDeployment;
/**
* @return Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates.
* When using the forceNewDeployment property you also need to configure the triggers property.
*
*/
public Optional> forceNewDeployment() {
return Optional.ofNullable(this.forceNewDeployment);
}
/**
* 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.
*
*/
@Import(name="healthCheckGracePeriodSeconds")
private @Nullable Output healthCheckGracePeriodSeconds;
/**
* @return 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.
*
*/
public Optional> healthCheckGracePeriodSeconds() {
return Optional.ofNullable(this.healthCheckGracePeriodSeconds);
}
/**
* 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.
*
*/
@Import(name="iamRole")
private @Nullable Output iamRole;
/**
* @return 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.
*
*/
public Optional> iamRole() {
return Optional.ofNullable(this.iamRole);
}
/**
* Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`. Conflicts with `capacity_provider_strategy`.
*
*/
@Import(name="launchType")
private @Nullable Output launchType;
/**
* @return Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`. Conflicts with `capacity_provider_strategy`.
*
*/
public Optional> launchType() {
return Optional.ofNullable(this.launchType);
}
/**
* Configuration block for load balancers. See below.
*
*/
@Import(name="loadBalancers")
private @Nullable Output> loadBalancers;
/**
* @return Configuration block for load balancers. See below.
*
*/
public Optional>> loadBalancers() {
return Optional.ofNullable(this.loadBalancers);
}
/**
* Name of the service (up to 255 letters, numbers, hyphens, and underscores)
*
* The following arguments are optional:
*
*/
@Import(name="name")
private @Nullable Output name;
/**
* @return Name of the service (up to 255 letters, numbers, hyphens, and underscores)
*
* The following arguments are optional:
*
*/
public Optional> name() {
return Optional.ofNullable(this.name);
}
/**
* 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. See below.
*
*/
@Import(name="networkConfiguration")
private @Nullable Output networkConfiguration;
/**
* @return 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. See below.
*
*/
public Optional> networkConfiguration() {
return Optional.ofNullable(this.networkConfiguration);
}
/**
* Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. The maximum number of `ordered_placement_strategy` blocks is `5`. See below.
*
*/
@Import(name="orderedPlacementStrategies")
private @Nullable Output> orderedPlacementStrategies;
/**
* @return Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. The maximum number of `ordered_placement_strategy` blocks is `5`. See below.
*
*/
public Optional>> orderedPlacementStrategies() {
return Optional.ofNullable(this.orderedPlacementStrategies);
}
/**
* Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. Maximum number of `placement_constraints` is `10`. See below.
*
*/
@Import(name="placementConstraints")
private @Nullable Output> placementConstraints;
/**
* @return Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. Maximum number of `placement_constraints` is `10`. See below.
*
*/
public Optional>> placementConstraints() {
return Optional.ofNullable(this.placementConstraints);
}
/**
* 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).
*
*/
@Import(name="platformVersion")
private @Nullable Output platformVersion;
/**
* @return 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 Optional> platformVersion() {
return Optional.ofNullable(this.platformVersion);
}
/**
* Whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`.
*
*/
@Import(name="propagateTags")
private @Nullable Output propagateTags;
/**
* @return Whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`.
*
*/
public Optional> propagateTags() {
return Optional.ofNullable(this.propagateTags);
}
/**
* Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html).
*
*/
@Import(name="schedulingStrategy")
private @Nullable Output schedulingStrategy;
/**
* @return Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html).
*
*/
public Optional> schedulingStrategy() {
return Optional.ofNullable(this.schedulingStrategy);
}
/**
* ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. See below.
*
*/
@Import(name="serviceConnectConfiguration")
private @Nullable Output serviceConnectConfiguration;
/**
* @return ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. See below.
*
*/
public Optional> serviceConnectConfiguration() {
return Optional.ofNullable(this.serviceConnectConfiguration);
}
/**
* Service discovery registries for the service. The maximum number of `service_registries` blocks is `1`. See below.
*
*/
@Import(name="serviceRegistries")
private @Nullable Output serviceRegistries;
/**
* @return Service discovery registries for the service. The maximum number of `service_registries` blocks is `1`. See below.
*
*/
public Optional> serviceRegistries() {
return Optional.ofNullable(this.serviceRegistries);
}
/**
* Key-value map of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*
*/
@Import(name="tags")
private @Nullable Output> tags;
/**
* @return Key-value map of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*
*/
public Optional>> tags() {
return Optional.ofNullable(this.tags);
}
/**
* Family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used.
*
*/
@Import(name="taskDefinition")
private @Nullable Output taskDefinition;
/**
* @return Family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used.
*
*/
public Optional> taskDefinition() {
return Optional.ofNullable(this.taskDefinition);
}
/**
* Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `"plantimestamp()"`. When using the triggers property you also need to set the forceNewDeployment property to True.
*
*/
@Import(name="triggers")
private @Nullable Output> triggers;
/**
* @return Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `"plantimestamp()"`. When using the triggers property you also need to set the forceNewDeployment property to True.
*
*/
public Optional>> triggers() {
return Optional.ofNullable(this.triggers);
}
/**
* Configuration for a volume specified in the task definition as a volume that is configured at launch time. Currently, the only supported volume type is an Amazon EBS volume. See below.
*
*/
@Import(name="volumeConfiguration")
private @Nullable Output volumeConfiguration;
/**
* @return Configuration for a volume specified in the task definition as a volume that is configured at launch time. Currently, the only supported volume type is an Amazon EBS volume. See below.
*
*/
public Optional> volumeConfiguration() {
return Optional.ofNullable(this.volumeConfiguration);
}
/**
* If `true`, this provider will wait for the service to reach a steady state (like [`aws ecs wait services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html)) before continuing. Default `false`.
*
*/
@Import(name="waitForSteadyState")
private @Nullable Output waitForSteadyState;
/**
* @return If `true`, this provider will wait for the service to reach a steady state (like [`aws ecs wait services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html)) before continuing. Default `false`.
*
*/
public Optional> waitForSteadyState() {
return Optional.ofNullable(this.waitForSteadyState);
}
private ServiceArgs() {}
private ServiceArgs(ServiceArgs $) {
this.alarms = $.alarms;
this.capacityProviderStrategies = $.capacityProviderStrategies;
this.cluster = $.cluster;
this.deploymentCircuitBreaker = $.deploymentCircuitBreaker;
this.deploymentController = $.deploymentController;
this.deploymentMaximumPercent = $.deploymentMaximumPercent;
this.deploymentMinimumHealthyPercent = $.deploymentMinimumHealthyPercent;
this.desiredCount = $.desiredCount;
this.enableEcsManagedTags = $.enableEcsManagedTags;
this.enableExecuteCommand = $.enableExecuteCommand;
this.forceDelete = $.forceDelete;
this.forceNewDeployment = $.forceNewDeployment;
this.healthCheckGracePeriodSeconds = $.healthCheckGracePeriodSeconds;
this.iamRole = $.iamRole;
this.launchType = $.launchType;
this.loadBalancers = $.loadBalancers;
this.name = $.name;
this.networkConfiguration = $.networkConfiguration;
this.orderedPlacementStrategies = $.orderedPlacementStrategies;
this.placementConstraints = $.placementConstraints;
this.platformVersion = $.platformVersion;
this.propagateTags = $.propagateTags;
this.schedulingStrategy = $.schedulingStrategy;
this.serviceConnectConfiguration = $.serviceConnectConfiguration;
this.serviceRegistries = $.serviceRegistries;
this.tags = $.tags;
this.taskDefinition = $.taskDefinition;
this.triggers = $.triggers;
this.volumeConfiguration = $.volumeConfiguration;
this.waitForSteadyState = $.waitForSteadyState;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(ServiceArgs defaults) {
return new Builder(defaults);
}
public static final class Builder {
private ServiceArgs $;
public Builder() {
$ = new ServiceArgs();
}
public Builder(ServiceArgs defaults) {
$ = new ServiceArgs(Objects.requireNonNull(defaults));
}
/**
* @param alarms Information about the CloudWatch alarms. See below.
*
* @return builder
*
*/
public Builder alarms(@Nullable Output alarms) {
$.alarms = alarms;
return this;
}
/**
* @param alarms Information about the CloudWatch alarms. See below.
*
* @return builder
*
*/
public Builder alarms(ServiceAlarmsArgs alarms) {
return alarms(Output.of(alarms));
}
/**
* @param capacityProviderStrategies Capacity provider strategies to use for the service. Can be one or more. These can be updated without destroying and recreating the service only if `force_new_deployment = true` and not changing from 0 `capacity_provider_strategy` blocks to greater than 0, or vice versa. See below. Conflicts with `launch_type`.
*
* @return builder
*
*/
public Builder capacityProviderStrategies(@Nullable Output> capacityProviderStrategies) {
$.capacityProviderStrategies = capacityProviderStrategies;
return this;
}
/**
* @param capacityProviderStrategies Capacity provider strategies to use for the service. Can be one or more. These can be updated without destroying and recreating the service only if `force_new_deployment = true` and not changing from 0 `capacity_provider_strategy` blocks to greater than 0, or vice versa. See below. Conflicts with `launch_type`.
*
* @return builder
*
*/
public Builder capacityProviderStrategies(List capacityProviderStrategies) {
return capacityProviderStrategies(Output.of(capacityProviderStrategies));
}
/**
* @param capacityProviderStrategies Capacity provider strategies to use for the service. Can be one or more. These can be updated without destroying and recreating the service only if `force_new_deployment = true` and not changing from 0 `capacity_provider_strategy` blocks to greater than 0, or vice versa. See below. Conflicts with `launch_type`.
*
* @return builder
*
*/
public Builder capacityProviderStrategies(ServiceCapacityProviderStrategyArgs... capacityProviderStrategies) {
return capacityProviderStrategies(List.of(capacityProviderStrategies));
}
/**
* @param cluster ARN of an ECS cluster.
*
* @return builder
*
*/
public Builder cluster(@Nullable Output cluster) {
$.cluster = cluster;
return this;
}
/**
* @param cluster ARN of an ECS cluster.
*
* @return builder
*
*/
public Builder cluster(String cluster) {
return cluster(Output.of(cluster));
}
/**
* @param deploymentCircuitBreaker Configuration block for deployment circuit breaker. See below.
*
* @return builder
*
*/
public Builder deploymentCircuitBreaker(@Nullable Output deploymentCircuitBreaker) {
$.deploymentCircuitBreaker = deploymentCircuitBreaker;
return this;
}
/**
* @param deploymentCircuitBreaker Configuration block for deployment circuit breaker. See below.
*
* @return builder
*
*/
public Builder deploymentCircuitBreaker(ServiceDeploymentCircuitBreakerArgs deploymentCircuitBreaker) {
return deploymentCircuitBreaker(Output.of(deploymentCircuitBreaker));
}
/**
* @param deploymentController Configuration block for deployment controller configuration. See below.
*
* @return builder
*
*/
public Builder deploymentController(@Nullable Output deploymentController) {
$.deploymentController = deploymentController;
return this;
}
/**
* @param deploymentController Configuration block for deployment controller configuration. See below.
*
* @return builder
*
*/
public Builder deploymentController(ServiceDeploymentControllerArgs deploymentController) {
return deploymentController(Output.of(deploymentController));
}
/**
* @param deploymentMaximumPercent 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.
*
* @return builder
*
*/
public Builder deploymentMaximumPercent(@Nullable Output deploymentMaximumPercent) {
$.deploymentMaximumPercent = deploymentMaximumPercent;
return this;
}
/**
* @param deploymentMaximumPercent 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.
*
* @return builder
*
*/
public Builder deploymentMaximumPercent(Integer deploymentMaximumPercent) {
return deploymentMaximumPercent(Output.of(deploymentMaximumPercent));
}
/**
* @param deploymentMinimumHealthyPercent 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.
*
* @return builder
*
*/
public Builder deploymentMinimumHealthyPercent(@Nullable Output deploymentMinimumHealthyPercent) {
$.deploymentMinimumHealthyPercent = deploymentMinimumHealthyPercent;
return this;
}
/**
* @param deploymentMinimumHealthyPercent 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.
*
* @return builder
*
*/
public Builder deploymentMinimumHealthyPercent(Integer deploymentMinimumHealthyPercent) {
return deploymentMinimumHealthyPercent(Output.of(deploymentMinimumHealthyPercent));
}
/**
* @param desiredCount Number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy.
*
* @return builder
*
*/
public Builder desiredCount(@Nullable Output desiredCount) {
$.desiredCount = desiredCount;
return this;
}
/**
* @param desiredCount Number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy.
*
* @return builder
*
*/
public Builder desiredCount(Integer desiredCount) {
return desiredCount(Output.of(desiredCount));
}
/**
* @param enableEcsManagedTags Whether to enable Amazon ECS managed tags for the tasks within the service.
*
* @return builder
*
*/
public Builder enableEcsManagedTags(@Nullable Output enableEcsManagedTags) {
$.enableEcsManagedTags = enableEcsManagedTags;
return this;
}
/**
* @param enableEcsManagedTags Whether to enable Amazon ECS managed tags for the tasks within the service.
*
* @return builder
*
*/
public Builder enableEcsManagedTags(Boolean enableEcsManagedTags) {
return enableEcsManagedTags(Output.of(enableEcsManagedTags));
}
/**
* @param enableExecuteCommand Whether to enable Amazon ECS Exec for the tasks within the service.
*
* @return builder
*
*/
public Builder enableExecuteCommand(@Nullable Output enableExecuteCommand) {
$.enableExecuteCommand = enableExecuteCommand;
return this;
}
/**
* @param enableExecuteCommand Whether to enable Amazon ECS Exec for the tasks within the service.
*
* @return builder
*
*/
public Builder enableExecuteCommand(Boolean enableExecuteCommand) {
return enableExecuteCommand(Output.of(enableExecuteCommand));
}
/**
* @param forceDelete Enable to delete a service even if it wasn't scaled down to zero tasks. It's only necessary to use this if the service uses the `REPLICA` scheduling strategy.
*
* @return builder
*
*/
public Builder forceDelete(@Nullable Output forceDelete) {
$.forceDelete = forceDelete;
return this;
}
/**
* @param forceDelete Enable to delete a service even if it wasn't scaled down to zero tasks. It's only necessary to use this if the service uses the `REPLICA` scheduling strategy.
*
* @return builder
*
*/
public Builder forceDelete(Boolean forceDelete) {
return forceDelete(Output.of(forceDelete));
}
/**
* @param forceNewDeployment Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates.
* When using the forceNewDeployment property you also need to configure the triggers property.
*
* @return builder
*
*/
public Builder forceNewDeployment(@Nullable Output forceNewDeployment) {
$.forceNewDeployment = forceNewDeployment;
return this;
}
/**
* @param forceNewDeployment Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g., `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates.
* When using the forceNewDeployment property you also need to configure the triggers property.
*
* @return builder
*
*/
public Builder forceNewDeployment(Boolean forceNewDeployment) {
return forceNewDeployment(Output.of(forceNewDeployment));
}
/**
* @param healthCheckGracePeriodSeconds 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.
*
* @return builder
*
*/
public Builder healthCheckGracePeriodSeconds(@Nullable Output healthCheckGracePeriodSeconds) {
$.healthCheckGracePeriodSeconds = healthCheckGracePeriodSeconds;
return this;
}
/**
* @param healthCheckGracePeriodSeconds 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.
*
* @return builder
*
*/
public Builder healthCheckGracePeriodSeconds(Integer healthCheckGracePeriodSeconds) {
return healthCheckGracePeriodSeconds(Output.of(healthCheckGracePeriodSeconds));
}
/**
* @param iamRole 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.
*
* @return builder
*
*/
public Builder iamRole(@Nullable Output iamRole) {
$.iamRole = iamRole;
return this;
}
/**
* @param iamRole 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.
*
* @return builder
*
*/
public Builder iamRole(String iamRole) {
return iamRole(Output.of(iamRole));
}
/**
* @param launchType Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`. Conflicts with `capacity_provider_strategy`.
*
* @return builder
*
*/
public Builder launchType(@Nullable Output launchType) {
$.launchType = launchType;
return this;
}
/**
* @param launchType Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`. Conflicts with `capacity_provider_strategy`.
*
* @return builder
*
*/
public Builder launchType(String launchType) {
return launchType(Output.of(launchType));
}
/**
* @param loadBalancers Configuration block for load balancers. See below.
*
* @return builder
*
*/
public Builder loadBalancers(@Nullable Output> loadBalancers) {
$.loadBalancers = loadBalancers;
return this;
}
/**
* @param loadBalancers Configuration block for load balancers. See below.
*
* @return builder
*
*/
public Builder loadBalancers(List loadBalancers) {
return loadBalancers(Output.of(loadBalancers));
}
/**
* @param loadBalancers Configuration block for load balancers. See below.
*
* @return builder
*
*/
public Builder loadBalancers(ServiceLoadBalancerArgs... loadBalancers) {
return loadBalancers(List.of(loadBalancers));
}
/**
* @param name Name of the service (up to 255 letters, numbers, hyphens, and underscores)
*
* The following arguments are optional:
*
* @return builder
*
*/
public Builder name(@Nullable Output name) {
$.name = name;
return this;
}
/**
* @param name Name of the service (up to 255 letters, numbers, hyphens, and underscores)
*
* The following arguments are optional:
*
* @return builder
*
*/
public Builder name(String name) {
return name(Output.of(name));
}
/**
* @param networkConfiguration 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. See below.
*
* @return builder
*
*/
public Builder networkConfiguration(@Nullable Output networkConfiguration) {
$.networkConfiguration = networkConfiguration;
return this;
}
/**
* @param networkConfiguration 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. See below.
*
* @return builder
*
*/
public Builder networkConfiguration(ServiceNetworkConfigurationArgs networkConfiguration) {
return networkConfiguration(Output.of(networkConfiguration));
}
/**
* @param orderedPlacementStrategies Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. The maximum number of `ordered_placement_strategy` blocks is `5`. See below.
*
* @return builder
*
*/
public Builder orderedPlacementStrategies(@Nullable Output> orderedPlacementStrategies) {
$.orderedPlacementStrategies = orderedPlacementStrategies;
return this;
}
/**
* @param orderedPlacementStrategies Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. The maximum number of `ordered_placement_strategy` blocks is `5`. See below.
*
* @return builder
*
*/
public Builder orderedPlacementStrategies(List orderedPlacementStrategies) {
return orderedPlacementStrategies(Output.of(orderedPlacementStrategies));
}
/**
* @param orderedPlacementStrategies Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. The maximum number of `ordered_placement_strategy` blocks is `5`. See below.
*
* @return builder
*
*/
public Builder orderedPlacementStrategies(ServiceOrderedPlacementStrategyArgs... orderedPlacementStrategies) {
return orderedPlacementStrategies(List.of(orderedPlacementStrategies));
}
/**
* @param placementConstraints Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. Maximum number of `placement_constraints` is `10`. See below.
*
* @return builder
*
*/
public Builder placementConstraints(@Nullable Output> placementConstraints) {
$.placementConstraints = placementConstraints;
return this;
}
/**
* @param placementConstraints Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. Maximum number of `placement_constraints` is `10`. See below.
*
* @return builder
*
*/
public Builder placementConstraints(List placementConstraints) {
return placementConstraints(Output.of(placementConstraints));
}
/**
* @param placementConstraints Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. Maximum number of `placement_constraints` is `10`. See below.
*
* @return builder
*
*/
public Builder placementConstraints(ServicePlacementConstraintArgs... placementConstraints) {
return placementConstraints(List.of(placementConstraints));
}
/**
* @param platformVersion 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).
*
* @return builder
*
*/
public Builder platformVersion(@Nullable Output platformVersion) {
$.platformVersion = platformVersion;
return this;
}
/**
* @param platformVersion 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).
*
* @return builder
*
*/
public Builder platformVersion(String platformVersion) {
return platformVersion(Output.of(platformVersion));
}
/**
* @param propagateTags Whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`.
*
* @return builder
*
*/
public Builder propagateTags(@Nullable Output propagateTags) {
$.propagateTags = propagateTags;
return this;
}
/**
* @param propagateTags Whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`.
*
* @return builder
*
*/
public Builder propagateTags(String propagateTags) {
return propagateTags(Output.of(propagateTags));
}
/**
* @param schedulingStrategy Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html).
*
* @return builder
*
*/
public Builder schedulingStrategy(@Nullable Output schedulingStrategy) {
$.schedulingStrategy = schedulingStrategy;
return this;
}
/**
* @param schedulingStrategy Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html).
*
* @return builder
*
*/
public Builder schedulingStrategy(String schedulingStrategy) {
return schedulingStrategy(Output.of(schedulingStrategy));
}
/**
* @param serviceConnectConfiguration ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. See below.
*
* @return builder
*
*/
public Builder serviceConnectConfiguration(@Nullable Output serviceConnectConfiguration) {
$.serviceConnectConfiguration = serviceConnectConfiguration;
return this;
}
/**
* @param serviceConnectConfiguration ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace. See below.
*
* @return builder
*
*/
public Builder serviceConnectConfiguration(ServiceServiceConnectConfigurationArgs serviceConnectConfiguration) {
return serviceConnectConfiguration(Output.of(serviceConnectConfiguration));
}
/**
* @param serviceRegistries Service discovery registries for the service. The maximum number of `service_registries` blocks is `1`. See below.
*
* @return builder
*
*/
public Builder serviceRegistries(@Nullable Output serviceRegistries) {
$.serviceRegistries = serviceRegistries;
return this;
}
/**
* @param serviceRegistries Service discovery registries for the service. The maximum number of `service_registries` blocks is `1`. See below.
*
* @return builder
*
*/
public Builder serviceRegistries(ServiceServiceRegistriesArgs serviceRegistries) {
return serviceRegistries(Output.of(serviceRegistries));
}
/**
* @param tags Key-value map of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*
* @return builder
*
*/
public Builder tags(@Nullable Output> tags) {
$.tags = tags;
return this;
}
/**
* @param tags Key-value map of resource tags. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*
* @return builder
*
*/
public Builder tags(Map tags) {
return tags(Output.of(tags));
}
/**
* @param taskDefinition Family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used.
*
* @return builder
*
*/
public Builder taskDefinition(@Nullable Output taskDefinition) {
$.taskDefinition = taskDefinition;
return this;
}
/**
* @param taskDefinition Family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used.
*
* @return builder
*
*/
public Builder taskDefinition(String taskDefinition) {
return taskDefinition(Output.of(taskDefinition));
}
/**
* @param triggers Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `"plantimestamp()"`. When using the triggers property you also need to set the forceNewDeployment property to True.
*
* @return builder
*
*/
public Builder triggers(@Nullable Output> triggers) {
$.triggers = triggers;
return this;
}
/**
* @param triggers Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `"plantimestamp()"`. When using the triggers property you also need to set the forceNewDeployment property to True.
*
* @return builder
*
*/
public Builder triggers(Map triggers) {
return triggers(Output.of(triggers));
}
/**
* @param volumeConfiguration Configuration for a volume specified in the task definition as a volume that is configured at launch time. Currently, the only supported volume type is an Amazon EBS volume. See below.
*
* @return builder
*
*/
public Builder volumeConfiguration(@Nullable Output volumeConfiguration) {
$.volumeConfiguration = volumeConfiguration;
return this;
}
/**
* @param volumeConfiguration Configuration for a volume specified in the task definition as a volume that is configured at launch time. Currently, the only supported volume type is an Amazon EBS volume. See below.
*
* @return builder
*
*/
public Builder volumeConfiguration(ServiceVolumeConfigurationArgs volumeConfiguration) {
return volumeConfiguration(Output.of(volumeConfiguration));
}
/**
* @param waitForSteadyState If `true`, this provider will wait for the service to reach a steady state (like [`aws ecs wait services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html)) before continuing. Default `false`.
*
* @return builder
*
*/
public Builder waitForSteadyState(@Nullable Output waitForSteadyState) {
$.waitForSteadyState = waitForSteadyState;
return this;
}
/**
* @param waitForSteadyState If `true`, this provider will wait for the service to reach a steady state (like [`aws ecs wait services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html)) before continuing. Default `false`.
*
* @return builder
*
*/
public Builder waitForSteadyState(Boolean waitForSteadyState) {
return waitForSteadyState(Output.of(waitForSteadyState));
}
public ServiceArgs build() {
return $;
}
}
}