Skip to content

Commit

Permalink
Add storageinsights product and ReportConfig resource type. (#8799) (#…
Browse files Browse the repository at this point in the history
…6253)

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Sep 12, 2023
1 parent de75b21 commit ea06738
Show file tree
Hide file tree
Showing 13 changed files with 1,794 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/8799.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_storage_insights_report_config`
```
5 changes: 5 additions & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@ var services = mapOf(
"displayName" to "Storage",
"path" to "./google-beta/services/storage"
),
"storageinsights" to mapOf(
"name" to "storageinsights",
"displayName" to "Storageinsights",
"path" to "./google-beta/services/storageinsights"
),
"storagetransfer" to mapOf(
"name" to "storagetransfer",
"displayName" to "Storagetransfer",
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 @@ -128,6 +128,7 @@ type ProviderModel struct {
SpannerCustomEndpoint types.String `tfsdk:"spanner_custom_endpoint"`
SQLCustomEndpoint types.String `tfsdk:"sql_custom_endpoint"`
StorageCustomEndpoint types.String `tfsdk:"storage_custom_endpoint"`
StorageInsightsCustomEndpoint types.String `tfsdk:"storage_insights_custom_endpoint"`
StorageTransferCustomEndpoint types.String `tfsdk:"storage_transfer_custom_endpoint"`
TagsCustomEndpoint types.String `tfsdk:"tags_custom_endpoint"`
TPUCustomEndpoint types.String `tfsdk:"tpu_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 @@ -738,6 +738,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
transport_tpg.CustomEndpointValidator(),
},
},
"storage_insights_custom_endpoint": &schema.StringAttribute{
Optional: true,
Validators: []validator.String{
transport_tpg.CustomEndpointValidator(),
},
},
"storage_transfer_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 @@ -152,6 +152,7 @@ type FrameworkProviderConfig struct {
SpannerBasePath string
SQLBasePath string
StorageBasePath string
StorageInsightsBasePath string
StorageTransferBasePath string
TagsBasePath string
TPUBasePath string
Expand Down Expand Up @@ -302,6 +303,7 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context,
p.SpannerBasePath = data.SpannerCustomEndpoint.ValueString()
p.SQLBasePath = data.SQLCustomEndpoint.ValueString()
p.StorageBasePath = data.StorageCustomEndpoint.ValueString()
p.StorageInsightsBasePath = data.StorageInsightsCustomEndpoint.ValueString()
p.StorageTransferBasePath = data.StorageTransferCustomEndpoint.ValueString()
p.TagsBasePath = data.TagsCustomEndpoint.ValueString()
p.TPUBasePath = data.TPUCustomEndpoint.ValueString()
Expand Down Expand Up @@ -1267,6 +1269,14 @@ func (p *FrameworkProviderConfig) HandleDefaults(ctx context.Context, data *fwmo
data.StorageCustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.StorageInsightsCustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_STORAGE_INSIGHTS_CUSTOM_ENDPOINT",
}, transport_tpg.DefaultBasePaths[transport_tpg.StorageInsightsBasePathKey])
if customEndpoint != nil {
data.StorageInsightsCustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.StorageTransferCustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_STORAGE_TRANSFER_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 @@ -116,6 +116,7 @@ import (
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/spanner"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/sql"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/storage"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/storageinsights"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/storagetransfer"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/tags"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/tpu"
Expand Down Expand Up @@ -759,6 +760,11 @@ func Provider() *schema.Provider {
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"storage_insights_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"storage_transfer_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -1100,9 +1106,9 @@ func DatasourceMapWithErrors() (map[string]*schema.Resource, error) {
})
}

// Generated resources: 381
// Generated resources: 382
// Generated IAM resources: 237
// Total generated resources: 618
// Total generated resources: 619
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -1689,6 +1695,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_storage_default_object_access_control": storage.ResourceStorageDefaultObjectAccessControl(),
"google_storage_hmac_key": storage.ResourceStorageHmacKey(),
"google_storage_object_access_control": storage.ResourceStorageObjectAccessControl(),
"google_storage_insights_report_config": storageinsights.ResourceStorageInsightsReportConfig(),
"google_storage_transfer_agent_pool": storagetransfer.ResourceStorageTransferAgentPool(),
"google_tags_tag_binding": tags.ResourceTagsTagBinding(),
"google_tags_tag_key": tags.ResourceTagsTagKey(),
Expand Down Expand Up @@ -2078,6 +2085,7 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.SpannerBasePath = d.Get("spanner_custom_endpoint").(string)
config.SQLBasePath = d.Get("sql_custom_endpoint").(string)
config.StorageBasePath = d.Get("storage_custom_endpoint").(string)
config.StorageInsightsBasePath = d.Get("storage_insights_custom_endpoint").(string)
config.StorageTransferBasePath = d.Get("storage_transfer_custom_endpoint").(string)
config.TagsBasePath = d.Get("tags_custom_endpoint").(string)
config.TPUBasePath = d.Get("tpu_custom_endpoint").(string)
Expand Down
Loading

0 comments on commit ea06738

Please sign in to comment.