Skip to content

Commit 33abdd5

Browse files
authored
feat: Add examples for updating metadata based features on workbench instances. (terraform-google-modules#581)
* Doc samples on how to update metadata on workbench instances. * Doc samples on how to update metadata on workbench instances. * Doc samples on how to update metadata on workbench instances. * Doc samples on how to update metadata on workbench instances.
1 parent d808dfc commit 33abdd5

File tree

6 files changed

+170
-1
lines changed

6 files changed

+170
-1
lines changed

vertex_ai/workbench/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2023 Google LLC
2+
* Copyright 2024 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
18+
# [START aiplatform_workbench_create_metadata]
19+
resource "google_workbench_instance" "default" {
20+
name = "workbench-instance-example"
21+
location = "us-central1-a"
22+
23+
gce_setup {
24+
machine_type = "n1-standard-1"
25+
vm_image {
26+
project = "deeplearning-platform-release"
27+
family = "tf-latest-gpu"
28+
}
29+
metadata = {
30+
key = "value"
31+
}
32+
}
33+
}
34+
# [END aiplatform_workbench_create_metadata]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
18+
# [START aiplatform_workbench_create_dataproc]
19+
resource "google_workbench_instance" "default" {
20+
name = "workbench-instance-example"
21+
location = "us-central1-a"
22+
23+
gce_setup {
24+
machine_type = "n1-standard-1"
25+
vm_image {
26+
project = "deeplearning-platform-release"
27+
family = "tf-latest-gpu"
28+
}
29+
metadata = {
30+
disable-mixer = "false"
31+
}
32+
}
33+
}
34+
# [END aiplatform_workbench_create_dataproc]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
18+
# [START aiplatform_workbench_create_idle_shutdown]
19+
resource "google_workbench_instance" "default" {
20+
name = "workbench-instance-example"
21+
location = "us-central1-a"
22+
23+
gce_setup {
24+
machine_type = "n1-standard-1"
25+
vm_image {
26+
project = "deeplearning-platform-release"
27+
family = "tf-latest-gpu"
28+
}
29+
metadata = {
30+
idle-timeout-seconds = "10800"
31+
}
32+
}
33+
}
34+
# [END aiplatform_workbench_create_idle_shutdown]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
18+
# [START aiplatform_workbench_deleted_metadata]
19+
resource "google_workbench_instance" "default" {
20+
name = "workbench-instance-example"
21+
location = "us-central1-a"
22+
23+
gce_setup {
24+
machine_type = "n1-standard-1"
25+
vm_image {
26+
project = "deeplearning-platform-release"
27+
family = "tf-latest-gpu"
28+
}
29+
metadata = {
30+
}
31+
}
32+
}
33+
# [END aiplatform_workbench_deleted_metadata]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
18+
# [START aiplatform_workbench_updated_metadata]
19+
resource "google_workbench_instance" "default" {
20+
name = "workbench-instance-example"
21+
location = "us-central1-a"
22+
23+
gce_setup {
24+
machine_type = "n1-standard-1"
25+
vm_image {
26+
project = "deeplearning-platform-release"
27+
family = "tf-latest-gpu"
28+
}
29+
metadata = {
30+
key = "updated_value"
31+
}
32+
}
33+
}
34+
# [END aiplatform_workbench_updated_metadata]

0 commit comments

Comments
 (0)