homelab-nomad/mysql/mysql.tf

39 lines
731 B
Terraform
Raw Normal View History

2022-02-27 23:22:09 +00:00
resource "nomad_job" "mysql-server" {
hcl2 {
enabled = true
}
jobspec = file("${path.module}/mysql.nomad")
}
resource "nomad_job" "adminer" {
hcl2 {
enabled = true
}
jobspec = file("${path.module}/adminer.nomad")
}
2022-03-14 22:58:47 +00:00
# NOTE: This may need to be moved to after the services are created
resource "consul_config_entry" "mysql_intents" {
2022-03-14 23:56:44 +00:00
name = "mysql-server"
2022-03-14 22:58:47 +00:00
kind = "service-intentions"
config_json = jsonencode({
Sources = [
{
Action = "allow"
Name = "adminer"
Precedence = 9
Type = "consul"
},
{
Action = "allow"
Name = "nextcloud"
Precedence = 9
Type = "consul"
},
]
})
}