TimeWeb-Cloud Server Terraform module
Terraform module which creates server on TimeWeb Cloud
#
# With preset
#
module "server" {
source = " https://github.com/deff-dev/terraform-timeweb-cloud-server.git"
name = " Single-preset"
project_name = " Общий проект"
os = {
name = " ubuntu"
version = " 22.04"
}
location = " ru-1"
cpu_frequency = 3.3
disk_type = " nvme"
preset = {
cpu = 1
ram = 1
disk = 15
price = {
min = 100
max = 200
}
}
ssh_keys = [" key_name_1" , " key_name_2" ]
ssh_keys_paths = [
{
name = " key1"
path = " /local/path/to/key1.pub"
},
{
name = " key2"
path = " /local/path/to/key2.pub"
}
]
cloud_init = {
file = " cloud_init.tftpl"
vars = {
package_web = " nginx"
php_version = 8.2
}
}
providers = {
twc = twc.default
}
}
provider "twc" {
token = " token"
alias = " default"
}
#
# With configurator
#
module "server" {
source = " https://github.com/deff-dev/terraform-timeweb-cloud-server.git"
name = " Single-configurator"
project_name = " Общий проект"
os = {
name = " ubuntu"
version = " 22.04"
}
location = " ru-1"
cpu_frequency = 3.3
disk_type = " nvme"
configurator = {
cpu = 1
ram = 4
disk = 5
}
ssh_keys = [" key_name_1" , " key_name_2" ]
ssh_keys_paths = [
{
name = " key1"
path = " /local/path/to/key1.pub"
},
{
name = " key2"
path = " /local/path/to/key2.pub"
}
]
cloud_init = {
file = " cloud_init.tftpl"
vars = {
package_web = " nginx"
php_version = 8.2
}
}
providers = {
twc = twc.default
}
}
provider "twc" {
token = " token"
alias = " default"
}
No modules.
Name
Description
Type
Default
Required
timeweb_token
TimeWeb Token
string
null
no
name
Name for server
string
"Managed by terraform"
yes
project_name
Name of existing project
string
null
no
os
Information about specified OS
object
{ "name": "ubuntu", "version": "22.04" }
yes
location
Location for the server (ru-1, ru-2, pl-1, kz-1)
string
null
no
cpu_frequency
Current CPU frequency of server (2.8, 3.3, 5)
number
3.3
no
disk_type
Disk type for the created server (ssd, nvme, hdd)
string
null
no
preset
Settings for the server with preset
object
null
no
configurator
Settings for the server with configurator
object
null
no
ssh_keys
List of names SSH Keys for server
list(string)
null
no
ssh_keys_paths
Local paths of SSH Keys for server
list(object)
null
no
cloud_init
Cloud-init script
object
null
no
Module is maintained by Deff .
Thanks for help alxrem .
Apache 2 Licensed. See LICENSE for full details.