Skip to content

Commit 1a37ef6

Browse files
Add Computed to snat, mark sub-field Required (#3765) (#2295)
Signed-off-by: Modular Magician <[email protected]>
1 parent c68e1ad commit 1a37ef6

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

.changelog/3765.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/resource_container_cluster.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,12 +1080,13 @@ func resourceContainerCluster() *schema.Resource {
10801080
Type: schema.TypeList,
10811081
MaxItems: 1,
10821082
Optional: true,
1083+
Computed: true,
10831084
Description: `Whether the cluster disables default in-node sNAT rules. In-node sNAT rules will be disabled when defaultSnatStatus is disabled.`,
10841085
Elem: &schema.Resource{
10851086
Schema: map[string]*schema.Schema{
10861087
"disabled": {
10871088
Type: schema.TypeBool,
1088-
Optional: true,
1089+
Required: true,
10891090
Description: `When disabled is set to false, default IP masquerade rules will be applied to the nodes to prevent sNAT on cluster internal traffic.`,
10901091
},
10911092
},

google-beta/resource_container_cluster_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3492,11 +3492,9 @@ resource "google_container_cluster" "with_private_cluster" {
34923492
enable_private_endpoint = true
34933493
enable_private_nodes = true
34943494
}
3495-
default_snat_status{
3496-
disabled = false
3497-
}
3498-
master_authorized_networks_config {
3499-
}
3495+
3496+
master_authorized_networks_config {}
3497+
35003498
ip_allocation_policy {
35013499
cluster_secondary_range_name = google_compute_subnetwork.container_subnetwork.secondary_ip_range[0].range_name
35023500
services_secondary_range_name = google_compute_subnetwork.container_subnetwork.secondary_ip_range[1].range_name

website/docs/r/container_cluster.html.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ subnetwork in which the cluster's instances are launched.
320320
[GKE SNAT](https://cloud.google.com/kubernetes-engine/docs/how-to/ip-masquerade-agent#how_ipmasq_works) DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, [API doc](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#networkconfig).
321321

322322
The `default_snat_status` block supports
323-
* `disabled` - Whether the cluster disables default in-node sNAT rules. In-node sNAT rules will be disabled when defaultSnatStatus is disabled.When disabled is set to false, default IP masquerade rules will be applied to the nodes to prevent sNAT on cluster internal traffic
323+
324+
* `disabled` - (Required) Whether the cluster disables default in-node sNAT rules. In-node sNAT rules will be disabled when defaultSnatStatus is disabled.When disabled is set to false, default IP masquerade rules will be applied to the nodes to prevent sNAT on cluster internal traffic
324325

325326
The `cluster_telemetry` block supports
326327
* `type` - Telemetry integration for the cluster. Supported values (`ENABLE, DISABLE, SYSTEM_ONLY`);

0 commit comments

Comments
 (0)