Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default value from PC type #6911

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/9870.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
vmwareengine: fixed a bug to prevent recreation of existing PCs when upgrading provider version from <5.10.0
```
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ import (
"github.com/hashicorp/terraform-provider-google-beta/google-beta/verify"
)

func vmwareenginePrivateCloudStandardTypeDiffSuppressFunc(_, old, new string, _ *schema.ResourceData) bool {
if (old == "STANDARD" && new == "") || (old == "" && new == "STANDARD") {
return true
}
return false
}

func ResourceVmwareenginePrivateCloud() *schema.Resource {
return &schema.Resource{
Create: resourceVmwareenginePrivateCloudCreate,
Expand Down Expand Up @@ -164,12 +171,12 @@ the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{v
Description: `User-provided description for this private cloud.`,
},
"type": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: verify.ValidateEnum([]string{"STANDARD", "TIME_LIMITED", ""}),
Description: `Initial type of the private cloud. Default value: "STANDARD" Possible values: ["STANDARD", "TIME_LIMITED"]`,
Default: "STANDARD",
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: verify.ValidateEnum([]string{"STANDARD", "TIME_LIMITED", ""}),
DiffSuppressFunc: vmwareenginePrivateCloudStandardTypeDiffSuppressFunc,
Description: `Initial type of the private cloud. Possible values: ["STANDARD", "TIME_LIMITED"]`,
},
"hcx": {
Type: schema.TypeList,
Expand Down
1 change: 0 additions & 1 deletion website/docs/r/vmwareengine_private_cloud.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ The following arguments are supported:
* `type` -
(Optional)
Initial type of the private cloud.
Default value is `STANDARD`.
Possible values are: `STANDARD`, `TIME_LIMITED`.

* `project` - (Optional) The ID of the project in which the resource belongs.
Expand Down
Loading