feat: initial setup
Build / build (pull_request) Successful in 39s

- manage nomad jobs
- create makefile
- create gitignore
- manage terragrunt environments
- add build/deploy jobs
This commit is contained in:
2024-12-28 14:17:21 +11:00
parent f7fad0b74f
commit ce8483f9fa
11 changed files with 379 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
# Dynamically load all job configurations from the jobs/ folder
resource "nomad_job" "app" {
for_each = toset(var.job_files)
jobspec = file("../../${path.module}/jobs/${each.value}.hcl")
}
resource "nomad_acl_policy" "policies" {
for_each = toset(var.policy_files)
name = each.value
rules_hcl = file("../../${path.module}/policies/${each.value}")
}
resource "nomad_acl_role" "roles" {
for_each = toset(var.policy_files)
name = "${each.value}_role"
policy {
name = each.value
}
}
resource "nomad_acl_token" "tokens" {
for_each = toset(var.policy_files)
name = "${each.value}_token"
type = "client"
policies = [each.value]
}
+14
View File
@@ -0,0 +1,14 @@
#variable "nomad_token" {
# description = "The Nomad API token"
# type = string
#}
variable "job_files" {
description = "List of Nomad job files to deploy"
type = list(string)
}
variable "policy_files" {
description = "List of policy files to create Nomad ACL policies"
type = list(string)
}