Skip to main content

Dedicated Servers in Terraform

Terraform is an infrastructure management tool for cloud or dedicated servers from HashiCorp. The infrastructure and its components are described in the HashiCorp Configuration Language (HCL) in configuration files with the .tf extension. Learn more about the tool in the What is Terraform article in HashiCorp documentation.

Terraform manages infrastructure using providers, which are special plugins that interact with the APIs of services and platforms.

Dedicated servers are managed using the Selectel provider, which provides the selectel_dedicated_server_v1 resource. Learn more about managing resources in the Manage Terraform resources instructions.

To install Terraform and configure the Selectel provider, follow the Set up the environment for Terraform instructions. When working with dedicated servers via Terraform, pay attention to the features of managing dedicated servers. View examples of infrastructure creation in the Dedicated Servers subsection of the Terraform documentation.

Specifics of managing dedicated servers in Terraform

Ordering a server
Server upgrade
OS autoinstallation
Canceling a server and resuming service
  • after canceling the dedicated server, the server will remain active until the end of the paid period;
  • you cannot resume the service via Terraform. You can resume the server lease in the control panel: in the top menu, click Products → Dedicated Servers → server page → in the menu, select Resume server lease. After resuming the service, import the server into Terraform