Skip to content

Commit

Permalink
fis issues with private workstation-cluster module and persistent_dir…
Browse files Browse the repository at this point in the history
…ectories (#2247)

Co-authored-by: Ludovico Magnocavallo <[email protected]>
  • Loading branch information
simonebruzzechesse and ludoo authored May 2, 2024
1 parent fdcd309 commit dccf573
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions modules/workstation-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ module "workstation-cluster" {
}
workstation_configs = {
my-workstation-config = {
gce_instance = {
disable_public_ip_addresses = true
}
workstations = {
my-workstation = {
labels = {
Expand Down
21 changes: 18 additions & 3 deletions modules/workstation-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ resource "google_workstations_workstation_config" "configs" {
pool_size = each.value.gce_instance.pool_size
boot_disk_size_gb = each.value.gce_instance.boot_disk_size_gb
tags = each.value.gce_instance.tags
disable_public_ip_addresses = each.value.disable_public_ip_addresses
enable_nested_virtualization = each.value.enable_nested_virtualization
disable_public_ip_addresses = each.value.gce_instance.disable_public_ip_addresses
enable_nested_virtualization = each.value.gce_instance.enable_nested_virtualization
dynamic "shielded_instance_config" {
for_each = each.value.gce_instance.shielded_instance_config == null ? [] : [""]
content {
Expand All @@ -81,7 +81,7 @@ resource "google_workstations_workstation_config" "configs" {
}
}
dynamic "confidential_instance_config" {
for_each = each.value.gce_instance.enable_confidential_compute ? [] : [""]
for_each = each.value.gce_instance.enable_confidential_compute ? [""] : []
content {
enable_confidential_compute = true
}
Expand Down Expand Up @@ -114,6 +114,21 @@ resource "google_workstations_workstation_config" "configs" {
kms_key_service_account = each.value.encryption_key.kms_key_service_account
}
}
dynamic "persistent_directories" {
for_each = each.value.persistent_directories
content {
mount_path = persistent_directories.value.mount_path
dynamic "gce_pd" {
for_each = persistent_directories.value.gce_pd == null ? [] : [""]
content {
size_gb = persistent_directories.value.gce_pd.size_gb
fs_type = persistent_directories.value.gce_pd.fs_type
disk_type = persistent_directories.value.gce_pd.disk_type
reclaim_policy = persistent_directories.value.gce_pd.reclaim_policy
}
}
}
}
}

resource "google_workstations_workstation" "workstations" {
Expand Down

0 comments on commit dccf573

Please sign in to comment.