File tree 4 files changed +34
-1
lines changed
4 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 43
43
error :
44
44
path : ' error'
45
45
message : ' message'
46
- custom_code :
47
46
exclude_sweeper : true
48
47
error_abort_predicates :
49
48
@@ -106,6 +105,25 @@ examples:
106
105
instance_name : ' my-instance'
107
106
client_id : ' my-client-id'
108
107
client_secret : ' my-client-secret'
108
+ - name : ' looker_instance_force_delete'
109
+ primary_resource_id : ' looker-instance'
110
+ vars :
111
+ instance_name : ' my-instance'
112
+ client_id : ' my-client-id'
113
+ client_secret : ' my-client-secret'
114
+ ignore_read_extra :
115
+ - ' deletion_policy'
116
+ virtual_fields :
117
+ - name : ' deletion_policy'
118
+ default_value : " DEFAULT"
119
+ type : String
120
+ description : |
121
+ Policy to determine if the cluster should be deleted forcefully.
122
+ If setting deletion_policy = "FORCE", the Looker instance will be deleted regardless
123
+ of its nested resources. If set to "DEFAULT", Looker instances that still have
124
+ nested resources will return an error. Possible values: DEFAULT, FORCE
125
+ custom_code :
126
+ pre_delete : templates/terraform/pre_delete/looker_instance.go.tmpl
109
127
parameters :
110
128
- name : ' region'
111
129
type : String
Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ resource "google_looker_instance" "{{$.PrimaryResourceId}}" {
6
6
client_id = "{{index $.Vars "client_id"}}"
7
7
client_secret = "{{index $.Vars "client_secret"}}"
8
8
}
9
+ deletion_policy = "DEFAULT"
9
10
}
Original file line number Diff line number Diff line change
1
+ resource "google_looker_instance" "{{$.PrimaryResourceId}}" {
2
+ name = "{{index $.Vars "instance_name"}}"
3
+ platform_edition = "LOOKER_CORE_STANDARD_ANNUAL"
4
+ region = "us-central1"
5
+ oauth_config {
6
+ client_id = "{{index $.Vars "client_id"}}"
7
+ client_secret = "{{index $.Vars "client_secret"}}"
8
+ }
9
+ deletion_policy = "FORCE"
10
+ }
Original file line number Diff line number Diff line change
1
+ // Forcefully delete the Looker instance
2
+ if deletionPolicy := d.Get("deletion_policy"); deletionPolicy == "FORCE" {
3
+ url = url + "?force=True"
4
+ }
You can’t perform that action at this time.
0 commit comments