-
Notifications
You must be signed in to change notification settings - Fork 262
/
main.tf
36 lines (26 loc) · 858 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
resource "null_resource" "dockervol" {
provisioner "local-exec" {
command = "mkdir noderedvol/ || true && sudo chown -R 1000:1000 noderedvol/"
}
}
module "image" {
source = "./image"
image_in = var.image[terraform.workspace]
}
resource "random_string" "random" {
count = local.container_count
length = 4
special = false
upper = false
}
module "container" {
source = "./container"
depends_on = [null_resource.dockervol]
count = local.container_count
name_in = join("-", ["nodered", terraform.workspace, random_string.random[count.index].result])
image_in = module.image.image_out
int_port_in = var.int_port
ext_port_in = var.ext_port[terraform.workspace][count.index]
container_path_in = "/data"
host_path_in = "${path.cwd}/noderedvol"
}