30 lines
543 B
Terraform
30 lines
543 B
Terraform
|
terraform {
|
||
|
required_providers {
|
||
|
hcloud = {
|
||
|
source = "hetznercloud/hcloud"
|
||
|
version = "1.31.1"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
variable "hcloud_token" {}
|
||
|
|
||
|
provider "hcloud" {
|
||
|
token = var.hcloud_token
|
||
|
}
|
||
|
|
||
|
resource "hcloud_server" "web" {
|
||
|
name = "terraform-test"
|
||
|
image = "debian-10"
|
||
|
server_type = "cx11"
|
||
|
ssh_keys = [
|
||
|
"lukewm@riseup.net"
|
||
|
]
|
||
|
user_data = file("user_data.yml")
|
||
|
}
|
||
|
|
||
|
output "ipv4_addresses" {
|
||
|
value = hcloud_server.web.ipv4_address
|
||
|
description = "The ipv4 address of your new Hetzner Cloud VPS"
|
||
|
}
|