Skip to content

Commit 2b4a37e

Browse files
committed
🔧 upadate docker provider
🔧 add optional live cert variable ♻️ remove deprecated interpolation-only expression 🎨 fix formatting (terraform fmt)
1 parent e472f88 commit 2b4a37e

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

service.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ resource "docker_service" "vault-dev" {
99
args = ["server"] # automatically loads mounted vault-config.hcl
1010

1111
env = {
12-
VAULT_ADDR = "http://127.0.0.1:8200"
12+
VAULT_ADDR = "http://127.0.0.1:8200"
1313
VAULT_API_ADDR = "http://127.0.0.1:8200"
14-
SKIP_SETCAP = true
14+
SKIP_SETCAP = true
1515
}
1616

1717
labels {
@@ -36,7 +36,7 @@ resource "docker_service" "vault-dev" {
3636

3737
labels {
3838
label = "traefik.http.routers.vault-dev.tls.certresolver"
39-
value = "letsEncrypt"
39+
value = var.live_cert == false ? "letsEncryptStaging" : "letsEncrypt"
4040
}
4141

4242
configs {

variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
# Required variables
22
variable "hostname" {
33
type = string
4-
description = "Hostname for traefik route"
4+
description = "Hostname for Vault route."
5+
}
6+
7+
variable "live_cert" {
8+
type = bool
9+
description = "Deploy Vault with a production (live) or staging SSL certificate."
10+
default = false
511
}
612

713
# Optional variables
814
variable "networks" {
9-
type = list
15+
type = list(string)
1016
description = "List of networks to connect Vault to."
1117
default = ["traefik"]
1218
}

vault_tpl.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,5 @@ data "local_file" "vault_hcl" {
22
filename = "${path.module}/vault-config.hcl"
33
}
44
data "template_file" "vault_hcl" {
5-
template = "${file("${path.module}/vault-config.hcl")}"
6-
7-
# vars = {
8-
# traefik_network = var.traefik_network
9-
# }
5+
template = file("${path.module}/vault-config.hcl")
106
}

version.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
terraform {
2-
required_providers {
3-
docker = {
4-
source = "terraform-providers/docker"
5-
}
2+
required_providers {
3+
docker = {
4+
source = "kreuzwerker/docker"
65
}
7-
required_version = ">= 0.13, <= 0.14"
6+
}
7+
required_version = ">= 0.13, <= 0.14"
88
}

0 commit comments

Comments
 (0)