Skip to content

Commit

Permalink
Promote PC to GA (#9510) (#16613)
Browse files Browse the repository at this point in the history
[upstream:2961b6855c799fc8fa2a31c2f4849aeb6c6b279a]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Nov 28, 2023
1 parent 331733a commit 23234b6
Show file tree
Hide file tree
Showing 8 changed files with 1,313 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .changelog/9510.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
vmwareengine: promoted `google_vmwareengine_private_cloud` resource to GA
```
7 changes: 5 additions & 2 deletions google/provider/provider_mmv1_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ var handwrittenDatasources = map[string]*schema.Resource{
"google_redis_instance": redis.DataSourceGoogleRedisInstance(),
"google_vertex_ai_index": vertexai.DataSourceVertexAIIndex(),
"google_vmwareengine_network": vmwareengine.DataSourceVmwareengineNetwork(),
"google_vmwareengine_private_cloud": vmwareengine.DataSourceVmwareenginePrivateCloud(),

// ####### END handwritten datasources ###########
}

Expand Down Expand Up @@ -356,9 +358,9 @@ var handwrittenIAMDatasources = map[string]*schema.Resource{
}

// Resources
// Generated resources: 342
// Generated resources: 343
// Generated IAM resources: 213
// Total generated resources: 555
// Total generated resources: 556
var generatedResources = map[string]*schema.Resource{
"google_folder_access_approval_settings": accessapproval.ResourceAccessApprovalFolderSettings(),
"google_organization_access_approval_settings": accessapproval.ResourceAccessApprovalOrganizationSettings(),
Expand Down Expand Up @@ -895,6 +897,7 @@ var generatedResources = map[string]*schema.Resource{
"google_vertex_ai_index_endpoint": vertexai.ResourceVertexAIIndexEndpoint(),
"google_vertex_ai_tensorboard": vertexai.ResourceVertexAITensorboard(),
"google_vmwareengine_network": vmwareengine.ResourceVmwareengineNetwork(),
"google_vmwareengine_private_cloud": vmwareengine.ResourceVmwareenginePrivateCloud(),
"google_vpc_access_connector": vpcaccess.ResourceVPCAccessConnector(),
"google_workflows_workflow": workflows.ResourceWorkflowsWorkflow(),
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package vmwareengine

import (
"fmt"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-google/google/tpgresource"
transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport"
)

func DataSourceVmwareenginePrivateCloud() *schema.Resource {

dsSchema := tpgresource.DatasourceSchemaFromResourceSchema(ResourceVmwareenginePrivateCloud().Schema)
tpgresource.AddRequiredFieldsToSchema(dsSchema, "name", "location")
tpgresource.AddOptionalFieldsToSchema(dsSchema, "project")
return &schema.Resource{
Read: dataSourceVmwareenginePrivateCloudRead,
Schema: dsSchema,
}
}

func dataSourceVmwareenginePrivateCloudRead(d *schema.ResourceData, meta interface{}) error {
config := meta.(*transport_tpg.Config)

// Store the ID now
id, err := tpgresource.ReplaceVars(d, config, "projects/{{project}}/locations/{{location}}/privateClouds/{{name}}")
if err != nil {
return fmt.Errorf("Error constructing id: %s", err)
}
d.SetId(id)
err = resourceVmwareenginePrivateCloudRead(d, meta)
if err != nil {
return err
}

if d.Id() == "" {
return fmt.Errorf("%s not found", id)
}
return nil
}
Loading

0 comments on commit 23234b6

Please sign in to comment.