Skip to content

Commit e826043

Browse files
feat: (storageinsights) added force_destroy to google_storage_insights_report_config resource (#15162)
1 parent 6e655df commit e826043

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

mmv1/products/storageinsights/ReportConfig.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ docs:
2323
base_url: 'projects/{{project}}/locations/{{location}}/reportConfigs'
2424
self_link: 'projects/{{project}}/locations/{{location}}/reportConfigs/{{name}}'
2525
create_url: 'projects/{{project}}/locations/{{location}}/reportConfigs'
26+
delete_url: projects/{{project}}/locations/{{location}}/reportConfigs/{{name}}?force={{force_destroy}}
2627
update_verb: 'PATCH'
2728
update_mask: true
2829
timeouts:
@@ -35,6 +36,8 @@ examples:
3536
primary_resource_id: 'config'
3637
vars:
3738
bucket_name: 'my-bucket'
39+
ignore_read_extra:
40+
- 'force_destroy'
3841
parameters:
3942
- name: 'location'
4043
type: String
@@ -44,6 +47,12 @@ parameters:
4447
url_param_only: true
4548
required: true
4649
immutable: true
50+
virtual_fields:
51+
- name: 'force_destroy'
52+
description: |
53+
If set, all the inventory report details associated with this report configuration are deleted.
54+
type: Boolean
55+
default_value: false
4756
properties:
4857
- name: 'name'
4958
type: String

mmv1/third_party/terraform/services/storageinsights/resource_storage_insights_report_config_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestAccStorageInsightsReportConfig_update(t *testing.T) {
3737
ResourceName: "google_storage_insights_report_config.config",
3838
ImportState: true,
3939
ImportStateVerify: true,
40-
ImportStateVerifyIgnore: []string{"location"},
40+
ImportStateVerifyIgnore: []string{"location", "force_destroy"},
4141
},
4242
},
4343
})
@@ -70,7 +70,7 @@ func TestAccStorageInsightsReportConfig_parquet(t *testing.T) {
7070
ResourceName: "google_storage_insights_report_config.config",
7171
ImportState: true,
7272
ImportStateVerify: true,
73-
ImportStateVerifyIgnore: []string{"location"},
73+
ImportStateVerifyIgnore: []string{"location", "force_destroy"},
7474
},
7575
},
7676
})
@@ -167,6 +167,7 @@ resource "google_storage_insights_report_config" "config" {
167167
depends_on = [
168168
google_storage_bucket_iam_member.admin,
169169
]
170+
force_destroy = true
170171
}
171172
172173
resource "google_storage_bucket" "report_bucket" {
@@ -275,6 +276,7 @@ resource "google_storage_insights_report_config" "config" {
275276
depends_on = [
276277
google_storage_bucket_iam_member.admin,
277278
]
279+
force_destroy = true
278280
}
279281
280282
resource "google_storage_bucket" "report_bucket" {

0 commit comments

Comments
 (0)