Skip to content

Commit 15a5960

Browse files
modular-magicianrileykarsonefeelaiho
authored
Add Looker product and Instance resource support (#8110) (#15188)
Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Riley Karson <[email protected]> Co-authored-by: Efe Elaiho <[email protected]> Co-authored-by: efeelaiho <[email protected]>
1 parent 3fba8aa commit 15a5960

15 files changed

+2943
-2
lines changed

.changelog/8110.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
`google_looker_instance`
3+
```

.teamcity/components/generated/services.kt

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ var services = mapOf(
7171
"identityplatform" to "Identityplatform",
7272
"kms" to "Kms",
7373
"logging" to "Logging",
74+
"looker" to "Looker",
7475
"memcache" to "Memcache",
7576
"mlengine" to "Mlengine",
7677
"monitoring" to "Monitoring",

google/config_test_utils.go

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ func configureTestBasePaths(c *transport_tpg.Config, url string) {
8585
c.IdentityPlatformBasePath = url
8686
c.KMSBasePath = url
8787
c.LoggingBasePath = url
88+
c.LookerBasePath = url
8889
c.MemcacheBasePath = url
8990
c.MLEngineBasePath = url
9091
c.MonitoringBasePath = url

google/fwmodels/provider_model.go

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ type ProviderModel struct {
8686
IdentityPlatformCustomEndpoint types.String `tfsdk:"identity_platform_custom_endpoint"`
8787
KMSCustomEndpoint types.String `tfsdk:"kms_custom_endpoint"`
8888
LoggingCustomEndpoint types.String `tfsdk:"logging_custom_endpoint"`
89+
LookerCustomEndpoint types.String `tfsdk:"looker_custom_endpoint"`
8990
MemcacheCustomEndpoint types.String `tfsdk:"memcache_custom_endpoint"`
9091
MLEngineCustomEndpoint types.String `tfsdk:"ml_engine_custom_endpoint"`
9192
MonitoringCustomEndpoint types.String `tfsdk:"monitoring_custom_endpoint"`

google/fwprovider/framework_provider.go

+6
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
485485
transport_tpg.CustomEndpointValidator(),
486486
},
487487
},
488+
"looker_custom_endpoint": &schema.StringAttribute{
489+
Optional: true,
490+
Validators: []validator.String{
491+
transport_tpg.CustomEndpointValidator(),
492+
},
493+
},
488494
"memcache_custom_endpoint": &schema.StringAttribute{
489495
Optional: true,
490496
Validators: []validator.String{

google/fwtransport/framework_config.go

+10
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ type FrameworkProviderConfig struct {
110110
IdentityPlatformBasePath string
111111
KMSBasePath string
112112
LoggingBasePath string
113+
LookerBasePath string
113114
MemcacheBasePath string
114115
MLEngineBasePath string
115116
MonitoringBasePath string
@@ -244,6 +245,7 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context,
244245
p.IdentityPlatformBasePath = data.IdentityPlatformCustomEndpoint.ValueString()
245246
p.KMSBasePath = data.KMSCustomEndpoint.ValueString()
246247
p.LoggingBasePath = data.LoggingCustomEndpoint.ValueString()
248+
p.LookerBasePath = data.LookerCustomEndpoint.ValueString()
247249
p.MemcacheBasePath = data.MemcacheCustomEndpoint.ValueString()
248250
p.MLEngineBasePath = data.MLEngineCustomEndpoint.ValueString()
249251
p.MonitoringBasePath = data.MonitoringCustomEndpoint.ValueString()
@@ -891,6 +893,14 @@ func (p *FrameworkProviderConfig) HandleDefaults(ctx context.Context, data *fwmo
891893
data.LoggingCustomEndpoint = types.StringValue(customEndpoint.(string))
892894
}
893895
}
896+
if data.LookerCustomEndpoint.IsNull() {
897+
customEndpoint := transport_tpg.MultiEnvDefault([]string{
898+
"GOOGLE_LOOKER_CUSTOM_ENDPOINT",
899+
}, transport_tpg.DefaultBasePaths[transport_tpg.LookerBasePathKey])
900+
if customEndpoint != nil {
901+
data.LookerCustomEndpoint = types.StringValue(customEndpoint.(string))
902+
}
903+
}
894904
if data.MemcacheCustomEndpoint.IsNull() {
895905
customEndpoint := transport_tpg.MultiEnvDefault([]string{
896906
"GOOGLE_MEMCACHE_CUSTOM_ENDPOINT",

google/gcp_sweeper_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ import (
6969
_ "github.com/hashicorp/terraform-provider-google/google/services/identityplatform"
7070
_ "github.com/hashicorp/terraform-provider-google/google/services/kms"
7171
_ "github.com/hashicorp/terraform-provider-google/google/services/logging"
72+
_ "github.com/hashicorp/terraform-provider-google/google/services/looker"
7273
_ "github.com/hashicorp/terraform-provider-google/google/services/memcache"
7374
_ "github.com/hashicorp/terraform-provider-google/google/services/mlengine"
7475
_ "github.com/hashicorp/terraform-provider-google/google/services/monitoring"

google/provider/provider.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ import (
7474
"github.com/hashicorp/terraform-provider-google/google/services/identityplatform"
7575
"github.com/hashicorp/terraform-provider-google/google/services/kms"
7676
"github.com/hashicorp/terraform-provider-google/google/services/logging"
77+
"github.com/hashicorp/terraform-provider-google/google/services/looker"
7778
"github.com/hashicorp/terraform-provider-google/google/services/memcache"
7879
"github.com/hashicorp/terraform-provider-google/google/services/mlengine"
7980
"github.com/hashicorp/terraform-provider-google/google/services/monitoring"
@@ -527,6 +528,11 @@ func Provider() *schema.Provider {
527528
Optional: true,
528529
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
529530
},
531+
"looker_custom_endpoint": {
532+
Type: schema.TypeString,
533+
Optional: true,
534+
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
535+
},
530536
"memcache_custom_endpoint": {
531537
Type: schema.TypeString,
532538
Optional: true,
@@ -939,9 +945,9 @@ func DatasourceMapWithErrors() (map[string]*schema.Resource, error) {
939945
})
940946
}
941947

942-
// Generated resources: 300
948+
// Generated resources: 301
943949
// Generated IAM resources: 198
944-
// Total generated resources: 498
950+
// Total generated resources: 499
945951
func ResourceMap() map[string]*schema.Resource {
946952
resourceMap, _ := ResourceMapWithErrors()
947953
return resourceMap
@@ -1327,6 +1333,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
13271333
"google_logging_linked_dataset": logging.ResourceLoggingLinkedDataset(),
13281334
"google_logging_log_view": logging.ResourceLoggingLogView(),
13291335
"google_logging_metric": logging.ResourceLoggingMetric(),
1336+
"google_looker_instance": looker.ResourceLookerInstance(),
13301337
"google_memcache_instance": memcache.ResourceMemcacheInstance(),
13311338
"google_ml_engine_model": mlengine.ResourceMLEngineModel(),
13321339
"google_monitoring_alert_policy": monitoring.ResourceMonitoringAlertPolicy(),
@@ -1734,6 +1741,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
17341741
config.IdentityPlatformBasePath = d.Get("identity_platform_custom_endpoint").(string)
17351742
config.KMSBasePath = d.Get("kms_custom_endpoint").(string)
17361743
config.LoggingBasePath = d.Get("logging_custom_endpoint").(string)
1744+
config.LookerBasePath = d.Get("looker_custom_endpoint").(string)
17371745
config.MemcacheBasePath = d.Get("memcache_custom_endpoint").(string)
17381746
config.MLEngineBasePath = d.Get("ml_engine_custom_endpoint").(string)
17391747
config.MonitoringBasePath = d.Get("monitoring_custom_endpoint").(string)

0 commit comments

Comments
 (0)