Skip to content

Commit 276dc76

Browse files
Add resource for Cluster Director (hypercomputecluster.googleapis.com) Cluster resource (#16274) (#11596)
[upstream:a236770c1538bbe367b6e39f1dcd83f096179dbd] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 20f65c9 commit 276dc76

15 files changed

+6038
-2
lines changed

.changelog/16274.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
`google_hypercomputecluster_cluster`
3+
```

google-beta/fwmodels/provider_model.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ type ProviderModel struct {
143143
GKEHub2CustomEndpoint types.String `tfsdk:"gke_hub2_custom_endpoint"`
144144
GkeonpremCustomEndpoint types.String `tfsdk:"gkeonprem_custom_endpoint"`
145145
HealthcareCustomEndpoint types.String `tfsdk:"healthcare_custom_endpoint"`
146+
HypercomputeclusterCustomEndpoint types.String `tfsdk:"hypercomputecluster_custom_endpoint"`
146147
IAM2CustomEndpoint types.String `tfsdk:"iam2_custom_endpoint"`
147148
IAM3CustomEndpoint types.String `tfsdk:"iam3_custom_endpoint"`
148149
IAMBetaCustomEndpoint types.String `tfsdk:"iam_beta_custom_endpoint"`

google-beta/fwprovider/framework_provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
725725
transport_tpg.CustomEndpointValidator(),
726726
},
727727
},
728+
"hypercomputecluster_custom_endpoint": &schema.StringAttribute{
729+
Optional: true,
730+
Validators: []validator.String{
731+
transport_tpg.CustomEndpointValidator(),
732+
},
733+
},
728734
"iam2_custom_endpoint": &schema.StringAttribute{
729735
Optional: true,
730736
Validators: []validator.String{

google-beta/provider/provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,11 @@ func Provider() *schema.Provider {
643643
Optional: true,
644644
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
645645
},
646+
"hypercomputecluster_custom_endpoint": {
647+
Type: schema.TypeString,
648+
Optional: true,
649+
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
650+
},
646651
"iam2_custom_endpoint": {
647652
Type: schema.TypeString,
648653
Optional: true,
@@ -1324,6 +1329,7 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
13241329
config.GKEHub2BasePath = d.Get("gke_hub2_custom_endpoint").(string)
13251330
config.GkeonpremBasePath = d.Get("gkeonprem_custom_endpoint").(string)
13261331
config.HealthcareBasePath = d.Get("healthcare_custom_endpoint").(string)
1332+
config.HypercomputeclusterBasePath = d.Get("hypercomputecluster_custom_endpoint").(string)
13271333
config.IAM2BasePath = d.Get("iam2_custom_endpoint").(string)
13281334
config.IAM3BasePath = d.Get("iam3_custom_endpoint").(string)
13291335
config.IAMBetaBasePath = d.Get("iam_beta_custom_endpoint").(string)

google-beta/provider/provider_mmv1_resources.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ import (
108108
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/gkehub2"
109109
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/gkeonprem"
110110
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/healthcare"
111+
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/hypercomputecluster"
111112
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/iam2"
112113
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/iam3"
113114
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/iambeta"
@@ -645,9 +646,9 @@ var handwrittenIAMDatasources = map[string]*schema.Resource{
645646
}
646647

647648
// Resources
648-
// Generated resources: 787
649+
// Generated resources: 788
649650
// Generated IAM resources: 357
650-
// Total generated resources: 1144
651+
// Total generated resources: 1145
651652
var generatedResources = map[string]*schema.Resource{
652653
"google_folder_access_approval_settings": registry.Resource("google_folder_access_approval_settings"),
653654
"google_organization_access_approval_settings": registry.Resource("google_organization_access_approval_settings"),
@@ -1341,6 +1342,7 @@ var generatedResources = map[string]*schema.Resource{
13411342
"google_healthcare_hl7_v2_store": registry.Resource("google_healthcare_hl7_v2_store"),
13421343
"google_healthcare_pipeline_job": registry.Resource("google_healthcare_pipeline_job"),
13431344
"google_healthcare_workspace": registry.Resource("google_healthcare_workspace"),
1345+
"google_hypercomputecluster_cluster": registry.Resource("google_hypercomputecluster_cluster"),
13441346
"google_iam_access_boundary_policy": registry.Resource("google_iam_access_boundary_policy"),
13451347
"google_iam_deny_policy": registry.Resource("google_iam_deny_policy"),
13461348
"google_iam_folders_policy_binding": registry.Resource("google_iam_folders_policy_binding"),
@@ -2055,6 +2057,7 @@ func UseGeneratedProducts() {
20552057
var _ = gkehub2.ProductName
20562058
var _ = gkeonprem.ProductName
20572059
var _ = healthcare.ProductName
2060+
var _ = hypercomputecluster.ProductName
20582061
var _ = iam2.ProductName
20592062
var _ = iam3.ProductName
20602063
var _ = iambeta.ProductName
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
// ----------------------------------------------------------------------------
5+
//
6+
// *** AUTO GENERATED CODE *** Type: MMv1 ***
7+
//
8+
// ----------------------------------------------------------------------------
9+
//
10+
// This file is automatically generated by Magic Modules and manual
11+
// changes will be clobbered when the file is regenerated.
12+
//
13+
// Please read more about how to change this file in
14+
// .github/CONTRIBUTING.md.
15+
//
16+
// ----------------------------------------------------------------------------
17+
18+
package hypercomputecluster
19+
20+
import (
21+
"encoding/json"
22+
"errors"
23+
"fmt"
24+
"log"
25+
"strings"
26+
"time"
27+
28+
"github.com/hashicorp/terraform-provider-google-beta/google-beta/tpgresource"
29+
transport_tpg "github.com/hashicorp/terraform-provider-google-beta/google-beta/transport"
30+
31+
"google.golang.org/api/googleapi"
32+
)
33+
34+
var (
35+
_ = json.Marshal
36+
_ = errors.New
37+
_ = fmt.Sprintf
38+
_ = log.Print
39+
_ = strings.Trim
40+
_ = time.Now
41+
_ = tpgresource.SetLabels
42+
_ = transport_tpg.Config{}
43+
_ = googleapi.Error{}
44+
)
45+
46+
type HypercomputeclusterOperationWaiter struct {
47+
Config *transport_tpg.Config
48+
UserAgent string
49+
Project string
50+
tpgresource.CommonOperationWaiter
51+
}
52+
53+
func (w *HypercomputeclusterOperationWaiter) QueryOp() (interface{}, error) {
54+
if w == nil {
55+
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.")
56+
}
57+
// Returns the proper get.
58+
url := fmt.Sprintf("%s%s", w.Config.HypercomputeclusterBasePath, w.CommonOperationWaiter.Op.Name)
59+
60+
return transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
61+
Config: w.Config,
62+
Method: "GET",
63+
Project: w.Project,
64+
RawURL: url,
65+
UserAgent: w.UserAgent,
66+
})
67+
}
68+
69+
func createHypercomputeclusterWaiter(config *transport_tpg.Config, op map[string]interface{}, project, activity, userAgent string) (*HypercomputeclusterOperationWaiter, error) {
70+
w := &HypercomputeclusterOperationWaiter{
71+
Config: config,
72+
UserAgent: userAgent,
73+
Project: project,
74+
}
75+
if err := w.CommonOperationWaiter.SetOp(op); err != nil {
76+
return nil, err
77+
}
78+
return w, nil
79+
}
80+
81+
// nolint: deadcode,unused
82+
func HypercomputeclusterOperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
83+
w, err := createHypercomputeclusterWaiter(config, op, project, activity, userAgent)
84+
if err != nil {
85+
return err
86+
}
87+
if err := tpgresource.OperationWait(w, activity, timeout, config.PollInterval); err != nil {
88+
return err
89+
}
90+
rawResponse := []byte(w.CommonOperationWaiter.Op.Response)
91+
if len(rawResponse) == 0 {
92+
return errors.New("`resource` not set in operation response")
93+
}
94+
return json.Unmarshal(rawResponse, response)
95+
}
96+
97+
func HypercomputeclusterOperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
98+
if val, ok := op["name"]; !ok || val == "" {
99+
// This was a synchronous call - there is no operation to wait for.
100+
return nil
101+
}
102+
w, err := createHypercomputeclusterWaiter(config, op, project, activity, userAgent)
103+
if err != nil {
104+
// If w is nil, the op was synchronous.
105+
return err
106+
}
107+
return tpgresource.OperationWait(w, activity, timeout, config.PollInterval)
108+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
// ----------------------------------------------------------------------------
5+
//
6+
// *** AUTO GENERATED CODE *** Type: MMv1 ***
7+
//
8+
// ----------------------------------------------------------------------------
9+
//
10+
// This file is automatically generated by Magic Modules and manual
11+
// changes will be clobbered when the file is regenerated.
12+
//
13+
// Please read more about how to change this file in
14+
// .github/CONTRIBUTING.md.
15+
//
16+
// ----------------------------------------------------------------------------
17+
18+
// Package hypercomputecluster contains resources, datasources, etc. for the cluster director service.
19+
package hypercomputecluster
20+
21+
import (
22+
"github.com/hashicorp/terraform-provider-google-beta/google-beta/registry"
23+
)
24+
25+
const ProductName = "hypercomputecluster"
26+
27+
func init() {
28+
registry.Product{
29+
Name: "hypercomputecluster",
30+
BaseUrl: "https://hypercomputecluster.googleapis.com/v1beta/",
31+
}.Register()
32+
}

0 commit comments

Comments
 (0)