[ aws . ec2 ]

modify-fleet

Description

Modifies the specified EC2 Fleet.

You can only modify an EC2 Fleet request of type maintain .

While the EC2 Fleet is being modified, it is in the modifying state.

To scale up your EC2 Fleet, increase its target capacity. The EC2 Fleet launches the additional Spot Instances according to the allocation strategy for the EC2 Fleet request. If the allocation strategy is lowest-price , the EC2 Fleet launches instances using the Spot Instance pool with the lowest price. If the allocation strategy is diversified , the EC2 Fleet distributes the instances across the Spot Instance pools. If the allocation strategy is capacity-optimized , EC2 Fleet launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.

To scale down your EC2 Fleet, decrease its target capacity. First, the EC2 Fleet cancels any open requests that exceed the new target capacity. You can request that the EC2 Fleet terminate Spot Instances until the size of the fleet no longer exceeds the new target capacity. If the allocation strategy is lowest-price , the EC2 Fleet terminates the instances with the highest price per unit. If the allocation strategy is capacity-optimized , the EC2 Fleet terminates the instances in the Spot Instance pools that have the least available Spot Instance capacity. If the allocation strategy is diversified , the EC2 Fleet terminates instances across the Spot Instance pools. Alternatively, you can request that the EC2 Fleet keep the fleet at its current size, but not replace any Spot Instances that are interrupted or that you terminate manually.

If you are finished with your EC2 Fleet for now, but will use it again later, you can set the target capacity to 0.

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.

Synopsis

  modify-fleet
[--dry-run | --no-dry-run]
[--excess-capacity-termination-policy <value>]
--fleet-id <value>
--target-capacity-specification <value>
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--cli-auto-prompt <value>]

Options

--dry-run | --no-dry-run (boolean)

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

--excess-capacity-termination-policy (string)

Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.

Possible values:

  • no-termination

  • termination

--fleet-id (string)

The ID of the EC2 Fleet.

--target-capacity-specification (structure)

The size of the EC2 Fleet.

TotalTargetCapacity -> (integer)

The number of units to request, filled using DefaultTargetCapacityType .

OnDemandTargetCapacity -> (integer)

The number of On-Demand units to request.

SpotTargetCapacity -> (integer)

The number of Spot units to request.

DefaultTargetCapacityType -> (string)

The default TotalTargetCapacity , which is either Spot or On-Demand .

Shorthand Syntax:

TotalTargetCapacity=integer,OnDemandTargetCapacity=integer,SpotTargetCapacity=integer,DefaultTargetCapacityType=string

JSON Syntax:

{
  "TotalTargetCapacity": integer,
  "OnDemandTargetCapacity": integer,
  "SpotTargetCapacity": integer,
  "DefaultTargetCapacityType": "spot"|"on-demand"
}

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

--cli-auto-prompt (boolean) Automatically prompt for CLI input parameters.

See ‘aws help’ for descriptions of global parameters.

Output

Return -> (boolean)

Is true if the request succeeds, and an error otherwise.