Resize Instance Workflow
resize-instance.yaml is the explicit workflow for changing a Vultr instance
plan. The normal platform deployment must not be used to downgrade an existing
instance: Vultr rejects an in-place plan decrease such as
vc2-4c-8gb -> vc2-2c-4gb.
Modes
same: no infrastructure change.upgrade: imports the existing instance into an operation-local Terraform state, applies the higher plan, and then finishes with the normal health checks.downgrade: creates a snapshot, creates a replacement instance from that snapshot in an isolated Terraform state, checks the replacement through the target hostname, optionally switches the Cloudflare A record, retains the source during the observation window, and only deletes it whendestroy_old_instance=trueis explicitly selected.
The replacement module lives in the iac_modules repository at
terraform-hcl-standard/vultr-vps/modules/resize-instance.
Safety gates
- The preflight reads the current instance from Vultr and validates the plan direction before any mutation.
- Downgrades require
confirm_resize=true. - Replacement Terraform must contain exactly one create and zero deletes.
- DNS is changed only after the replacement health check succeeds and
switch_dns=trueis selected. - The source instance is retained for the observation window by default.
- Production runs should use the
resize-prodGitHub Environment with an approval rule before allowing the workflow to continue. - Snapshot-based replacements require the target plan disk to be at least as large as the source disk. A smaller target disk is rejected during preflight before a snapshot is created; it requires an application-level backup and restore migration instead.
The workflow uses Vault OIDC credentials. It does not accept provider tokens as workflow inputs and does not put credentials in Terraform state variables.