blob: 0a5d815e83cd1b73eeed17b357b32d817428819f [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Cloud AI Notebooks"
description: |-
A Cloud AI Platform Notebook environment.
---
# google\_notebooks\_environment
A Cloud AI Platform Notebook environment.
To get more information about Environment, see:
* [API documentation](https://cloud.google.com/ai-platform/notebooks/docs/reference/rest)
* How-to Guides
* [Official Documentation](https://cloud.google.com/ai-platform-notebooks)
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=notebook_environment_basic&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Notebook Environment Basic
```hcl
resource "google_notebooks_environment" "environment" {
name = "notebooks-environment"
location = "us-west1-a"
container_image {
repository = "gcr.io/deeplearning-platform-release/base-cpu"
}
}
```
## Argument Reference
The following arguments are supported:
* `name` -
(Required)
The name specified for the Environment instance.
Format: projects/{project_id}/locations/{location}/environments/{environmentId}
* `location` -
(Required)
A reference to the zone where the machine resides.
- - -
* `display_name` -
(Optional)
Display name of this environment for the UI.
* `description` -
(Optional)
A brief description of this environment.
* `post_startup_script` -
(Optional)
Path to a Bash script that automatically runs after a notebook instance fully boots up.
The path must be a URL or Cloud Storage path. Example: "gs://path-to-file/file-name"
* `vm_image` -
(Optional)
Use a Compute Engine VM image to start the notebook instance.
Structure is [documented below](#nested_vm_image).
* `container_image` -
(Optional)
Use a container image to start the notebook instance.
Structure is [documented below](#nested_container_image).
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
<a name="nested_vm_image"></a>The `vm_image` block supports:
* `project` -
(Required)
The name of the Google Cloud project that this VM image belongs to.
Format: projects/{project_id}
* `image_name` -
(Optional)
Use VM image name to find the image.
* `image_family` -
(Optional)
Use this VM image family to find the image; the newest image in this family will be used.
<a name="nested_container_image"></a>The `container_image` block supports:
* `repository` -
(Required)
The path to the container image repository.
For example: gcr.io/{project_id}/{imageName}
* `tag` -
(Optional)
The tag of the container image. If not specified, this defaults to the latest tag.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/environments/{{name}}`
* `create_time` -
Instance creation time
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
Environment can be imported using any of these accepted formats:
* `projects/{{project}}/locations/{{location}}/environments/{{name}}`
* `{{project}}/{{location}}/{{name}}`
* `{{location}}/{{name}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Environment using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/locations/{{location}}/environments/{{name}}"
to = google_notebooks_environment.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Environment can be imported using one of the formats above. For example:
```
$ terraform import google_notebooks_environment.default projects/{{project}}/locations/{{location}}/environments/{{name}}
$ terraform import google_notebooks_environment.default {{project}}/{{location}}/{{name}}
$ terraform import google_notebooks_environment.default {{location}}/{{name}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).