Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . ec2 ]

describe-spot-fleet-requests

Description

Describes your Spot Fleet requests.

Spot Fleet requests are deleted 48 hours after they are canceled and their instances are terminated.

See also: AWS API Documentation

describe-spot-fleet-requests is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can disable pagination by providing the --no-paginate argument. When using --output text and the --query argument on a paginated response, the --query argument must extract data from the results of the following query expressions: SpotFleetRequestConfigs

Synopsis

  describe-spot-fleet-requests
[--dry-run | --no-dry-run]
[--spot-fleet-request-ids <value>]
[--cli-input-json <value>]
[--starting-token <value>]
[--page-size <value>]
[--max-items <value>]
[--generate-cli-skeleton <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 .

--spot-fleet-request-ids (list)

The IDs of the Spot Fleet requests.

Syntax:

"string" "string" ...

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values.

--starting-token (string)

A token to specify where to start paginating. This is the NextToken from a previously truncated response.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--page-size (integer)

The size of each page to get in the AWS service call. This does not affect the number of items returned in the command's output. Setting a smaller page size results in more calls to the AWS service, retrieving fewer items in each call. This can help prevent the AWS service calls from timing out.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--max-items (integer)

The total number of items to return in the command's output. If the total number of items available is more than the value specified, a NextToken is provided in the command's output. To resume pagination, provide the NextToken value in the starting-token argument of a subsequent command. Do not use the NextToken response element directly outside of the AWS CLI.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--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. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

Examples

To describe your Spot fleet requests

This example describes all of your Spot fleet requests.

Command:

aws ec2 describe-spot-fleet-requests

Output:

{
  "SpotFleetRequestConfigs": [
      {
          "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
          "SpotFleetRequestConfig": {
              "TargetCapacity": 20,
              "LaunchSpecifications": [
                  {
                      "EbsOptimized": false,
                      "NetworkInterfaces": [
                          {
                              "SubnetId": "subnet-a61dafcf",
                              "DeviceIndex": 0,
                              "DeleteOnTermination": false,
                              "AssociatePublicIpAddress": true,
                              "SecondaryPrivateIpAddressCount": 0
                          }
                      ],
                      "InstanceType": "cc2.8xlarge",
                      "ImageId": "ami-1a2b3c4d"
                  },
                  {
                      "EbsOptimized": false,
                      "NetworkInterfaces": [
                          {
                              "SubnetId": "subnet-a61dafcf",
                              "DeviceIndex": 0,
                              "DeleteOnTermination": false,
                              "AssociatePublicIpAddress": true,
                              "SecondaryPrivateIpAddressCount": 0
                          }
                      ],
                      "InstanceType": "r3.8xlarge",
                      "ImageId": "ami-1a2b3c4d"
                  }
              ],
              "SpotPrice": "0.05",
              "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role"
          },
          "SpotFleetRequestState": "active"
      },
      {
          "SpotFleetRequestId": "sfr-306341ed-9739-402e-881b-ce47bEXAMPLE",
          "SpotFleetRequestConfig": {
              "TargetCapacity": 20,
              "LaunchSpecifications": [
                  {
                      "EbsOptimized": false,
                      "NetworkInterfaces": [
                          {
                              "SubnetId": "subnet-6e7f829e",
                              "DeviceIndex": 0,
                              "DeleteOnTermination": false,
                              "AssociatePublicIpAddress": true,
                              "SecondaryPrivateIpAddressCount": 0
                          }
                      ],
                      "InstanceType": "m3.medium",
                      "ImageId": "ami-1a2b3c4d"
                  }
              ],
              "SpotPrice": "0.05",
              "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role"
          },
          "SpotFleetRequestState": "active"
      }
  ]
}

To describe a Spot fleet request

This example describes the specified Spot fleet request.

Command:

aws ec2 describe-spot-fleet-requests --spot-fleet-request-ids sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE

Output:

{
  "SpotFleetRequestConfigs": [
      {
          "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE",
          "SpotFleetRequestConfig": {
              "TargetCapacity": 20,
              "LaunchSpecifications": [
                  {
                      "EbsOptimized": false,
                      "NetworkInterfaces": [
                          {
                              "SubnetId": "subnet-a61dafcf",
                              "DeviceIndex": 0,
                              "DeleteOnTermination": false,
                              "AssociatePublicIpAddress": true,
                              "SecondaryPrivateIpAddressCount": 0
                          }
                      ],
                      "InstanceType": "cc2.8xlarge",
                      "ImageId": "ami-1a2b3c4d"
                  },
                  {
                      "EbsOptimized": false,
                      "NetworkInterfaces": [
                          {
                              "SubnetId": "subnet-a61dafcf",
                              "DeviceIndex": 0,
                              "DeleteOnTermination": false,
                              "AssociatePublicIpAddress": true,
                              "SecondaryPrivateIpAddressCount": 0
                          }
                      ],
                      "InstanceType": "r3.8xlarge",
                      "ImageId": "ami-1a2b3c4d"
                  }
              ],
              "SpotPrice": "0.05",
              "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role"
          },
          "SpotFleetRequestState": "active"
      }
  ]
}

Output

NextToken -> (string)

The token required to retrieve the next set of results. This value is null when there are no more results to return.

SpotFleetRequestConfigs -> (list)

Information about the configuration of your Spot Fleet.

(structure)

Describes a Spot Fleet request.

ActivityStatus -> (string)

The progress of the Spot Fleet request. If there is an error, the status is error . After all requests are placed, the status is pending_fulfillment . If the size of the fleet is equal to or greater than its target capacity, the status is fulfilled . If the size of the fleet is decreased, the status is pending_termination while Spot Instances are terminating.

CreateTime -> (timestamp)

The creation date and time of the request.

SpotFleetRequestConfig -> (structure)

The configuration of the Spot Fleet request.

AllocationStrategy -> (string)

Indicates how to allocate the target capacity across the Spot pools specified by the Spot Fleet request. The default is lowestPrice .

ClientToken -> (string)

A unique, case-sensitive identifier you provide to ensure idempotency of your listings. This helps avoid duplicate listings. For more information, see Ensuring Idempotency .

ExcessCapacityTerminationPolicy -> (string)

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.

FulfilledCapacity -> (double)

The number of units fulfilled by this request compared to the set target capacity.

IamFleetRole -> (string)

Grants the Spot Fleet permission to terminate Spot Instances on your behalf when you cancel its Spot Fleet request using cancel-spot-fleet-requests or when the Spot Fleet request expires, if you set terminateInstancesWithExpiration .

LaunchSpecifications -> (list)

The launch specifications for the Spot Fleet request.

(structure)

Describes the launch specification for one or more Spot Instances.

SecurityGroups -> (list)

One or more security groups. When requesting instances in a VPC, you must specify the IDs of the security groups. When requesting instances in EC2-Classic, you can specify the names or the IDs of the security groups.

(structure)

Describes a security group.

GroupName -> (string)

The name of the security group.

GroupId -> (string)

The ID of the security group.

AddressingType -> (string)

Deprecated.

BlockDeviceMappings -> (list)

One or more block device mapping entries. You can't specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.

(structure)

Describes a block device mapping.

DeviceName -> (string)

The device name (for example, /dev/sdh or xvdh ).

VirtualName -> (string)

The virtual device name (ephemeral N). Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 .The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.

Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.

Ebs -> (structure)

Parameters used to automatically set up EBS volumes when the instance is launched.

Encrypted -> (boolean)

Indicates whether the EBS volume is encrypted. Encrypted volumes can only be attached to instances that support Amazon EBS encryption. If you are creating a volume from a snapshot, you can't specify an encryption value. This is because only blank volumes can be encrypted on creation.

DeleteOnTermination -> (boolean)

Indicates whether the EBS volume is deleted on instance termination.

Iops -> (integer)

The number of I/O operations per second (IOPS) that the volume supports. For io1 , this represents the number of IOPS that are provisioned for the volume. For gp2 , this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting. For more information about General Purpose SSD baseline performance, I/O credits, and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud User Guide .

Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for gp2 volumes.

Condition: This parameter is required for requests to create io1 volumes; it is not used in requests to create gp2 , st1 , sc1 , or standard volumes.

KmsKeyId -> (string)

ID for a user-managed CMK under which the EBS volume is encrypted.

Note: This parameter is only supported on BlockDeviceMapping objects called by run-instances , request-spot-fleet , and request-spot-instances .

SnapshotId -> (string)

The ID of the snapshot.

VolumeSize -> (integer)

The size of the volume, in GiB.

Constraints: 1-16384 for General Purpose SSD (gp2 ), 4-16384 for Provisioned IOPS SSD (io1 ), 500-16384 for Throughput Optimized HDD (st1 ), 500-16384 for Cold HDD (sc1 ), and 1-1024 for Magnetic (standard ) volumes. If you specify a snapshot, the volume size must be equal to or larger than the snapshot size.

Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.

VolumeType -> (string)

The volume type: gp2 , io1 , st1 , sc1 , or standard .

Default: standard

NoDevice -> (string)

Suppresses the specified device included in the block device mapping of the AMI.

EbsOptimized -> (boolean)

Indicates whether the instances are optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.

Default: false

IamInstanceProfile -> (structure)

The IAM instance profile.

Arn -> (string)

The Amazon Resource Name (ARN) of the instance profile.

Name -> (string)

The name of the instance profile.

ImageId -> (string)

The ID of the AMI.

InstanceType -> (string)

The instance type.

KernelId -> (string)

The ID of the kernel.

KeyName -> (string)

The name of the key pair.

Monitoring -> (structure)

Enable or disable monitoring for the instances.

Enabled -> (boolean)

Enables monitoring for the instance.

Default: false

NetworkInterfaces -> (list)

One or more network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.

(structure)

Describes a network interface.

AssociatePublicIpAddress -> (boolean)

Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true .

DeleteOnTermination -> (boolean)

If set to true , the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.

Description -> (string)

The description of the network interface. Applies only if creating a network interface when launching an instance.

DeviceIndex -> (integer)

The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a run-instances request, you must provide the device index.

Groups -> (list)

The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.

(string)

Ipv6AddressCount -> (integer)

A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.

Ipv6Addresses -> (list)

One or more IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.

(structure)

Describes an IPv6 address.

Ipv6Address -> (string)

The IPv6 address.

NetworkInterfaceId -> (string)

The ID of the network interface.

PrivateIpAddress -> (string)

The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a run-instances request.

PrivateIpAddresses -> (list)

One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a run-instances request.

(structure)

Describes a secondary private IPv4 address for a network interface.

Primary -> (boolean)

Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.

PrivateIpAddress -> (string)

The private IPv4 addresses.

SecondaryPrivateIpAddressCount -> (integer)

The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a run-instances request.

SubnetId -> (string)

The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.

Placement -> (structure)

The placement information.

AvailabilityZone -> (string)

The Availability Zone.

[Spot Fleet only] To specify multiple Availability Zones, separate them using commas; for example, "us-west-2a, us-west-2b".

GroupName -> (string)

The name of the placement group.

Tenancy -> (string)

The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for Spot Instances.

RamdiskId -> (string)

The ID of the RAM disk.

SpotPrice -> (string)

The maximum price per unit hour that you are willing to pay for a Spot Instance. If this value is not specified, the default is the Spot price specified for the fleet. To determine the Spot price per unit hour, divide the Spot price by the value of WeightedCapacity .

SubnetId -> (string)

The ID of the subnet in which to launch the instances. To specify multiple subnets, separate them using commas; for example, "subnet-a61dafcf, subnet-65ea5f08".

UserData -> (string)

The user data to make available to the instances. If you are using an AWS SDK or command line tool, Base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide Base64-encoded text.

WeightedCapacity -> (double)

The number of units provided by the specified instance type. These are the same units that you chose to set the target capacity in terms (instances or a performance characteristic such as vCPUs, memory, or I/O).

If the target capacity divided by this value is not a whole number, we round the number of instances to the next whole number. If this value is not specified, the default is 1.

TagSpecifications -> (list)

The tags to apply during creation.

(structure)

The tags for a Spot Fleet resource.

ResourceType -> (string)

The type of resource. Currently, the only resource type that is supported is instance .

Tags -> (list)

The tags.

(structure)

Describes a tag.

Key -> (string)

The key of the tag.

Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:

Value -> (string)

The value of the tag.

Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.

LaunchTemplateConfigs -> (list)

The launch template and overrides.

(structure)

Describes a launch template and overrides.

LaunchTemplateSpecification -> (structure)

The launch template.

LaunchTemplateId -> (string)

The ID of the launch template. You must specify either a template ID or a template name.

LaunchTemplateName -> (string)

The name of the launch template. You must specify either a template name or a template ID.

Version -> (string)

The version number. By default, the default version of the launch template is used.

Overrides -> (list)

Any parameters that you specify override the same parameters in the launch template.

(structure)

Describes overrides for a launch template.

InstanceType -> (string)

The instance type.

SpotPrice -> (string)

The maximum price per unit hour that you are willing to pay for a Spot Instance.

SubnetId -> (string)

The ID of the subnet in which to launch the instances.

AvailabilityZone -> (string)

The Availability Zone in which to launch the instances.

WeightedCapacity -> (double)

The number of units provided by the specified instance type.

SpotPrice -> (string)

The maximum price per unit hour that you are willing to pay for a Spot Instance. The default is the On-Demand price.

TargetCapacity -> (integer)

The number of units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is maintain , you can specify a target capacity of 0 and add capacity later.

TerminateInstancesWithExpiration -> (boolean)

Indicates whether running Spot Instances should be terminated when the Spot Fleet request expires.

Type -> (string)

The type of request. Indicates whether the fleet will only request the target capacity or also attempt to maintain it. When you request a certain target capacity, the fleet will only place the required requests. It will not attempt to replenish Spot Instances if capacity is diminished, nor will it submit requests in alternative Spot pools if capacity is not available. When you want to maintain a certain target capacity, fleet will place the required requests to meet this target capacity. It will also automatically replenish any interrupted instances. Default: maintain .

ValidFrom -> (timestamp)

The start date and time of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). The default is to start fulfilling the request immediately.

