Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workstation-cluster module for private deployment #2247

Merged
merged 2 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading