Open oscar-barlow opened 10 months ago
This may be managed through the unstructuredmetadata
field. That's how it looks like it's done in the v2
API, at least, snippet from a REST response:
"metadata": {
"idle-timeout-seconds": "10800",
... other entries ...
},
@rileykarson Is that already doable via metadata?
Can confirm that the metadata approach described above worked for me:
"metadata": { "idle-timeout-seconds": "10800" }
@rileykarson Is there some documentation that'll help the users discover this better? Seems to be a very common question. Otherwise this ticket can be closed.
Documentation has been added here: https://cloud.google.com/vertex-ai/docs/workbench/instances/idle-shutdown
Sorry if this is a stupid question but is the correct syntax?
resource "google_workbench_instance" "workbench_instance_test" {
...
metadata = {
idle-timeout-seconds = 1000
}
Also, would it be possible to add the information to the resource documentation, considering that this is a new feature, and something that is new at least for those who are migrating from user managed notebooks.
Here's the syntax:
resource "google_workbench_instance" "workbench_instance_test" {
...
metadata = {
idle-timeout-seconds = "10800"
}
This worked for me as well. Thanks for the tip.
I haven't seen this mentioned yet, but if a notebook's idle timeout was already set e.g.
metadata = {
idle-timeout-seconds = "10800"
}
In order to disable the idle timeout, you need to set the metadata to an empty string (not null or removing it!) like so:
metadata = {
idle-timeout-seconds = ""
}
I noticed that simply removing it would not change the setting of the notebook.
Community Note
Description
Leaving notebook VMs running when they're not being actively used is a waste of money, so GCP offer an 'idle timeout' configuration option in the Vertex Workbench console. It would be really helpful to be able to configure this in Terraform, to save money.
New or Affected Resource(s)
google_notebooks_instance
Potential Terraform Configuration
b/299312211