variable "host" { type = "string" } variable "volume_id" { type = "string" } variable "server_id" { type = "string" } variable "tls_private_key" { type = "string" } variable "tls_certificate" { type = "string" } variable "tls_issuer_certificate" { type = "string" } # volumes contain persistent storage and thus need to be initialized # manually data "hcloud_volume" "volume" { id = "${var.volume_id}" } resource "hcloud_volume_attachment" "volume_attachment" { volume_id = "${data.hcloud_volume.volume.id}" server_id = "${var.server_id}" } resource "null_resource" "volume_mount" { triggers = { attachement_id = "${hcloud_volume_attachment.volume_attachment.id}" } connection { host = "${var.host}" } provisioner "remote-exec" { inline = ["mkdir -p /mnt/storage"] } provisioner "file" { content = <