How to cancel a spot instance request from AWS CLI

Use the below command to cancel a spot instance request where REQUESTID is the request id of the spot instance.

aws ec2 cancel-spot-instance-requests --spot-instance-request-ids REQUESTID

See also  How to create an AMI of an EC2 Instance from AWS CLI