Skip to content

Commit afcd2ce

Browse files
Cloud Workstations - Workstation Cluster (#7005) (#5154)
Closes hashicorp/terraform-provider-google#12763 Signed-off-by: Modular Magician <[email protected]>
1 parent d00555f commit afcd2ce

10 files changed

+1442
-2
lines changed

.changelog/7005.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_workstations_workstation_cluster
3+
```

google-beta/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ type Config struct {
267267
VertexAIBasePath string
268268
VPCAccessBasePath string
269269
WorkflowsBasePath string
270+
WorkstationsBasePath string
270271

271272
CloudBillingBasePath string
272273
ComposerBasePath string
@@ -383,6 +384,7 @@ const TPUBasePathKey = "TPU"
383384
const VertexAIBasePathKey = "VertexAI"
384385
const VPCAccessBasePathKey = "VPCAccess"
385386
const WorkflowsBasePathKey = "Workflows"
387+
const WorkstationsBasePathKey = "Workstations"
386388
const CloudBillingBasePathKey = "CloudBilling"
387389
const ComposerBasePathKey = "Composer"
388390
const ContainerBasePathKey = "Container"
@@ -493,6 +495,7 @@ var DefaultBasePaths = map[string]string{
493495
VertexAIBasePathKey: "https://{{region}}-aiplatform.googleapis.com/v1beta1/",
494496
VPCAccessBasePathKey: "https://vpcaccess.googleapis.com/v1beta1/",
495497
WorkflowsBasePathKey: "https://workflows.googleapis.com/v1beta/",
498+
WorkstationsBasePathKey: "https://workstations.googleapis.com/v1beta/",
496499
CloudBillingBasePathKey: "https://cloudbilling.googleapis.com/v1/",
497500
ComposerBasePathKey: "https://composer.googleapis.com/v1beta1/",
498501
ContainerBasePathKey: "https://container.googleapis.com/v1beta1/",
@@ -1379,6 +1382,7 @@ func ConfigureBasePaths(c *Config) {
13791382
c.VertexAIBasePath = DefaultBasePaths[VertexAIBasePathKey]
13801383
c.VPCAccessBasePath = DefaultBasePaths[VPCAccessBasePathKey]
13811384
c.WorkflowsBasePath = DefaultBasePaths[WorkflowsBasePathKey]
1385+
c.WorkstationsBasePath = DefaultBasePaths[WorkstationsBasePathKey]
13821386

13831387
// Handwritten Products / Versioned / Atypical Entries
13841388
c.CloudBillingBasePath = DefaultBasePaths[CloudBillingBasePathKey]

google-beta/config_test_utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ func configureTestBasePaths(c *Config, url string) {
113113
c.VertexAIBasePath = url
114114
c.VPCAccessBasePath = url
115115
c.WorkflowsBasePath = url
116+
c.WorkstationsBasePath = url
116117

117118
// Handwritten Products / Versioned / Atypical Entries
118119
c.CloudBillingBasePath = url

google-beta/provider.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,14 @@ func Provider() *schema.Provider {
909909
"GOOGLE_WORKFLOWS_CUSTOM_ENDPOINT",
910910
}, DefaultBasePaths[WorkflowsBasePathKey]),
911911
},
912+
"workstations_custom_endpoint": {
913+
Type: schema.TypeString,
914+
Optional: true,
915+
ValidateFunc: validateCustomEndpoint,
916+
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
917+
"GOOGLE_WORKSTATIONS_CUSTOM_ENDPOINT",
918+
}, DefaultBasePaths[WorkstationsBasePathKey]),
919+
},
912920

913921
// Handwritten Products / Versioned / Atypical Entries
914922
CloudBillingCustomEndpointEntryKey: CloudBillingCustomEndpointEntry,
@@ -1089,9 +1097,9 @@ func Provider() *schema.Provider {
10891097
return provider
10901098
}
10911099

1092-
// Generated resources: 297
1100+
// Generated resources: 298
10931101
// Generated IAM resources: 201
1094-
// Total generated resources: 498
1102+
// Total generated resources: 499
10951103
func ResourceMap() map[string]*schema.Resource {
10961104
resourceMap, _ := ResourceMapWithErrors()
10971105
return resourceMap
@@ -1598,6 +1606,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
15981606
"google_vertex_ai_index": resourceVertexAIIndex(),
15991607
"google_vpc_access_connector": resourceVPCAccessConnector(),
16001608
"google_workflows_workflow": resourceWorkflowsWorkflow(),
1609+
"google_workstations_workstation_cluster": resourceWorkstationsWorkstationCluster(),
16011610
},
16021611
map[string]*schema.Resource{
16031612
// ####### START handwritten resources ###########
@@ -1924,6 +1933,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
19241933
config.VertexAIBasePath = d.Get("vertex_ai_custom_endpoint").(string)
19251934
config.VPCAccessBasePath = d.Get("vpc_access_custom_endpoint").(string)
19261935
config.WorkflowsBasePath = d.Get("workflows_custom_endpoint").(string)
1936+
config.WorkstationsBasePath = d.Get("workstations_custom_endpoint").(string)
19271937

19281938
// Handwritten Products / Versioned / Atypical Entries
19291939
config.CloudBillingBasePath = d.Get(CloudBillingCustomEndpointEntryKey).(string)

0 commit comments

Comments
 (0)