Cancels the specified Capacity Reservation, releases the reserved capacity, and changes the Capacity Reservation's state to
cancelled.
Instances running in the reserved capacity continue running until you stop them. Stopped
instances that target the Capacity Reservation can no longer launch. Modify these instances to either
target a different Capacity Reservation, launch On-Demand Instance capacity, or run in any open Capacity Reservation
that has matching attributes and sufficient capacity.
example
Use a bare-bones client and the command you need to make an API call.
Cancels the specified Capacity Reservation, releases the reserved capacity, and changes the Capacity Reservation's state to
cancelled
.Instances running in the reserved capacity continue running until you stop them. Stopped instances that target the Capacity Reservation can no longer launch. Modify these instances to either target a different Capacity Reservation, launch On-Demand Instance capacity, or run in any open Capacity Reservation that has matching attributes and sufficient capacity.
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, CancelCapacityReservationCommand } from "@aws-sdk/client-ec2"; // ES Modules import // const { EC2Client, CancelCapacityReservationCommand } = require("@aws-sdk/client-ec2"); // CommonJS import const client = new EC2Client(config); const command = new CancelCapacityReservationCommand(input); const response = await client.send(command);
CancelCapacityReservationCommandInput for command's
input
shape.CancelCapacityReservationCommandOutput for command's
response
shape.config for EC2Client's
config
shape.