Skip to content

Commit 1ed5f94

Browse files
authored
Add dataproc autoscaling policy resource
2 parents 24c3610 + a149685 commit 1ed5f94

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

google/config.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ type Config struct {
7878
CloudBuildBasePath string
7979
CloudSchedulerBasePath string
8080
ComputeBasePath string
81+
DataprocBasePath string
8182
DnsBasePath string
8283
FilestoreBasePath string
8384
FirestoreBasePath string
@@ -114,8 +115,7 @@ type Config struct {
114115
ContainerBetaBasePath string
115116
clientContainerBeta *containerBeta.Service
116117

117-
DataprocBasePath string
118-
clientDataproc *dataproc.Service
118+
clientDataproc *dataproc.Service
119119

120120
DataprocBetaBasePath string
121121
clientDataprocBeta *dataprocBeta.Service
@@ -203,6 +203,7 @@ var BinaryAuthorizationDefaultBasePath = "https://binaryauthorization.googleapis
203203
var CloudBuildDefaultBasePath = "https://cloudbuild.googleapis.com/v1/"
204204
var CloudSchedulerDefaultBasePath = "https://cloudscheduler.googleapis.com/v1/"
205205
var ComputeDefaultBasePath = "https://www.googleapis.com/compute/v1/"
206+
var DataprocDefaultBasePath = "https://dataproc.googleapis.com/v1/"
206207
var DnsDefaultBasePath = "https://www.googleapis.com/dns/v1/"
207208
var FilestoreDefaultBasePath = "https://file.googleapis.com/v1/"
208209
var FirestoreDefaultBasePath = "https://firestore.googleapis.com/v1/"
@@ -664,6 +665,7 @@ func ConfigureBasePaths(c *Config) {
664665
c.CloudBuildBasePath = CloudBuildDefaultBasePath
665666
c.CloudSchedulerBasePath = CloudSchedulerDefaultBasePath
666667
c.ComputeBasePath = ComputeDefaultBasePath
668+
c.DataprocBasePath = DataprocDefaultBasePath
667669
c.DnsBasePath = DnsDefaultBasePath
668670
c.FilestoreBasePath = FilestoreDefaultBasePath
669671
c.FirestoreBasePath = FirestoreDefaultBasePath

google/provider.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@ func Provider() terraform.ResourceProvider {
175175
"GOOGLE_COMPUTE_CUSTOM_ENDPOINT",
176176
}, ComputeDefaultBasePath),
177177
},
178+
"dataproc_custom_endpoint": {
179+
Type: schema.TypeString,
180+
Optional: true,
181+
ValidateFunc: validateCustomEndpoint,
182+
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
183+
"GOOGLE_DATAPROC_CUSTOM_ENDPOINT",
184+
}, DataprocDefaultBasePath),
185+
},
178186
"dns_custom_endpoint": {
179187
Type: schema.TypeString,
180188
Optional: true,
@@ -310,7 +318,6 @@ func Provider() terraform.ResourceProvider {
310318
ComputeBetaCustomEndpointEntryKey: ComputeBetaCustomEndpointEntry,
311319
ContainerCustomEndpointEntryKey: ContainerCustomEndpointEntry,
312320
ContainerBetaCustomEndpointEntryKey: ContainerBetaCustomEndpointEntry,
313-
DataprocCustomEndpointEntryKey: DataprocCustomEndpointEntry,
314321
DataprocBetaCustomEndpointEntryKey: DataprocBetaCustomEndpointEntry,
315322
DataflowCustomEndpointEntryKey: DataflowCustomEndpointEntry,
316323
DnsBetaCustomEndpointEntryKey: DnsBetaCustomEndpointEntry,
@@ -639,6 +646,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
639646
config.CloudBuildBasePath = d.Get("cloud_build_custom_endpoint").(string)
640647
config.CloudSchedulerBasePath = d.Get("cloud_scheduler_custom_endpoint").(string)
641648
config.ComputeBasePath = d.Get("compute_custom_endpoint").(string)
649+
config.DataprocBasePath = d.Get("dataproc_custom_endpoint").(string)
642650
config.DnsBasePath = d.Get("dns_custom_endpoint").(string)
643651
config.FilestoreBasePath = d.Get("filestore_custom_endpoint").(string)
644652
config.FirestoreBasePath = d.Get("firestore_custom_endpoint").(string)
@@ -663,7 +671,6 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
663671
config.ComputeBetaBasePath = d.Get(ComputeBetaCustomEndpointEntryKey).(string)
664672
config.ContainerBasePath = d.Get(ContainerCustomEndpointEntryKey).(string)
665673
config.ContainerBetaBasePath = d.Get(ContainerBetaCustomEndpointEntryKey).(string)
666-
config.DataprocBasePath = d.Get(DataprocCustomEndpointEntryKey).(string)
667674
config.DataprocBetaBasePath = d.Get(DataprocBetaCustomEndpointEntryKey).(string)
668675
config.DataflowBasePath = d.Get(DataflowCustomEndpointEntryKey).(string)
669676
config.DnsBetaBasePath = d.Get(DnsBetaCustomEndpointEntryKey).(string)

google/provider_handwritten_endpoint.go

-11
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,6 @@ var ContainerBetaCustomEndpointEntry = &schema.Schema{
8585
}, ContainerBetaDefaultBasePath),
8686
}
8787

88-
var DataprocDefaultBasePath = "https://dataproc.googleapis.com/v1/"
89-
var DataprocCustomEndpointEntryKey = "dataproc_custom_endpoint"
90-
var DataprocCustomEndpointEntry = &schema.Schema{
91-
Type: schema.TypeString,
92-
Optional: true,
93-
ValidateFunc: validateCustomEndpoint,
94-
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
95-
"GOOGLE_DATAPROC_CUSTOM_ENDPOINT",
96-
}, DataprocDefaultBasePath),
97-
}
98-
9988
var DataprocBetaDefaultBasePath = "https://dataproc.googleapis.com/v1beta2/"
10089
var DataprocBetaCustomEndpointEntryKey = "dataproc_beta_custom_endpoint"
10190
var DataprocBetaCustomEndpointEntry = &schema.Schema{

0 commit comments

Comments
 (0)