Skip to content

Commit

Permalink
Add: BigLake API Catalog Resource (#8751) (#6152)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
Co-authored-by: Shuya Ma <[email protected]>
  • Loading branch information
modular-magician and shuyama1 authored Aug 25, 2023
1 parent 07b1dcc commit c83fcc8
Show file tree
Hide file tree
Showing 12 changed files with 693 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/8751.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_biglake_catalog`
```
5 changes: 5 additions & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ var services = mapOf(
"displayName" to "Beyondcorp",
"path" to "./google-beta/services/beyondcorp"
),
"biglake" to mapOf(
"name" to "biglake",
"displayName" to "Biglake",
"path" to "./google-beta/services/biglake"
),
"bigquery" to mapOf(
"name" to "bigquery",
"displayName" to "Bigquery",
Expand Down
1 change: 1 addition & 0 deletions google-beta/fwmodels/provider_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type ProviderModel struct {
ArtifactRegistryCustomEndpoint types.String `tfsdk:"artifact_registry_custom_endpoint"`
BackupDRCustomEndpoint types.String `tfsdk:"backup_dr_custom_endpoint"`
BeyondcorpCustomEndpoint types.String `tfsdk:"beyondcorp_custom_endpoint"`
BiglakeCustomEndpoint types.String `tfsdk:"biglake_custom_endpoint"`
BigQueryCustomEndpoint types.String `tfsdk:"big_query_custom_endpoint"`
BigqueryAnalyticsHubCustomEndpoint types.String `tfsdk:"bigquery_analytics_hub_custom_endpoint"`
BigqueryConnectionCustomEndpoint types.String `tfsdk:"bigquery_connection_custom_endpoint"`
Expand Down
6 changes: 6 additions & 0 deletions google-beta/fwprovider/framework_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
transport_tpg.CustomEndpointValidator(),
},
},
"biglake_custom_endpoint": &schema.StringAttribute{
Optional: true,
Validators: []validator.String{
transport_tpg.CustomEndpointValidator(),
},
},
"big_query_custom_endpoint": &schema.StringAttribute{
Optional: true,
Validators: []validator.String{
Expand Down
10 changes: 10 additions & 0 deletions google-beta/fwtransport/framework_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ type FrameworkProviderConfig struct {
ArtifactRegistryBasePath string
BackupDRBasePath string
BeyondcorpBasePath string
BiglakeBasePath string
BigQueryBasePath string
BigqueryAnalyticsHubBasePath string
BigqueryConnectionBasePath string
Expand Down Expand Up @@ -211,6 +212,7 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context,
p.ArtifactRegistryBasePath = data.ArtifactRegistryCustomEndpoint.ValueString()
p.BackupDRBasePath = data.BackupDRCustomEndpoint.ValueString()
p.BeyondcorpBasePath = data.BeyondcorpCustomEndpoint.ValueString()
p.BiglakeBasePath = data.BiglakeCustomEndpoint.ValueString()
p.BigQueryBasePath = data.BigQueryCustomEndpoint.ValueString()
p.BigqueryAnalyticsHubBasePath = data.BigqueryAnalyticsHubCustomEndpoint.ValueString()
p.BigqueryConnectionBasePath = data.BigqueryConnectionCustomEndpoint.ValueString()
Expand Down Expand Up @@ -513,6 +515,14 @@ func (p *FrameworkProviderConfig) HandleDefaults(ctx context.Context, data *fwmo
data.BeyondcorpCustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.BiglakeCustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_BIGLAKE_CUSTOM_ENDPOINT",
}, transport_tpg.DefaultBasePaths[transport_tpg.BiglakeBasePathKey])
if customEndpoint != nil {
data.BiglakeCustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.BigQueryCustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_BIG_QUERY_CUSTOM_ENDPOINT",
Expand Down
12 changes: 10 additions & 2 deletions google-beta/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/artifactregistry"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/backupdr"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/beyondcorp"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/biglake"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/bigquery"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/bigqueryanalyticshub"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/bigqueryconnection"
Expand Down Expand Up @@ -287,6 +288,11 @@ func Provider() *schema.Provider {
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"biglake_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"big_query_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -1087,9 +1093,9 @@ func DatasourceMapWithErrors() (map[string]*schema.Resource, error) {
})
}

// Generated resources: 369
// Generated resources: 370
// Generated IAM resources: 234
// Total generated resources: 603
// Total generated resources: 604
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -1166,6 +1172,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_beyondcorp_app_connection": beyondcorp.ResourceBeyondcorpAppConnection(),
"google_beyondcorp_app_connector": beyondcorp.ResourceBeyondcorpAppConnector(),
"google_beyondcorp_app_gateway": beyondcorp.ResourceBeyondcorpAppGateway(),
"google_biglake_catalog": biglake.ResourceBiglakeCatalog(),
"google_bigquery_dataset": bigquery.ResourceBigQueryDataset(),
"google_bigquery_dataset_access": bigquery.ResourceBigQueryDatasetAccess(),
"google_bigquery_job": bigquery.ResourceBigQueryJob(),
Expand Down Expand Up @@ -1956,6 +1963,7 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.ArtifactRegistryBasePath = d.Get("artifact_registry_custom_endpoint").(string)
config.BackupDRBasePath = d.Get("backup_dr_custom_endpoint").(string)
config.BeyondcorpBasePath = d.Get("beyondcorp_custom_endpoint").(string)
config.BiglakeBasePath = d.Get("biglake_custom_endpoint").(string)
config.BigQueryBasePath = d.Get("big_query_custom_endpoint").(string)
config.BigqueryAnalyticsHubBasePath = d.Get("bigquery_analytics_hub_custom_endpoint").(string)
config.BigqueryConnectionBasePath = d.Get("bigquery_connection_custom_endpoint").(string)
Expand Down
Loading

0 comments on commit c83fcc8

Please sign in to comment.