serverctl/infrastructure/create-resources/main.tf
2022-02-17 21:39:56 +01:00

44 lines
844 B
HCL

terraform {
required_providers {
hcloud = {
source = "hetznercloud/hcloud"
version = "1.32.2"
}
}
backend "s3" {
bucket = "serverctl-terraform"
key = "terraform.tfstate"
endpoint = "https://api.minio.front.kjuulh.io"
region = "main"
skip_credentials_validation = true
skip_metadata_api_check = true
skip_region_validation = true
force_path_style = true
}
}
variable "hcloud_token" {
sensitive = true
}
provider "hcloud" {
token = var.hcloud_token
}
resource "hcloud_placement_group" "serverctl_master" {
name = "serverctl_master_group"
type = "spread"
}
resource "hcloud_server" "serverctl_master" {
count = 2
name = "serverctl-master-${count.index}"
image = "debian-11"
server_type = "cx11"
placement_group_id = hcloud_placement_group.serverctl_master.id
}