Skip to content

Commit

Permalink
Add dataproc autoscaling policy resource
Browse files Browse the repository at this point in the history
  • Loading branch information
megan07 authored Aug 22, 2019
2 parents 2b35828 + c60885d commit c2b754e
Show file tree
Hide file tree
Showing 9 changed files with 1,117 additions and 18 deletions.
6 changes: 4 additions & 2 deletions google-beta/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type Config struct {
CloudSchedulerBasePath string
ComputeBasePath string
ContainerAnalysisBasePath string
DataprocBasePath string
DnsBasePath string
FilestoreBasePath string
FirestoreBasePath string
Expand Down Expand Up @@ -121,8 +122,7 @@ type Config struct {
ContainerBetaBasePath string
clientContainerBeta *containerBeta.Service

DataprocBasePath string
clientDataproc *dataproc.Service
clientDataproc *dataproc.Service

DataprocBetaBasePath string
clientDataprocBeta *dataprocBeta.Service
Expand Down Expand Up @@ -217,6 +217,7 @@ var CloudRunDefaultBasePath = "https://run.googleapis.com/v1alpha1/"
var CloudSchedulerDefaultBasePath = "https://cloudscheduler.googleapis.com/v1/"
var ComputeDefaultBasePath = "https://www.googleapis.com/compute/beta/"
var ContainerAnalysisDefaultBasePath = "https://containeranalysis.googleapis.com/v1beta1/"
var DataprocDefaultBasePath = "https://dataproc.googleapis.com/v1beta2/"
var DnsDefaultBasePath = "https://www.googleapis.com/dns/v1beta2/"
var FilestoreDefaultBasePath = "https://file.googleapis.com/v1/"
var FirestoreDefaultBasePath = "https://firestore.googleapis.com/v1/"
Expand Down Expand Up @@ -702,6 +703,7 @@ func ConfigureBasePaths(c *Config) {
c.CloudSchedulerBasePath = CloudSchedulerDefaultBasePath
c.ComputeBasePath = ComputeDefaultBasePath
c.ContainerAnalysisBasePath = ContainerAnalysisDefaultBasePath
c.DataprocBasePath = DataprocDefaultBasePath
c.DnsBasePath = DnsDefaultBasePath
c.FilestoreBasePath = FilestoreDefaultBasePath
c.FirestoreBasePath = FirestoreDefaultBasePath
Expand Down
16 changes: 12 additions & 4 deletions google-beta/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ func Provider() terraform.ResourceProvider {
"GOOGLE_CONTAINER_ANALYSIS_CUSTOM_ENDPOINT",
}, ContainerAnalysisDefaultBasePath),
},
"dataproc_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_DATAPROC_CUSTOM_ENDPOINT",
}, DataprocDefaultBasePath),
},
"dns_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -353,7 +361,6 @@ func Provider() terraform.ResourceProvider {
ComputeBetaCustomEndpointEntryKey: ComputeBetaCustomEndpointEntry,
ContainerCustomEndpointEntryKey: ContainerCustomEndpointEntry,
ContainerBetaCustomEndpointEntryKey: ContainerBetaCustomEndpointEntry,
DataprocCustomEndpointEntryKey: DataprocCustomEndpointEntry,
DataprocBetaCustomEndpointEntryKey: DataprocBetaCustomEndpointEntry,
DataflowCustomEndpointEntryKey: DataflowCustomEndpointEntry,
DnsBetaCustomEndpointEntryKey: DnsBetaCustomEndpointEntry,
Expand Down Expand Up @@ -432,9 +439,9 @@ func Provider() terraform.ResourceProvider {
}
}

// Generated resources: 86
// Generated resources: 87
// Generated IAM resources: 6
// Total generated resources: 92
// Total generated resources: 93
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -499,6 +506,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_compute_url_map": resourceComputeUrlMap(),
"google_compute_vpn_tunnel": resourceComputeVpnTunnel(),
"google_container_analysis_note": resourceContainerAnalysisNote(),
"google_dataproc_autoscaling_policy": resourceDataprocAutoscalingPolicy(),
"google_dns_managed_zone": resourceDnsManagedZone(),
"google_dns_policy": resourceDnsPolicy(),
"google_filestore_instance": resourceFilestoreInstance(),
Expand Down Expand Up @@ -713,6 +721,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
config.CloudSchedulerBasePath = d.Get("cloud_scheduler_custom_endpoint").(string)
config.ComputeBasePath = d.Get("compute_custom_endpoint").(string)
config.ContainerAnalysisBasePath = d.Get("container_analysis_custom_endpoint").(string)
config.DataprocBasePath = d.Get("dataproc_custom_endpoint").(string)
config.DnsBasePath = d.Get("dns_custom_endpoint").(string)
config.FilestoreBasePath = d.Get("filestore_custom_endpoint").(string)
config.FirestoreBasePath = d.Get("firestore_custom_endpoint").(string)
Expand Down Expand Up @@ -741,7 +750,6 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
config.ComputeBetaBasePath = d.Get(ComputeBetaCustomEndpointEntryKey).(string)
config.ContainerBasePath = d.Get(ContainerCustomEndpointEntryKey).(string)
config.ContainerBetaBasePath = d.Get(ContainerBetaCustomEndpointEntryKey).(string)
config.DataprocBasePath = d.Get(DataprocCustomEndpointEntryKey).(string)
config.DataprocBetaBasePath = d.Get(DataprocBetaCustomEndpointEntryKey).(string)
config.DataflowBasePath = d.Get(DataflowCustomEndpointEntryKey).(string)
config.DnsBetaBasePath = d.Get(DnsBetaCustomEndpointEntryKey).(string)
Expand Down
11 changes: 0 additions & 11 deletions google-beta/provider_handwritten_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,6 @@ var ContainerBetaCustomEndpointEntry = &schema.Schema{
}, ContainerBetaDefaultBasePath),
}

var DataprocDefaultBasePath = "https://dataproc.googleapis.com/v1/"
var DataprocCustomEndpointEntryKey = "dataproc_custom_endpoint"
var DataprocCustomEndpointEntry = &schema.Schema{
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_DATAPROC_CUSTOM_ENDPOINT",
}, DataprocDefaultBasePath),
}

var DataprocBetaDefaultBasePath = "https://dataproc.googleapis.com/v1beta2/"
var DataprocBetaCustomEndpointEntryKey = "dataproc_beta_custom_endpoint"
var DataprocBetaCustomEndpointEntry = &schema.Schema{
Expand Down
Loading

0 comments on commit c2b754e

Please sign in to comment.