Skip to content

Commit

Permalink
Remove default value from PC type (#9870) (#6911)
Browse files Browse the repository at this point in the history
* Remove default value from PC type

* Update mmv1/templates/terraform/constants/vmwareengine_private_cloud_type.go.erb

---------



[upstream:8d62a4eac966f4a4e23cfcba00f250eb44722036]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jan 30, 2024
1 parent 173655a commit 276e291
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
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

0 comments on commit 276e291

Please sign in to comment.