Selecione suas preferências de cookies

Usamos cookies essenciais e ferramentas semelhantes que são necessárias para fornecer nosso site e serviços. Usamos cookies de desempenho para coletar estatísticas anônimas, para que possamos entender como os clientes usam nosso site e fazer as devidas melhorias. Cookies essenciais não podem ser desativados, mas você pode clicar em “Personalizar” ou “Recusar” para recusar cookies de desempenho.

Se você concordar, a AWS e terceiros aprovados também usarão cookies para fornecer recursos úteis do site, lembrar suas preferências e exibir conteúdo relevante, incluindo publicidade relevante. Para aceitar ou recusar todos os cookies não essenciais, clique em “Aceitar” ou “Recusar”. Para fazer escolhas mais detalhadas, clique em “Personalizar”.

RequestSpotFleet

Modo de foco
RequestSpotFleet - Amazon Elastic Compute Cloud
Esta página não foi traduzida para seu idioma. Solicitar tradução

Creates a Spot Fleet request.

The Spot Fleet request specifies the total target capacity and the On-Demand target capacity. Amazon EC2 calculates the difference between the total capacity and On-Demand capacity, and launches the difference as Spot capacity.

You can submit a single request that includes multiple launch specifications that vary by instance type, AMI, Availability Zone, or subnet.

By default, the Spot Fleet requests Spot Instances in the Spot Instance pool where the price per unit is the lowest. Each launch specification can include its own instance weighting that reflects the value of the instance type to your application workload.

Alternatively, you can specify that the Spot Fleet distribute the target capacity across the Spot pools included in its launch specifications. By ensuring that the Spot Instances in your Spot Fleet are in different Spot pools, you can improve the availability of your fleet.

You can specify tags for the Spot Fleet request and instances launched by the fleet. You cannot tag other resource types in a Spot Fleet request because only the spot-fleet-request and instance resource types are supported.

For more information, see Spot Fleet requests in the Amazon EC2 User Guide.

Important

We strongly discourage using the RequestSpotFleet API because it is a legacy API with no planned investment. For options for requesting Spot Instances, see Which is the best Spot request method to use? in the Amazon EC2 User Guide.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.

DryRun

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.

Type: Boolean

Required: No

SpotFleetRequestConfig

The configuration for the Spot Fleet request.

Type: SpotFleetRequestConfigData object

Required: Yes

Response Elements

The following elements are returned by the service.

requestId

The ID of the request.

Type: String

spotFleetRequestId

The ID of the Spot Fleet request.

Type: String

Errors

For information about the errors that are common to all actions, see Common client error codes.

Examples

Example

This example creates a Spot Fleet request with two launch specifications.

Sample Request

https://ec2.amazonaws.com/?Action=RequestSpotFleet &SpotFleetRequestConfig.IamFleetRole=arn:aws:iam::123456789011:role/spot-fleet-role &SpotFleetRequestConfig.TargetCapacity=5 &SpotFleetRequestConfig.LaunchSpecifications.1.ImageId=ami-1ecae776 &SpotFleetRequestConfig.LaunchSpecifications.1.InstanceType=m4.large &SpotFleetRequestConfig.LaunchSpecifications.1.SubnetId=subnet-1a2b3c4d &SpotFleetRequestConfig.LaunchSpecifications.2.ImageId=ami-1ecae776 &SpotFleetRequestConfig.LaunchSpecifications.2.InstanceType=m3.medium &SpotFleetRequestConfig.LaunchSpecifications.2.SubnetId=subnet-1a2b3c4d &AUTHPARAMS

Sample Response

<RequestSpotFleetResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>60262cc5-2bd4-4c8d-98ed-example</requestId> <spotFleetRequestId>sfr-123f8fc2-cb31-425e-abcd-example2710</spotFleetRequestId> </RequestSpotFleetResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

PrivacidadeTermos do sitePreferências de cookies
© 2025, Amazon Web Services, Inc. ou suas afiliadas. Todos os direitos reservados.