Compare commits

..

No commits in common. "1557619a6d578e7f4120f4cc16e68b6312cedd3a" and "e1a002b74046a25e473b07d6a3560e1d123e3b83" have entirely different histories.

2 changed files with 10 additions and 5 deletions

13
main.tf
View File

@ -2,24 +2,26 @@
resource "nomad_job" "this" { resource "nomad_job" "this" {
for_each = var.jobs for_each = var.jobs
depends_on = [ depends_on = [
nomad_csi_volume.this, nomad_external_volume.this,
nomad_csi_volume_registration.this,
consul_key_prefix.this, consul_key_prefix.this,
# consul_config_entry.this
consul_intention.this consul_intention.this
] ]
jobspec = file(each.value) jobspec = file("${each.value}")
purge_on_destroy = true purge_on_destroy = true
hcl2 { hcl2 {
enabled = true
allow_fs = true allow_fs = true
} }
} }
resource "nomad_csi_volume" "this" { resource "nomad_external_volume" "this" {
for_each = var.volumes for_each = var.volumes
volume_id = each.key volume_id = each.key
name = each.key name = each.key
type = each.value.type
plugin_id = each.value.plugin_id plugin_id = each.value.plugin_id
namespace = each.value.namespace namespace = each.value.namespace
capacity_min = each.value.capacity_min capacity_min = each.value.capacity_min
@ -32,12 +34,13 @@ resource "nomad_csi_volume" "this" {
secrets = sensitive(each.value.secrets) secrets = sensitive(each.value.secrets)
} }
resource "nomad_csi_volume_registration" "this" { resource "nomad_volume" "this" {
for_each = var.nfs_volumes for_each = var.nfs_volumes
volume_id = each.key volume_id = each.key
external_id = each.key external_id = each.key
name = each.key name = each.key
type = each.value.type
plugin_id = each.value.plugin_id plugin_id = each.value.plugin_id
namespace = each.value.namespace namespace = each.value.namespace
capability { capability {

View File

@ -7,6 +7,7 @@ variable "jobs" {
variable "volumes" { variable "volumes" {
type = map(object({ type = map(object({
type = string
plugin_id = string plugin_id = string
namespace = string namespace = string
capacity_min = string capacity_min = string
@ -21,6 +22,7 @@ variable "volumes" {
variable "nfs_volumes" { variable "nfs_volumes" {
type = map(object({ type = map(object({
type = string
plugin_id = string plugin_id = string
namespace = string namespace = string
capability = map(string) capability = map(string)