Learn how to delete a NAT Gateway subscription from a Vultr VPC via API, CLI and Terraform.
Remove a NAT Gateway subscription from a VPC when it is no longer required. Deletion immediately decommissions the gateway and stops billing for that subscription. Ensure no workloads depend on its egress or port forwarding rules before proceeding.
Follow this guide to delete a NAT Gateway subscription using the Vultr API, CLI, or Terraform.
Send a GET request to the List VPCs endpoint and note the target VPC ID.
$ curl "https://api.vultr.com/v2/vpcs" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a GET request to the Get NAT Gateway subscription endpoint specifying the VPC ID, and note the NAT Gateway ID from the output.
$ curl "https://api.vultr.com/v2/vpcs/{vpc-id}/nat-gateway" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a DELETE request to the Delete NAT Gateway subscription endpoint specifying the VPC ID and NAT Gateway ID.
$ curl "https://api.vultr.com/v2/vpcs/{vpc-id}/nat-gateway/{nat-gateway-id}" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}"
List all VPCs in your account to retrieve the VPC ID.
$ vultr-cli vpc list
List NAT Gateway subscriptions for the VPC to retrieve the NAT Gateway ID.
$ vultr-cli vpc nat-gateway list <VPC_ID>
Delete the NAT Gateway subscription.
$ vultr-cli vpc nat-gateway delete <VPC_ID> <NAT_GATEWAY_ID>
The NAT Gateway is deleted immediately and billing stops.
Remove the vultr_nat_gateway resource block from your Terraform configuration file.
Apply the configuration to delete the resource:
$ terraform apply
Terraform detects the removed resource and deletes the NAT Gateway subscription.
Alternatively, destroy a specific resource using the -target flag:
$ terraform destroy -target=vultr_nat_gateway.my_nat