Skip to main content

Dedicated Servers in Terraform

Terraform is an infrastructure as code tool for cloud or dedicated servers from HashiCorp. Infrastructure and its components are described using HashiCorp Configuration Language (HCL) in configuration files with the .tf extension. Learn more about the tool in the What is Terraform? article in the 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 resource management in the Manage Terraform resources guide.

To install Terraform and set up the Selectel provider, use the Set up a Terraform environment guide. When working with dedicated servers via Terraform, pay attention to the specifics of managing dedicated servers. See examples of building infrastructure in the Dedicated servers section 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 a dedicated server, the server will remain active until the end of the paid period;
  • you cannot resume a service via Terraform. You can resume a server lease in the Control panel: in the top menu, click ProductsDedicated servers → server page → in the menu, select Resume server lease. After resuming the service, import the server into Terraform