provider "digitalocean" { token = var.do_token spaces_access_id = var.spaces_access_id spaces_secret_key = var.spaces_secret_key } module "packer_droplet" { source = "../../../terraform-modules/packer_droplet" name = "syncthing" do_token = var.do_token spaces_access_id = var.spaces_access_id spaces_secret_key = var.spaces_secret_key } resource "digitalocean_volume" "syncthing_volume" { name = "syncthing-volume" description = "The volume to hold the default Sync folder" region = "nyc1" size = 100 initial_filesystem_label = "syncthing-volume" initial_filesystem_type = "ext4" tags = ["terraform"] lifecycle { prevent_destroy = true } } resource "digitalocean_volume_attachment" "syncthing" { droplet_id = module.packer_droplet.droplet_id volume_id = digitalocean_volume.syncthing_volume.id }