contabo / terraform-provider-contabo

Terraform Provider for Contabo Cloud-Services
MIT License
59 stars 7 forks source link

How to recreate an instance avoiding the setup fee #5

Closed jorgepsmatos closed 2 years ago

jorgepsmatos commented 2 years ago

Usually, with Terraform we can do something like this to recreate an instance (on other cloud providers):

terraform destroy
...
terraform apply

But, as warned in the README.md, since Contabo has a setup fee for the VPS, doing the above is not viable because it would incur an elevated cost:

# CAUTION:  with example main.tf you are about to order and pay a Cloud VPS instance

What is the suggested alternative in the case of Contabo to force a reinstallation of an existing VPS?

Currently, my approach is to make a small change on the cloud-init which triggers a reinstallation, but it doesn't feel right.

tahergalal commented 2 years ago

The only solution is to perform a state change where something changes in the instance so that it will basically perform a reinstall.