mirror of
https://github.com/apricote/home-cloud.git
synced 2026-01-13 13:01:03 +00:00
feat: deploy postgres server
This commit is contained in:
parent
fe3a5cee2e
commit
eb72e031d4
5 changed files with 79 additions and 2 deletions
47
postgres.tf
Normal file
47
postgres.tf
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
resource "hcloud_volume" "postgres_data" {
|
||||
name = "postgres-data"
|
||||
location = "fsn1"
|
||||
format = "ext4"
|
||||
automount = true
|
||||
size = 10
|
||||
}
|
||||
|
||||
resource "hcloud_volume" "postgres_backup" {
|
||||
name = "postgres-backup"
|
||||
location = "fsn1"
|
||||
format = "ext4"
|
||||
automount = true
|
||||
size = 10
|
||||
}
|
||||
|
||||
module "postgres" {
|
||||
source = "pellepelster/solidblocks-rds-postgresql/hcloud"
|
||||
version = "0.1.19"
|
||||
|
||||
data_volume = hcloud_volume.postgres_data.id
|
||||
backup_volume = hcloud_volume.postgres_backup.id
|
||||
|
||||
databases = var.postgres_databases
|
||||
|
||||
location = "fsn1"
|
||||
|
||||
name = "postgres"
|
||||
postgres_major_version = "15"
|
||||
server_type = "cax11"
|
||||
ssh_keys = [data.hcloud_ssh_key.default.id]
|
||||
|
||||
ssl_enable = true
|
||||
ssl_domains = ["pg.apricote.de"]
|
||||
ssl_email = "certs@apricote.de"
|
||||
ssl_dns_provider = "hetzner"
|
||||
ssl_dns_provider_config = { HETZNER_API_KEY : var.hetzner_dns_token }
|
||||
}
|
||||
|
||||
resource "hetznerdns_record" "pg_apricote_de_a" {
|
||||
zone_id = hetznerdns_zone.apricote_de.id
|
||||
|
||||
name = "pg"
|
||||
value = module.postgres.ipv4_address
|
||||
type = "A"
|
||||
ttl = 60
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue