feat: add option to set volume labels
This commit is contained in:
parent
a1ca739c82
commit
e9bf0a3531
9
main.tf
9
main.tf
@ -5,6 +5,7 @@ locals {
|
|||||||
volume_name = volume.name
|
volume_name = volume.name
|
||||||
volume_size = volume.size
|
volume_size = volume.size
|
||||||
server_id = hcloud_server.server[server.name].id
|
server_id = hcloud_server.server[server.name].id
|
||||||
|
server_name = server.name
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
@ -69,6 +70,14 @@ resource "hcloud_volume" "volume" {
|
|||||||
name = each.value.volume_name
|
name = each.value.volume_name
|
||||||
size = each.value.volume_size
|
size = each.value.volume_size
|
||||||
server_id = each.value.server_id
|
server_id = each.value.server_id
|
||||||
|
labels = merge(
|
||||||
|
{
|
||||||
|
provisioner = "terraform"
|
||||||
|
project = var.hcloud_project
|
||||||
|
server = each.value.server_name
|
||||||
|
},
|
||||||
|
try(each.value.labels, {})
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "hcloud_ssh_key" "key" {
|
resource "hcloud_ssh_key" "key" {
|
||||||
|
Loading…
Reference in New Issue
Block a user