Skip to content

Commit 3bf3d1e

Browse files
workbench: Changed instance_owners field in the examples to not use a service account. (#11189) (#18802)
[upstream:420db9d89f2b7013c72f29146d5ea22d410a790c] Signed-off-by: Modular Magician <[email protected]>
1 parent 12cb25a commit 3bf3d1e

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

.changelog/11189.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
workbench: Changed `instance_owners` field in the examples to not use a service account.
3+
```

google/services/workbench/resource_workbench_instance_generated_test.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ resource "google_workbench_instance" "instance" {
202202
203203
}
204204
205-
instance_owners = [ "%{service_account}"]
206-
207205
labels = {
208206
k = "val"
209207
}
@@ -218,6 +216,7 @@ func TestAccWorkbenchInstance_workbenchInstanceFullExample(t *testing.T) {
218216
t.Parallel()
219217

220218
context := map[string]interface{}{
219+
"project_id": envvar.GetTestProjectFromEnv(),
221220
"service_account": envvar.GetTestServiceAccountFromEnv(t),
222221
"key_name": acctest.BootstrapKMSKeyInLocation(t, "us-central1").CryptoKey.Name,
223222
"random_suffix": acctest.RandString(t, 10),
@@ -259,6 +258,14 @@ resource "google_compute_address" "static" {
259258
name = "tf-test-wbi-test-default%{random_suffix}"
260259
}
261260
261+
resource "google_service_account_iam_binding" "act_as_permission" {
262+
service_account_id = "projects/%{project_id}/serviceAccounts/%{service_account}"
263+
role = "roles/iam.serviceAccountUser"
264+
members = [
265+
266+
]
267+
}
268+
262269
resource "google_workbench_instance" "instance" {
263270
name = "tf-test-workbench-instance%{random_suffix}"
264271
location = "us-central1-a"
@@ -317,7 +324,7 @@ resource "google_workbench_instance" "instance" {
317324
318325
disable_proxy_access = "true"
319326
320-
instance_owners = [ "%{service_account}"]
327+
instance_owners = ["[email protected]"]
321328
322329
labels = {
323330
k = "val"

website/docs/r/workbench_instance.html.markdown

+9-3
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ resource "google_workbench_instance" "instance" {
110110
111111
}
112112
113-
instance_owners = [ "[email protected]"]
114-
115113
labels = {
116114
k = "val"
117115
}
@@ -140,6 +138,14 @@ resource "google_compute_address" "static" {
140138
name = "wbi-test-default"
141139
}
142140
141+
resource "google_service_account_iam_binding" "act_as_permission" {
142+
service_account_id = "projects/my-project-name/serviceAccounts/[email protected]"
143+
role = "roles/iam.serviceAccountUser"
144+
members = [
145+
146+
]
147+
}
148+
143149
resource "google_workbench_instance" "instance" {
144150
name = "workbench-instance"
145151
location = "us-central1-a"
@@ -198,7 +204,7 @@ resource "google_workbench_instance" "instance" {
198204
199205
disable_proxy_access = "true"
200206
201-
instance_owners = [ "my@service-account.com"]
207+
instance_owners = ["example@example.com"]
202208
203209
labels = {
204210
k = "val"

0 commit comments

Comments
 (0)