For more information, see Spot Instance requests in
the Amazon EC2 User Guide for Linux Instances.
We strongly discourage using the RequestSpotInstances 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 for Linux Instances.
We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon EC2 User Guide for Linux Instances.
example
Use a bare-bones client and the command you need to make an API call.
Creates a Spot Instance request.
For more information, see Spot Instance requests in the Amazon EC2 User Guide for Linux Instances.
We strongly discourage using the RequestSpotInstances 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 for Linux Instances.
We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon EC2 User Guide for Linux Instances.
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, RequestSpotInstancesCommand } from "@aws-sdk/client-ec2"; // ES Modules import // const { EC2Client, RequestSpotInstancesCommand } = require("@aws-sdk/client-ec2"); // CommonJS import const client = new EC2Client(config); const command = new RequestSpotInstancesCommand(input); const response = await client.send(command);
RequestSpotInstancesCommandInput for command's
input
shape.RequestSpotInstancesCommandOutput for command's
response
shape.config for EC2Client's
config
shape.