Skip to content

Commit bc6d76b

Browse files
Default enable_shielded_nodes to true (#5263) (#10403)
Signed-off-by: Modular Magician <[email protected]>
1 parent 5f11c0f commit bc6d76b

File tree

4 files changed

+68
-14
lines changed

4 files changed

+68
-14
lines changed

.changelog/5263.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:breaking-change
2+
container: changed default for `enable_shielded_nodes` to true for `google_container_cluster`
3+
```

google/resource_container_cluster.go

+2-9
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ func resourceContainerCluster() *schema.Resource {
371371
"enable_shielded_nodes": {
372372
Type: schema.TypeBool,
373373
Optional: true,
374-
Computed: true,
375-
Description: `Enable Shielded Nodes features on all nodes in this cluster.`,
374+
Default: true,
375+
Description: `Enable Shielded Nodes features on all nodes in this cluster. Defaults to true.`,
376376
ConflictsWith: []string{"enable_autopilot"},
377377
},
378378

@@ -1215,10 +1215,6 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er
12151215
ResourceLabels: expandStringMap(d, "resource_labels"),
12161216
}
12171217

1218-
// shielded nodes is computed and optional yet serverside
1219-
// default is true. Forcing true here esentially serves
1220-
// as a default false but is unavoidable due to how
1221-
// computed and GetOk work together.
12221218
v := d.Get("enable_shielded_nodes")
12231219
cluster.ShieldedNodes = &containerBeta.ShieldedNodes{
12241220
Enabled: v.(bool),
@@ -3615,9 +3611,6 @@ func containerClusterAutopilotCustomizeDiff(_ context.Context, d *schema.Resourc
36153611
if err := d.SetNew("enable_intranode_visibility", true); err != nil {
36163612
return err
36173613
}
3618-
if err := d.SetNew("enable_shielded_nodes", true); err != nil {
3619-
return err
3620-
}
36213614
}
36223615
return nil
36233616
}

website/docs/guides/version_4_upgrade.html.markdown

+62-4
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,57 @@ description: |-
3030
- [At least one of `autoscaling_policy.0.scale_in_control.0.max_scaled_in_replicas` or `autoscaling_policy.0.scale_in_control.0.time_window_sec` is required](#at-least-one-of-autoscaling_policy0scale_in_control0max_scaled_in_replicas-or-autoscaling_policy0scale_in_control0time_window_sec-is-required)
3131
- [At least one of `autoscaling_policy.0.scale_in_control.0.max_scaled_in_replicas.0.fixed` or `autoscaling_policy.0.scale_in_control.0.max_scaled_in_replicas.0.percent` is required](#at-least-one-of-autoscaling_policy0scale_in_control0max_scaled_in_replicas0fixed-or-autoscaling_policy0scale_in_control0max_scaled_in_replicas0percent-is-required)
3232
- [Resource: `google_compute_region_autoscaler`](#resource-google_compute_region_autoscaler)
33-
- [At least one of `autoscaling_policy.0.scale_down_control.0.max_scaled_down_replicas` or `autoscaling_policy.0.scale_down_control.0.time_window_sec` is required](#at-least-one-of-autoscaling_policy0scale_down_control0max_scaled_down_replicas-or-autoscaling_policy0scale_down_control0time_window_sec-is-required)
34-
- [At least one of `autoscaling_policy.0.scale_down_control.0.max_scaled_down_replicas.0.fixed` or `autoscaling_policy.0.scale_down_control.0.max_scaled_down_replicas.0.percent` is required](#at-least-one-of-autoscaling_policy0scale_down_control0max_scaled_down_replicas0fixed-or-autoscaling_policy0scale_down_control0max_scaled_down_replicas0percent-is-required)
35-
- [At least one of `autoscaling_policy.0.scale_in_control.0.max_scaled_in_replicas` or `autoscaling_policy.0.scale_in_control.0.time_window_sec` is required](#at-least-one-of-autoscaling_policy0scale_in_control0max_scaled_in_replicas-or-autoscaling_policy0scale_in_control0time_window_sec-is-required)
36-
- [At least one of `autoscaling_policy.0.scale_in_control.0.max_scaled_in_replicas.0.fixed` or `autoscaling_policy.0.scale_in_control.0.max_scaled_in_replicas.0.percent` is required](#at-least-one-of-autoscaling_policy0scale_in_control0max_scaled_in_replicas0fixed-or-autoscaling_policy0scale_in_control0max_scaled_in_replicas0percent-is-required)
33+
- [At least one of `autoscaling_policy.0.scale_down_control.0.max_scaled_down_replicas` or `autoscaling_policy.0.scale_down_control.0.time_window_sec` is required](#at-least-one-of-autoscaling_policy0scale_down_control0max_scaled_down_replicas-or-autoscaling_policy0scale_down_control0time_window_sec-is-required-1)
34+
- [At least one of `autoscaling_policy.0.scale_down_control.0.max_scaled_down_replicas.0.fixed` or `autoscaling_policy.0.scale_down_control.0.max_scaled_down_replicas.0.percent` is required](#at-least-one-of-autoscaling_policy0scale_down_control0max_scaled_down_replicas0fixed-or-autoscaling_policy0scale_down_control0max_scaled_down_replicas0percent-is-required-1)
35+
- [At least one of `autoscaling_policy.0.scale_in_control.0.max_scaled_in_replicas` or `autoscaling_policy.0.scale_in_control.0.time_window_sec` is required](#at-least-one-of-autoscaling_policy0scale_in_control0max_scaled_in_replicas-or-autoscaling_policy0scale_in_control0time_window_sec-is-required-1)
36+
- [At least one of `autoscaling_policy.0.scale_in_control.0.max_scaled_in_replicas.0.fixed` or `autoscaling_policy.0.scale_in_control.0.max_scaled_in_replicas.0.percent` is required](#at-least-one-of-autoscaling_policy0scale_in_control0max_scaled_in_replicas0fixed-or-autoscaling_policy0scale_in_control0max_scaled_in_replicas0percent-is-required-1)
3737
- [Resource: `google_compute_firewall`](#resource-google_compute_firewall)
3838
- [One of `source_tags`, `source_ranges` or `source_service_accounts` are required on INGRESS firewalls](#one-of-source_tags-source_ranges-or-source_service_accounts-are-required-on-ingress-firewalls)
39+
- [Resource: `google_compute_instance`](#resource-google_compute_instance)
40+
- [`metadata_startup_script` is no longer set on import](#metadata_startup_script-is-no-longer-set-on-import)
3941
- [Resource: `google_compute_instance_group_manager`](#resource-google_compute_instance_group_manager)
4042
- [`update_policy.min_ready_sec` is removed from the GA provider](#update_policymin_ready_sec-is-removed-from-the-ga-provider)
4143
- [Resource: `google_compute_region_instance_group_manager`](#resource-google_compute_region_instance_group_manager)
4244
- [`update_policy.min_ready_sec` is removed from the GA provider](#update_policymin_ready_sec-is-removed-from-the-ga-provider-1)
4345
- [Resource: `google_compute_instance_template`](#resource-google_compute_instance_template)
4446
- [`enable_display` is removed from the GA provider](#enable_display-is-removed-from-the-ga-provider)
47+
- [Resource: `google_compute_url_map`](#resource-google_compute_url_map)
48+
- [At least one of `default_route_action.0.fault_injection_policy.0.delay.0.fixed_delay` or `default_route_action.0.fault_injection_policy.0.delay.0.percentage` is required](#at-least-one-of-default_route_action0fault_injection_policy0delay0fixed_delay-or-default_route_action0fault_injection_policy0delay0percentage-is-required)
49+
- [Resource: `google_container_cluster`](#resource-google_container_cluster)
50+
- [`enable_shielded_nodes` now defaults to `true`](#enable_shielded_nodes-now-defaults-to-true)
51+
- [`instance_group_urls` is now removed](#instance_group_urls-is-now-removed)
52+
- [`master_auth` is now removed](#master_auth-is-now-removed)
53+
- [`node_config.workload_metadata_config.node_metadata` is now removed](#node_configworkload_metadata_confignode_metadata-is-now-removed)
54+
- [`workload_identity_config.0.identity_namespace` is now removed](#workload_identity_config0identity_namespace-is-now-removed)
55+
- [`pod_security_policy_config` is removed from the GA provider](#pod_security_policy_config-is-removed-from-the-ga-provider)
56+
- [Resource: `google_data_loss_prevention_trigger`](#resource-google_data_loss_prevention_trigger)
57+
- [Exactly one of `inspect_job.0.storage_config.0.cloud_storage_options.0.file_set.0.url` or `inspect_job.0.storage_config.0.cloud_storage_options.0.file_set.0.regex_file_set` is required](#exactly-one-of-inspect_job0storage_config0cloud_storage_options0file_set0url-or-inspect_job0storage_config0cloud_storage_options0file_set0regex_file_set-is-required)
58+
- [At least one of `inspect_job.0.storage_config.0.timespan_config.0.start_time` or `inspect_job.0.storage_config.0.timespan_config.0.end_time` is required](#at-least-one-of-inspect_job0storage_config0timespan_config0start_time-or-inspect_job0storage_config0timespan_config0end_time-is-required)
59+
- [Resource: `google_os_config_patch_deployment`](#resource-google_os_config_patch_deployment)
60+
- [At least one of `patch_config.0.reboot_config`, `patch_config.0.apt`, `patch_config.0.yum`, `patch_config.0.goo` `patch_config.0.zypper`, `patch_config.0.windows_update`, `patch_config.0.pre_step` or `patch_config.0.pre_step` is required](#at-least-one-of-patch_config0reboot_config-patch_config0apt-patch_config0yum-patch_config0goo-patch_config0zypper-patch_config0windows_update-patch_config0pre_step-or-patch_config0pre_step-is-required)
61+
- [At least one of `patch_config.0.apt.0.type`, `patch_config.0.apt.0.excludes` or `patch_config.0.apt.0.exclusive_packages` is required](#at-least-one-of-patch_config0apt0type-patch_config0apt0excludes-or-patch_config0apt0exclusive_packages-is-required)
62+
- [At least one of `patch_config.0.yum.0.security`, `patch_config.0.yum.0.minimal`, `patch_config.0.yum.0.excludes` or `patch_config.0.yum.0.exclusive_packages` is required](#at-least-one-of-patch_config0yum0security-patch_config0yum0minimal-patch_config0yum0excludes-or-patch_config0yum0exclusive_packages-is-required)
63+
- [At least one of `patch_config.0.zypper.0.with_optional`, `patch_config.0.zypper.0.with_update`, `patch_config.0.zypper.0.categories`, `patch_config.0.zypper.0.severities`, `patch_config.0.zypper.0.excludes` or `patch_config.0.zypper.0.exclusive_patches` is required](#at-least-one-of-patch_config0zypper0with_optional-patch_config0zypper0with_update-patch_config0zypper0categories-patch_config0zypper0severities-patch_config0zypper0excludes-or-patch_config0zypper0exclusive_patches-is-required)
64+
- [Exactly one of `patch_config.0.windows_update.0.classifications`, `patch_config.0.windows_update.0.excludes` or `patch_config.0.windows_update.0.exclusive_patches` is required](#exactly-one-of-patch_config0windows_update0classifications-patch_config0windows_update0excludes-or-patch_config0windows_update0exclusive_patches-is-required)
65+
- [At least one of `patch_config.0.pre_step.0.linux_exec_step_config` or `patch_config.0.pre_step.0.windows_exec_step_config` is required](#at-least-one-of-patch_config0pre_step0linux_exec_step_config-or-patch_config0pre_step0windows_exec_step_config-is-required)
66+
- [At least one of `patch_config.0.post_step.0.linux_exec_step_config` or `patch_config.0.post_step.0.windows_exec_step_config` is required](#at-least-one-of-patch_config0post_step0linux_exec_step_config-or-patch_config0post_step0windows_exec_step_config-is-required)
67+
- [Resource: `google_project`](#resource-google_project)
68+
- [`org_id`, `folder_id` now conflict at plan time](#org_id-folder_id-now-conflict-at-plan-time)
69+
- [`org_id`, `folder_id` are unset when removed from config](#org_id-folder_id-are-unset-when-removed-from-config)
70+
- [Resource: `google_project_iam`](#resource-google_project_iam)
71+
- [`project` field is now required](#project-field-is-now-required)
72+
- [Resource: `google_project_service`](#resource-google_project_service)
73+
- [`bigquery-json.googleapis.com` is no longer a valid service name](#bigquery-jsongoogleapiscom-is-no-longer-a-valid-service-name)
74+
- [Resource: `google_spanner_instance`](#resource-google_spanner_instance)
75+
- [Exactly one of `num_nodes` or `processing_units` is required](#exactly-one-of-num_nodes-or-processing_units-is-required)
76+
- [Resource: `google_storage_bucket`](#resource-google_storage_bucket)
77+
- [`bucket_policy_only` field is now removed](#bucket_policy_only-field-is-now-removed)
78+
- [`location` field is now required.](#location-field-is-now-required)
79+
- [Resource: `google_sql_database_instance`](#resource-google_sql_database_instance)
80+
- [`database_version` field is now required](#database_version-field-is-now-required)
81+
- [Previously, it was an optional field and the default value was `MYSQL_5_6`.](#previously-it-was-an-optional-field-and-the-default-value-was-mysql_5_6)
82+
- [>>>>>>> Default `enable_shielded_nodes` to true](#-default-enable_shielded_nodes-to-true)
83+
<<<<<<< HEAD
4584
- [Resource: `google_compute_url_map`](#resource-google_compute_url_map)
4685
- [At least one of `default_route_action.0.fault_injection_policy.0.delay.0.fixed_delay` or `default_route_action.0.fault_injection_policy.0.delay.0.percentage` is required](#at-least-one-of-default_route_action0fault_injection_policy0delay0fixed_delay-or-default_route_action0fault_injection_policy0delay0percentage-is-required)
4786
- [Resource: `google_container_cluster`](#resource-google_container_cluster)
@@ -75,6 +114,13 @@ description: |-
75114
- [`location` is now required](#location-is-now-required)
76115
- [Resource: `google_sql_database_instance`](#resource-google_sql_database_instance)
77116
- [`database_version` field is now required](#database_version-field-is-now-required)
117+
=======
118+
- [Resource: `google_container_cluster`](#resource-google_container_cluster)
119+
- [`enable_shielded_nodes` now defaults to `true`](#enable_shielded_nodes-now-defaults-to-true)
120+
- [`node_config.workload_metadata_config.node_metadata` is now removed](#node_configworkload_metadata_confignode_metadata-is-now-removed)
121+
- [`workload_identity_config.0.identity_namespace` is now removed](#workload_identity_config0identity_namespace-is-now-removed)
122+
- [`pod_security_policy_config` is removed from the GA provider](#pod_security_policy_config-is-removed-from-the-ga-provider)
123+
>>>>>>> Default `enable_shielded_nodes` to true
78124
79125
<!-- /TOC -->
80126

@@ -352,6 +398,11 @@ The provider will now enforce at plan time that one of these fields be set.
352398

353399
## Resource: `google_container_cluster`
354400

401+
### `enable_shielded_nodes` now defaults to `true`
402+
403+
Previously the provider defaulted `enable_shielded_nodes` to false, despite the API default of `true`.
404+
Unless explicitly configured, users may see a diff changing `enable_shielded_nodes` to `true`.
405+
355406
### `instance_group_urls` is now removed
356407

357408
`instance_group_urls` has been removed in favor of `node_pool.instance_group_urls`
@@ -388,6 +439,8 @@ resource "google_container_cluster" "cluster" {
388439
This field was incorrectly included in the GA `google` provider in past releases.
389440
In order to continue to use the feature, add `provider = google-beta` to your
390441
resource definition.
442+
<<<<<<< HEAD
443+
<<<<<<< HEAD
391444

392445
## Resource: `google_data_loss_prevention_trigger`
393446

@@ -478,3 +531,8 @@ conbination of `storageClass` value and default `location` value, `location` fie
478531

479532
The `database_version` field is now required.
480533
Previously, it was an optional field and the default value was `MYSQL_5_6`.
534+
=======
535+
Description of the change and how users should adjust their configuration (if needed).
536+
>>>>>>> Default `enable_shielded_nodes` to true
537+
=======
538+
>>>>>>> remove added line

website/docs/r/container_cluster.html.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ for more information.
161161
will have statically granted permissions beyond those provided by the RBAC configuration or IAM.
162162
Defaults to `false`
163163

164-
* `enable_shielded_nodes` - (Optional) Enable Shielded Nodes features on all nodes in this cluster. Defaults to `false`.
164+
* `enable_shielded_nodes` - (Optional) Enable Shielded Nodes features on all nodes in this cluster. Defaults to `true`.
165165

166166
* `enable_autopilot` - (Optional) Enable Autopilot for this cluster. Defaults to `false`.
167167
Note that when this option is enabled, certain features of Standard GKE are not available.

0 commit comments

Comments
 (0)