Skip to content

Commit 20f925d

Browse files
committed
gcp: add confidential compute support for boostrap TF
The confidential compute configuration options for the bootstrap instance are defined by the respective control-plane instance options. The scheduling and confidential_instance_config options are defined as dynamic blocks and they will be applied when the user specifies the respective config options. This allows us to respect the cloud provider defaults, when the user does not provide any values. At the same time, it does not require code updates when the cloud provider defaults change. Signed-off-by: Michail Resvanis <[email protected]>
1 parent 4014b61 commit 20f925d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

data/data/gcp/bootstrap/main.tf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,27 @@ resource "google_compute_instance" "bootstrap" {
113113
network_ip = local.public_endpoints ? null : google_compute_address.bootstrap.address
114114
}
115115

116+
dynamic "shielded_instance_config" {
117+
for_each = var.gcp_master_secure_boot != "" ? [1] : []
118+
content {
119+
enable_secure_boot = var.gcp_master_secure_boot == "Enabled"
120+
}
121+
}
122+
123+
dynamic "confidential_instance_config" {
124+
for_each = var.gcp_master_confidential_compute != "" ? [1] : []
125+
content {
126+
enable_confidential_compute = var.gcp_master_confidential_compute == "Enabled"
127+
}
128+
}
129+
130+
dynamic "scheduling" {
131+
for_each = var.gcp_master_on_host_maintenance != "" ? [1] : []
132+
content {
133+
on_host_maintenance = var.gcp_master_on_host_maintenance
134+
}
135+
}
136+
116137
metadata = {
117138
user-data = data.ignition_config.redirect.rendered
118139
}

0 commit comments

Comments
 (0)