Skip to content

Commit

Permalink
Add default_if_empty flattener to stack_type (#7718) (#5479)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Apr 13, 2023
1 parent f1ac236 commit 4e35cdb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/7718.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
compute: fixed a diff that occurred when `stack_type` was unset on `google_compute_ha_vpn_gateway`
```
6 changes: 5 additions & 1 deletion google-beta/resource_compute_ha_vpn_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ character, which cannot be a dash.`,
Optional: true,
ForceNew: true,
ValidateFunc: validateEnum([]string{"IPV4_ONLY", "IPV4_IPV6", ""}),
Description: `The stack type for this VPN gateway to identify the IP protocols that are enbaled.
Description: `The stack type for this VPN gateway to identify the IP protocols that are enabled.
If not specified, IPV4_ONLY will be used. Default value: "IPV4_ONLY" Possible values: ["IPV4_ONLY", "IPV4_IPV6"]`,
Default: "IPV4_ONLY",
},
Expand Down Expand Up @@ -364,6 +364,10 @@ func flattenComputeHaVpnGatewayNetwork(v interface{}, d *schema.ResourceData, co
}

func flattenComputeHaVpnGatewayStackType(v interface{}, d *schema.ResourceData, config *Config) interface{} {
if v == nil || isEmptyValue(reflect.ValueOf(v)) {
return "IPV4_ONLY"
}

return v
}

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/compute_ha_vpn_gateway.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ The following arguments are supported:

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

0 comments on commit 4e35cdb

Please sign in to comment.