Add infrastructure
This commit is contained in:
5
infrastructure/create-resources/.gitignore
vendored
Normal file
5
infrastructure/create-resources/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
*.tfvars
|
||||
.terraform/
|
||||
.terraform.lock.hcl
|
||||
terraform.tfstate
|
||||
terraform.tfstate.backup
|
43
infrastructure/create-resources/main.tf
Normal file
43
infrastructure/create-resources/main.tf
Normal file
@@ -0,0 +1,43 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user