Skip to content

Commit ced087c

Browse files
Add default_if_empty flattener to stack_type (#7718) (#14311)
Signed-off-by: Modular Magician <[email protected]>
1 parent fd836e5 commit ced087c

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.changelog/7718.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
compute: fixed a diff that occurred when `stack_type` was unset on `google_compute_ha_vpn_gateway`
3+
```

google/resource_compute_ha_vpn_gateway.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ character, which cannot be a dash.`,
7878
Optional: true,
7979
ForceNew: true,
8080
ValidateFunc: validateEnum([]string{"IPV4_ONLY", "IPV4_IPV6", ""}),
81-
Description: `The stack type for this VPN gateway to identify the IP protocols that are enbaled.
81+
Description: `The stack type for this VPN gateway to identify the IP protocols that are enabled.
8282
If not specified, IPV4_ONLY will be used. Default value: "IPV4_ONLY" Possible values: ["IPV4_ONLY", "IPV4_IPV6"]`,
8383
Default: "IPV4_ONLY",
8484
},
@@ -364,6 +364,10 @@ func flattenComputeHaVpnGatewayNetwork(v interface{}, d *schema.ResourceData, co
364364
}
365365

366366
func flattenComputeHaVpnGatewayStackType(v interface{}, d *schema.ResourceData, config *Config) interface{} {
367+
if v == nil || isEmptyValue(reflect.ValueOf(v)) {
368+
return "IPV4_ONLY"
369+
}
370+
367371
return v
368372
}
369373

website/docs/r/compute_ha_vpn_gateway.html.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ The following arguments are supported:
173173

174174
* `stack_type` -
175175
(Optional)
176-
The stack type for this VPN gateway to identify the IP protocols that are enbaled.
176+
The stack type for this VPN gateway to identify the IP protocols that are enabled.
177177
If not specified, IPV4_ONLY will be used.
178178
Default value is `IPV4_ONLY`.
179179
Possible values are: `IPV4_ONLY`, `IPV4_IPV6`.

0 commit comments

Comments
 (0)