Skip to content

Commit c0c6796

Browse files
Add storageinsights product and ReportConfig resource type. (#8799) (#15819)
Signed-off-by: Modular Magician <[email protected]>
1 parent 4e75ffb commit c0c6796

13 files changed

+1794
-2
lines changed

.changelog/8799.txt

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

.teamcity/components/generated/services.kt

+5
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,11 @@ var services = mapOf(
576576
"displayName" to "Storage",
577577
"path" to "./google/services/storage"
578578
),
579+
"storageinsights" to mapOf(
580+
"name" to "storageinsights",
581+
"displayName" to "Storageinsights",
582+
"path" to "./google/services/storageinsights"
583+
),
579584
"storagetransfer" to mapOf(
580585
"name" to "storagetransfer",
581586
"displayName" to "Storagetransfer",

google/fwmodels/provider_model.go

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ type ProviderModel struct {
115115
SpannerCustomEndpoint types.String `tfsdk:"spanner_custom_endpoint"`
116116
SQLCustomEndpoint types.String `tfsdk:"sql_custom_endpoint"`
117117
StorageCustomEndpoint types.String `tfsdk:"storage_custom_endpoint"`
118+
StorageInsightsCustomEndpoint types.String `tfsdk:"storage_insights_custom_endpoint"`
118119
StorageTransferCustomEndpoint types.String `tfsdk:"storage_transfer_custom_endpoint"`
119120
TagsCustomEndpoint types.String `tfsdk:"tags_custom_endpoint"`
120121
TPUCustomEndpoint types.String `tfsdk:"tpu_custom_endpoint"`

google/fwprovider/framework_provider.go

+6
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
659659
transport_tpg.CustomEndpointValidator(),
660660
},
661661
},
662+
"storage_insights_custom_endpoint": &schema.StringAttribute{
663+
Optional: true,
664+
Validators: []validator.String{
665+
transport_tpg.CustomEndpointValidator(),
666+
},
667+
},
662668
"storage_transfer_custom_endpoint": &schema.StringAttribute{
663669
Optional: true,
664670
Validators: []validator.String{

google/fwtransport/framework_config.go

+10
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ type FrameworkProviderConfig struct {
139139
SpannerBasePath string
140140
SQLBasePath string
141141
StorageBasePath string
142+
StorageInsightsBasePath string
142143
StorageTransferBasePath string
143144
TagsBasePath string
144145
TPUBasePath string
@@ -274,6 +275,7 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context,
274275
p.SpannerBasePath = data.SpannerCustomEndpoint.ValueString()
275276
p.SQLBasePath = data.SQLCustomEndpoint.ValueString()
276277
p.StorageBasePath = data.StorageCustomEndpoint.ValueString()
278+
p.StorageInsightsBasePath = data.StorageInsightsCustomEndpoint.ValueString()
277279
p.StorageTransferBasePath = data.StorageTransferCustomEndpoint.ValueString()
278280
p.TagsBasePath = data.TagsCustomEndpoint.ValueString()
279281
p.TPUBasePath = data.TPUCustomEndpoint.ValueString()
@@ -1133,6 +1135,14 @@ func (p *FrameworkProviderConfig) HandleDefaults(ctx context.Context, data *fwmo
11331135
data.StorageCustomEndpoint = types.StringValue(customEndpoint.(string))
11341136
}
11351137
}
1138+
if data.StorageInsightsCustomEndpoint.IsNull() {
1139+
customEndpoint := transport_tpg.MultiEnvDefault([]string{
1140+
"GOOGLE_STORAGE_INSIGHTS_CUSTOM_ENDPOINT",
1141+
}, transport_tpg.DefaultBasePaths[transport_tpg.StorageInsightsBasePathKey])
1142+
if customEndpoint != nil {
1143+
data.StorageInsightsCustomEndpoint = types.StringValue(customEndpoint.(string))
1144+
}
1145+
}
11361146
if data.StorageTransferCustomEndpoint.IsNull() {
11371147
customEndpoint := transport_tpg.MultiEnvDefault([]string{
11381148
"GOOGLE_STORAGE_TRANSFER_CUSTOM_ENDPOINT",

google/provider/provider.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ import (
102102
"github.com/hashicorp/terraform-provider-google/google/services/spanner"
103103
"github.com/hashicorp/terraform-provider-google/google/services/sql"
104104
"github.com/hashicorp/terraform-provider-google/google/services/storage"
105+
"github.com/hashicorp/terraform-provider-google/google/services/storageinsights"
105106
"github.com/hashicorp/terraform-provider-google/google/services/storagetransfer"
106107
"github.com/hashicorp/terraform-provider-google/google/services/tags"
107108
"github.com/hashicorp/terraform-provider-google/google/services/tpu"
@@ -678,6 +679,11 @@ func Provider() *schema.Provider {
678679
Optional: true,
679680
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
680681
},
682+
"storage_insights_custom_endpoint": {
683+
Type: schema.TypeString,
684+
Optional: true,
685+
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
686+
},
681687
"storage_transfer_custom_endpoint": {
682688
Type: schema.TypeString,
683689
Optional: true,
@@ -980,9 +986,9 @@ func DatasourceMapWithErrors() (map[string]*schema.Resource, error) {
980986
})
981987
}
982988

983-
// Generated resources: 320
989+
// Generated resources: 321
984990
// Generated IAM resources: 207
985-
// Total generated resources: 527
991+
// Total generated resources: 528
986992
func ResourceMap() map[string]*schema.Resource {
987993
resourceMap, _ := ResourceMapWithErrors()
988994
return resourceMap
@@ -1482,6 +1488,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
14821488
"google_storage_default_object_access_control": storage.ResourceStorageDefaultObjectAccessControl(),
14831489
"google_storage_hmac_key": storage.ResourceStorageHmacKey(),
14841490
"google_storage_object_access_control": storage.ResourceStorageObjectAccessControl(),
1491+
"google_storage_insights_report_config": storageinsights.ResourceStorageInsightsReportConfig(),
14851492
"google_storage_transfer_agent_pool": storagetransfer.ResourceStorageTransferAgentPool(),
14861493
"google_tags_tag_binding": tags.ResourceTagsTagBinding(),
14871494
"google_tags_tag_key": tags.ResourceTagsTagKey(),
@@ -1834,6 +1841,7 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
18341841
config.SpannerBasePath = d.Get("spanner_custom_endpoint").(string)
18351842
config.SQLBasePath = d.Get("sql_custom_endpoint").(string)
18361843
config.StorageBasePath = d.Get("storage_custom_endpoint").(string)
1844+
config.StorageInsightsBasePath = d.Get("storage_insights_custom_endpoint").(string)
18371845
config.StorageTransferBasePath = d.Get("storage_transfer_custom_endpoint").(string)
18381846
config.TagsBasePath = d.Get("tags_custom_endpoint").(string)
18391847
config.TPUBasePath = d.Get("tpu_custom_endpoint").(string)

0 commit comments

Comments
 (0)