paws.compute (version 0.1.0)

ec2_modify_spot_fleet_request: Modifies the specified Spot Fleet request

Description

Modifies the specified Spot Fleet request.

Usage

ec2_modify_spot_fleet_request(ExcessCapacityTerminationPolicy,
  SpotFleetRequestId, TargetCapacity)

Arguments

ExcessCapacityTerminationPolicy

Indicates whether running Spot Instances should be terminated if the target capacity of the Spot Fleet request is decreased below the current size of the Spot Fleet.

SpotFleetRequestId

[required] The ID of the Spot Fleet request.

TargetCapacity

The size of the fleet.

Request syntax

svc$modify_spot_fleet_request(
  ExcessCapacityTerminationPolicy = "noTermination"|"default",
  SpotFleetRequestId = "string",
  TargetCapacity = 123
)

Details

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

To scale up your Spot Fleet, increase its target capacity. The Spot Fleet launches the additional Spot Instances according to the allocation strategy for the Spot Fleet request. If the allocation strategy is lowestPrice, the Spot Fleet launches instances using the Spot pool with the lowest price. If the allocation strategy is diversified, the Spot Fleet distributes the instances across the Spot pools.

To scale down your Spot Fleet, decrease its target capacity. First, the Spot Fleet cancels any open requests that exceed the new target capacity. You can request that the Spot Fleet terminate Spot Instances until the size of the fleet no longer exceeds the new target capacity. If the allocation strategy is lowestPrice, the Spot Fleet terminates the instances with the highest price per unit. If the allocation strategy is diversified, the Spot Fleet terminates instances across the Spot pools. Alternatively, you can request that the Spot 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 Spot Fleet for now, but will use it again later, you can set the target capacity to 0.

Examples

Run this code
# NOT RUN {
# This example increases the target capacity of the specified Spot fleet
# request.
# }
# NOT RUN {
svc$modify_spot_fleet_request(
  SpotFleetRequestId = "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
  TargetCapacity = 20L
)
# }
# NOT RUN {
# This example decreases the target capacity of the specified Spot fleet
# request without terminating any Spot Instances as a result.
# }
# NOT RUN {
svc$modify_spot_fleet_request(
  ExcessCapacityTerminationPolicy = "NoTermination ",
  SpotFleetRequestId = "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
  TargetCapacity = 10L
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace