Skip to content

Commit 0564643

Browse files
efeelaihogontech
authored andcommitted
Update Instance.yaml delete_url for Looker (GoogleCloudPlatform#11950)
1 parent f50a95d commit 0564643

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

mmv1/products/looker/Instance.yaml

+19-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ async:
4343
error:
4444
path: 'error'
4545
message: 'message'
46-
custom_code:
4746
exclude_sweeper: true
4847
error_abort_predicates:
4948

@@ -106,6 +105,25 @@ examples:
106105
instance_name: 'my-instance'
107106
client_id: 'my-client-id'
108107
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
109127
parameters:
110128
- name: 'region'
111129
type: String

mmv1/templates/terraform/examples/looker_instance_basic.tf.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ resource "google_looker_instance" "{{$.PrimaryResourceId}}" {
66
client_id = "{{index $.Vars "client_id"}}"
77
client_secret = "{{index $.Vars "client_secret"}}"
88
}
9+
deletion_policy = "DEFAULT"
910
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Forcefully delete the Looker instance
2+
if deletionPolicy := d.Get("deletion_policy"); deletionPolicy == "FORCE" {
3+
url = url + "?force=True"
4+
}

0 commit comments

Comments
 (0)