ValidUntil -> (timestamp)

The end date and time of the request, in UTC format (for example, YYYY -MM -DD T*HH* :MM :SS Z). At this point, no new Spot Instance requests are placed or able to fulfill the request. The default end date is 7 days from the current date.

ReplaceUnhealthyInstances -> (boolean)

Indicates whether Spot Fleet should replace unhealthy instances.

InstanceInterruptionBehavior -> (string)

The behavior when a Spot Instance is interrupted. The default is terminate .

LoadBalancersConfig -> (structure)

One or more Classic Load Balancers and target groups to attach to the Spot Fleet request. Spot Fleet registers the running Spot Instances with the specified Classic Load Balancers and target groups.

With Network Load Balancers, Spot Fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.

ClassicLoadBalancersConfig -> (structure)

The Classic Load Balancers.

ClassicLoadBalancers -> (list)

One or more Classic Load Balancers.

(structure)

Describes a Classic Load Balancer.

Name -> (string)

The name of the load balancer.

TargetGroupsConfig -> (structure)

The target groups.

TargetGroups -> (list)

One or more target groups.

(structure)

Describes a load balancer target group.

Arn -> (string)

The Amazon Resource Name (ARN) of the target group.

SpotFleetRequestId -> (string)

The ID of the Spot Fleet request.

SpotFleetRequestState -> (string)

The state of the Spot Fleet request.