orchestration-tests/nomad/databases/postgres.tf

40 lines
838 B
Terraform
Raw Permalink Normal View History

2022-09-26 23:42:25 +00:00
resource "nomad_job" "postgres-server" {
hcl2 {
enabled = true
}
jobspec = file("${path.module}/postgres.nomad")
# Block until deployed as there are servics dependent on this one
detach = false
}
# NOTE: This may need to be moved to after the services are created
resource "consul_config_entry" "postgres_intents" {
name = "postgres-server"
kind = "service-intentions"
config_json = jsonencode({
Sources = [
{
Action = "allow"
Name = "adminer"
Precedence = 9
Type = "consul"
},
{
Action = "allow"
Name = "backups"
Precedence = 9
Type = "consul"
},
{
Action = "allow"
Name = "immich"
Precedence = 9
Type = "consul"
},
]
})
}