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.ec2.FleetArgs Maven / Gradle / Ivy
Go to download
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
// *** 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.ec2;
import com.pulumi.aws.ec2.inputs.FleetFleetInstanceSetArgs;
import com.pulumi.aws.ec2.inputs.FleetLaunchTemplateConfigArgs;
import com.pulumi.aws.ec2.inputs.FleetOnDemandOptionsArgs;
import com.pulumi.aws.ec2.inputs.FleetSpotOptionsArgs;
import com.pulumi.aws.ec2.inputs.FleetTargetCapacitySpecificationArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Double;
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 FleetArgs extends com.pulumi.resources.ResourceArgs {
public static final FleetArgs Empty = new FleetArgs();
/**
* Reserved.
*
*/
@Import(name="context")
private @Nullable Output context;
/**
* @return Reserved.
*
*/
public Optional> context() {
return Optional.ofNullable(this.context);
}
/**
* Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. Supported only for fleets of type `maintain`.
*
*/
@Import(name="excessCapacityTerminationPolicy")
private @Nullable Output excessCapacityTerminationPolicy;
/**
* @return Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. Supported only for fleets of type `maintain`.
*
*/
public Optional> excessCapacityTerminationPolicy() {
return Optional.ofNullable(this.excessCapacityTerminationPolicy);
}
/**
* Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
*
*/
@Import(name="fleetInstanceSets")
private @Nullable Output> fleetInstanceSets;
/**
* @return Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
*
*/
public Optional>> fleetInstanceSets() {
return Optional.ofNullable(this.fleetInstanceSets);
}
/**
* The state of the EC2 Fleet.
*
*/
@Import(name="fleetState")
private @Nullable Output fleetState;
/**
* @return The state of the EC2 Fleet.
*
*/
public Optional> fleetState() {
return Optional.ofNullable(this.fleetState);
}
/**
* The number of units fulfilled by this request compared to the set target capacity.
*
*/
@Import(name="fulfilledCapacity")
private @Nullable Output fulfilledCapacity;
/**
* @return The number of units fulfilled by this request compared to the set target capacity.
*
*/
public Optional> fulfilledCapacity() {
return Optional.ofNullable(this.fulfilledCapacity);
}
/**
* The number of units fulfilled by this request compared to the set target On-Demand capacity.
*
*/
@Import(name="fulfilledOnDemandCapacity")
private @Nullable Output fulfilledOnDemandCapacity;
/**
* @return The number of units fulfilled by this request compared to the set target On-Demand capacity.
*
*/
public Optional> fulfilledOnDemandCapacity() {
return Optional.ofNullable(this.fulfilledOnDemandCapacity);
}
/**
* Nested argument containing EC2 Launch Template configurations. Defined below.
*
*/
@Import(name="launchTemplateConfigs", required=true)
private Output> launchTemplateConfigs;
/**
* @return Nested argument containing EC2 Launch Template configurations. Defined below.
*
*/
public Output> launchTemplateConfigs() {
return this.launchTemplateConfigs;
}
/**
* Nested argument containing On-Demand configurations. Defined below.
*
*/
@Import(name="onDemandOptions")
private @Nullable Output onDemandOptions;
/**
* @return Nested argument containing On-Demand configurations. Defined below.
*
*/
public Optional> onDemandOptions() {
return Optional.ofNullable(this.onDemandOptions);
}
/**
* Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. Supported only for fleets of type `maintain`.
*
*/
@Import(name="replaceUnhealthyInstances")
private @Nullable Output replaceUnhealthyInstances;
/**
* @return Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. Supported only for fleets of type `maintain`.
*
*/
public Optional> replaceUnhealthyInstances() {
return Optional.ofNullable(this.replaceUnhealthyInstances);
}
/**
* Nested argument containing Spot configurations. Defined below.
*
*/
@Import(name="spotOptions")
private @Nullable Output spotOptions;
/**
* @return Nested argument containing Spot configurations. Defined below.
*
*/
public Optional> spotOptions() {
return Optional.ofNullable(this.spotOptions);
}
/**
* Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. 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 Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. 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);
}
/**
* Nested argument containing target capacity configurations. Defined below.
*
*/
@Import(name="targetCapacitySpecification", required=true)
private Output targetCapacitySpecification;
/**
* @return Nested argument containing target capacity configurations. Defined below.
*
*/
public Output targetCapacitySpecification() {
return this.targetCapacitySpecification;
}
/**
* Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`.
*
*/
@Import(name="terminateInstances")
private @Nullable Output terminateInstances;
/**
* @return Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`.
*
*/
public Optional> terminateInstances() {
return Optional.ofNullable(this.terminateInstances);
}
/**
* Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`.
*
*/
@Import(name="terminateInstancesWithExpiration")
private @Nullable Output terminateInstancesWithExpiration;
/**
* @return Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`.
*
*/
public Optional> terminateInstancesWithExpiration() {
return Optional.ofNullable(this.terminateInstancesWithExpiration);
}
/**
* The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`, `instant`. Defaults to `maintain`.
*
*/
@Import(name="type")
private @Nullable Output type;
/**
* @return The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`, `instant`. Defaults to `maintain`.
*
*/
public Optional> type() {
return Optional.ofNullable(this.type);
}
/**
* The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
*
*/
@Import(name="validFrom")
private @Nullable Output validFrom;
/**
* @return The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
*
*/
public Optional> validFrom() {
return Optional.ofNullable(this.validFrom);
}
/**
* The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.
*
*/
@Import(name="validUntil")
private @Nullable Output validUntil;
/**
* @return The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.
*
*/
public Optional> validUntil() {
return Optional.ofNullable(this.validUntil);
}
private FleetArgs() {}
private FleetArgs(FleetArgs $) {
this.context = $.context;
this.excessCapacityTerminationPolicy = $.excessCapacityTerminationPolicy;
this.fleetInstanceSets = $.fleetInstanceSets;
this.fleetState = $.fleetState;
this.fulfilledCapacity = $.fulfilledCapacity;
this.fulfilledOnDemandCapacity = $.fulfilledOnDemandCapacity;
this.launchTemplateConfigs = $.launchTemplateConfigs;
this.onDemandOptions = $.onDemandOptions;
this.replaceUnhealthyInstances = $.replaceUnhealthyInstances;
this.spotOptions = $.spotOptions;
this.tags = $.tags;
this.targetCapacitySpecification = $.targetCapacitySpecification;
this.terminateInstances = $.terminateInstances;
this.terminateInstancesWithExpiration = $.terminateInstancesWithExpiration;
this.type = $.type;
this.validFrom = $.validFrom;
this.validUntil = $.validUntil;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(FleetArgs defaults) {
return new Builder(defaults);
}
public static final class Builder {
private FleetArgs $;
public Builder() {
$ = new FleetArgs();
}
public Builder(FleetArgs defaults) {
$ = new FleetArgs(Objects.requireNonNull(defaults));
}
/**
* @param context Reserved.
*
* @return builder
*
*/
public Builder context(@Nullable Output context) {
$.context = context;
return this;
}
/**
* @param context Reserved.
*
* @return builder
*
*/
public Builder context(String context) {
return context(Output.of(context));
}
/**
* @param excessCapacityTerminationPolicy Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. Supported only for fleets of type `maintain`.
*
* @return builder
*
*/
public Builder excessCapacityTerminationPolicy(@Nullable Output excessCapacityTerminationPolicy) {
$.excessCapacityTerminationPolicy = excessCapacityTerminationPolicy;
return this;
}
/**
* @param excessCapacityTerminationPolicy Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. Supported only for fleets of type `maintain`.
*
* @return builder
*
*/
public Builder excessCapacityTerminationPolicy(String excessCapacityTerminationPolicy) {
return excessCapacityTerminationPolicy(Output.of(excessCapacityTerminationPolicy));
}
/**
* @param fleetInstanceSets Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
*
* @return builder
*
*/
public Builder fleetInstanceSets(@Nullable Output> fleetInstanceSets) {
$.fleetInstanceSets = fleetInstanceSets;
return this;
}
/**
* @param fleetInstanceSets Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
*
* @return builder
*
*/
public Builder fleetInstanceSets(List fleetInstanceSets) {
return fleetInstanceSets(Output.of(fleetInstanceSets));
}
/**
* @param fleetInstanceSets Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
*
* @return builder
*
*/
public Builder fleetInstanceSets(FleetFleetInstanceSetArgs... fleetInstanceSets) {
return fleetInstanceSets(List.of(fleetInstanceSets));
}
/**
* @param fleetState The state of the EC2 Fleet.
*
* @return builder
*
*/
public Builder fleetState(@Nullable Output fleetState) {
$.fleetState = fleetState;
return this;
}
/**
* @param fleetState The state of the EC2 Fleet.
*
* @return builder
*
*/
public Builder fleetState(String fleetState) {
return fleetState(Output.of(fleetState));
}
/**
* @param fulfilledCapacity The number of units fulfilled by this request compared to the set target capacity.
*
* @return builder
*
*/
public Builder fulfilledCapacity(@Nullable Output fulfilledCapacity) {
$.fulfilledCapacity = fulfilledCapacity;
return this;
}
/**
* @param fulfilledCapacity The number of units fulfilled by this request compared to the set target capacity.
*
* @return builder
*
*/
public Builder fulfilledCapacity(Double fulfilledCapacity) {
return fulfilledCapacity(Output.of(fulfilledCapacity));
}
/**
* @param fulfilledOnDemandCapacity The number of units fulfilled by this request compared to the set target On-Demand capacity.
*
* @return builder
*
*/
public Builder fulfilledOnDemandCapacity(@Nullable Output fulfilledOnDemandCapacity) {
$.fulfilledOnDemandCapacity = fulfilledOnDemandCapacity;
return this;
}
/**
* @param fulfilledOnDemandCapacity The number of units fulfilled by this request compared to the set target On-Demand capacity.
*
* @return builder
*
*/
public Builder fulfilledOnDemandCapacity(Double fulfilledOnDemandCapacity) {
return fulfilledOnDemandCapacity(Output.of(fulfilledOnDemandCapacity));
}
/**
* @param launchTemplateConfigs Nested argument containing EC2 Launch Template configurations. Defined below.
*
* @return builder
*
*/
public Builder launchTemplateConfigs(Output> launchTemplateConfigs) {
$.launchTemplateConfigs = launchTemplateConfigs;
return this;
}
/**
* @param launchTemplateConfigs Nested argument containing EC2 Launch Template configurations. Defined below.
*
* @return builder
*
*/
public Builder launchTemplateConfigs(List launchTemplateConfigs) {
return launchTemplateConfigs(Output.of(launchTemplateConfigs));
}
/**
* @param launchTemplateConfigs Nested argument containing EC2 Launch Template configurations. Defined below.
*
* @return builder
*
*/
public Builder launchTemplateConfigs(FleetLaunchTemplateConfigArgs... launchTemplateConfigs) {
return launchTemplateConfigs(List.of(launchTemplateConfigs));
}
/**
* @param onDemandOptions Nested argument containing On-Demand configurations. Defined below.
*
* @return builder
*
*/
public Builder onDemandOptions(@Nullable Output onDemandOptions) {
$.onDemandOptions = onDemandOptions;
return this;
}
/**
* @param onDemandOptions Nested argument containing On-Demand configurations. Defined below.
*
* @return builder
*
*/
public Builder onDemandOptions(FleetOnDemandOptionsArgs onDemandOptions) {
return onDemandOptions(Output.of(onDemandOptions));
}
/**
* @param replaceUnhealthyInstances Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. Supported only for fleets of type `maintain`.
*
* @return builder
*
*/
public Builder replaceUnhealthyInstances(@Nullable Output replaceUnhealthyInstances) {
$.replaceUnhealthyInstances = replaceUnhealthyInstances;
return this;
}
/**
* @param replaceUnhealthyInstances Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. Supported only for fleets of type `maintain`.
*
* @return builder
*
*/
public Builder replaceUnhealthyInstances(Boolean replaceUnhealthyInstances) {
return replaceUnhealthyInstances(Output.of(replaceUnhealthyInstances));
}
/**
* @param spotOptions Nested argument containing Spot configurations. Defined below.
*
* @return builder
*
*/
public Builder spotOptions(@Nullable Output spotOptions) {
$.spotOptions = spotOptions;
return this;
}
/**
* @param spotOptions Nested argument containing Spot configurations. Defined below.
*
* @return builder
*
*/
public Builder spotOptions(FleetSpotOptionsArgs spotOptions) {
return spotOptions(Output.of(spotOptions));
}
/**
* @param tags Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. 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 Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. 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 targetCapacitySpecification Nested argument containing target capacity configurations. Defined below.
*
* @return builder
*
*/
public Builder targetCapacitySpecification(Output targetCapacitySpecification) {
$.targetCapacitySpecification = targetCapacitySpecification;
return this;
}
/**
* @param targetCapacitySpecification Nested argument containing target capacity configurations. Defined below.
*
* @return builder
*
*/
public Builder targetCapacitySpecification(FleetTargetCapacitySpecificationArgs targetCapacitySpecification) {
return targetCapacitySpecification(Output.of(targetCapacitySpecification));
}
/**
* @param terminateInstances Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`.
*
* @return builder
*
*/
public Builder terminateInstances(@Nullable Output terminateInstances) {
$.terminateInstances = terminateInstances;
return this;
}
/**
* @param terminateInstances Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`.
*
* @return builder
*
*/
public Builder terminateInstances(Boolean terminateInstances) {
return terminateInstances(Output.of(terminateInstances));
}
/**
* @param terminateInstancesWithExpiration Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`.
*
* @return builder
*
*/
public Builder terminateInstancesWithExpiration(@Nullable Output terminateInstancesWithExpiration) {
$.terminateInstancesWithExpiration = terminateInstancesWithExpiration;
return this;
}
/**
* @param terminateInstancesWithExpiration Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`.
*
* @return builder
*
*/
public Builder terminateInstancesWithExpiration(Boolean terminateInstancesWithExpiration) {
return terminateInstancesWithExpiration(Output.of(terminateInstancesWithExpiration));
}
/**
* @param type The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`, `instant`. Defaults to `maintain`.
*
* @return builder
*
*/
public Builder type(@Nullable Output type) {
$.type = type;
return this;
}
/**
* @param type The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`, `instant`. Defaults to `maintain`.
*
* @return builder
*
*/
public Builder type(String type) {
return type(Output.of(type));
}
/**
* @param validFrom The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
*
* @return builder
*
*/
public Builder validFrom(@Nullable Output validFrom) {
$.validFrom = validFrom;
return this;
}
/**
* @param validFrom The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
*
* @return builder
*
*/
public Builder validFrom(String validFrom) {
return validFrom(Output.of(validFrom));
}
/**
* @param validUntil The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.
*
* @return builder
*
*/
public Builder validUntil(@Nullable Output validUntil) {
$.validUntil = validUntil;
return this;
}
/**
* @param validUntil The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.
*
* @return builder
*
*/
public Builder validUntil(String validUntil) {
return validUntil(Output.of(validUntil));
}
public FleetArgs build() {
if ($.launchTemplateConfigs == null) {
throw new MissingRequiredPropertyException("FleetArgs", "launchTemplateConfigs");
}
if ($.targetCapacitySpecification == null) {
throw new MissingRequiredPropertyException("FleetArgs", "targetCapacitySpecification");
}
return $;
}
}
}