fix: Use immutable names for volumes in example templates (#4954)

* fix: Use immutable names for volumes in example templates

This contributes towards #3000, #3386

Related #3409

* Add lifecycle and labels
This commit is contained in:
Mathias Fredriksson
2022-11-09 16:18:19 +02:00
committed by GitHub
parent 26ab0d37c1
commit ed7de90a55
9 changed files with 215 additions and 11 deletions
+5 -1
View File
@@ -100,10 +100,14 @@ resource "coder_agent" "main" {
resource "digitalocean_volume" "home_volume" {
region = var.region
name = "coder-${data.coder_workspace.me.owner}-${data.coder_workspace.me.name}-home"
name = "coder-${data.coder_workspace.me.id}-home"
size = var.home_volume_size
initial_filesystem_type = "ext4"
initial_filesystem_label = "coder-home"
# Protect the volume from being deleted due to changes in attributes.
lifecycle {
ignore_changes = all
}
}
resource "digitalocean_droplet" "workspace" {