Skip to content

Commit

Permalink
tf: Replace deprecated nomad_volume (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 authored Mar 1, 2024
1 parent 3122e6f commit 80dde5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions terraform/mediawiki.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "nomad_job" "mysql" {
depends_on = [
data.nomad_plugin.ebs,
nomad_volume.mysql,
nomad_csi_volume_registration.mysql,
]

jobspec = file("../jobs/mysql.nomad")
Expand Down Expand Up @@ -38,7 +38,7 @@ resource "nomad_job" "fastcgi" {
resource "nomad_job" "http" {
depends_on = [
data.nomad_plugin.ebs,
nomad_volume.caddycerts,
nomad_csi_volume_registration.caddycerts,
]

jobspec = file("../jobs/http.nomad")
Expand Down
14 changes: 10 additions & 4 deletions terraform/volumes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ data "nomad_plugin" "ebs" {
wait_for_healthy = true
}

resource "nomad_volume" "mysql" {
import {
id = "mysql@default"
to = nomad_csi_volume_registration.mysql
}
resource "nomad_csi_volume_registration" "mysql" {
depends_on = [data.nomad_plugin.ebs]
type = "csi"
plugin_id = "aws-ebs0"
volume_id = "mysql"
name = "mysql"
Expand All @@ -33,9 +36,12 @@ resource "nomad_volume" "mysql" {
}
}

resource "nomad_volume" "caddycerts" {
import {
id = "caddycerts@default"
to = nomad_csi_volume_registration.caddycerts
}
resource "nomad_csi_volume_registration" "caddycerts" {
depends_on = [data.nomad_plugin.ebs]
type = "csi"
plugin_id = "aws-ebs0"
volume_id = "caddycerts"
name = "caddycerts"
Expand Down

0 comments on commit 80dde5d

Please sign in to comment.