40 lines
838 B
Terraform
40 lines
838 B
Terraform
|
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"
|
||
|
},
|
||
|
]
|
||
|
})
|
||
|
}
|