Deleting an instance permanently erases the server's file system and removes all IP information. This action is irreversible and any data on the instance data is lost unless a backup or snapshot is available in your Vultr account.
Follow this guide to delete a Vultr Cloud Compute instance using the Vultr Customer Portal, API, CLI, or Terraform.
Send a GET
request to the List Instances endpoint and note your target instance's ID.
$ curl "https://api.vultr.com/v2/instances" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a DELETE
request to the Delete Instance endpoint to delete the instance.
$ curl "https://api.vultr.com/v2/instances/{instance-id}" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}"
List all available instances and note your target instance's ID.
$ vultr-cli instance list
Delete the target instance.
$ vultr-cli instance delete <instance_id>
Open your Terraform configuration and locate the Cloud Compute instance resource.
Remove the resource block or set its lifecycle to destroy.
resource "vultr_instance" "cc" {
label = "cc-instance-1"
region = "del"
plan = "vc2-2c-4gb"
os_id = 2284
hostname = "cc-instance-1"
}
# To delete, either remove this block from configuration
# or run: terraform destroy -target vultr_instance.cc
Apply the configuration and observe the following output:
Apply complete! Resources: 0 added, 0 changed, 1 destroyed.
No comments yet.