gcp.notebooks.Environment
Explore with Pulumi AI
A Cloud AI Platform Notebook environment.
To get more information about Environment, see:
- API documentation
- How-to Guides
Example Usage
Notebook Environment Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const environment = new gcp.notebooks.Environment("environment", {
name: "notebooks-environment",
location: "us-west1-a",
containerImage: {
repository: "gcr.io/deeplearning-platform-release/base-cpu",
},
});
import pulumi
import pulumi_gcp as gcp
environment = gcp.notebooks.Environment("environment",
name="notebooks-environment",
location="us-west1-a",
container_image=gcp.notebooks.EnvironmentContainerImageArgs(
repository="gcr.io/deeplearning-platform-release/base-cpu",
))
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/notebooks"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := notebooks.NewEnvironment(ctx, "environment", ¬ebooks.EnvironmentArgs{
Name: pulumi.String("notebooks-environment"),
Location: pulumi.String("us-west1-a"),
ContainerImage: ¬ebooks.EnvironmentContainerImageArgs{
Repository: pulumi.String("gcr.io/deeplearning-platform-release/base-cpu"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var environment = new Gcp.Notebooks.Environment("environment", new()
{
Name = "notebooks-environment",
Location = "us-west1-a",
ContainerImage = new Gcp.Notebooks.Inputs.EnvironmentContainerImageArgs
{
Repository = "gcr.io/deeplearning-platform-release/base-cpu",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.notebooks.Environment;
import com.pulumi.gcp.notebooks.EnvironmentArgs;
import com.pulumi.gcp.notebooks.inputs.EnvironmentContainerImageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var environment = new Environment("environment", EnvironmentArgs.builder()
.name("notebooks-environment")
.location("us-west1-a")
.containerImage(EnvironmentContainerImageArgs.builder()
.repository("gcr.io/deeplearning-platform-release/base-cpu")
.build())
.build());
}
}
resources:
environment:
type: gcp:notebooks:Environment
properties:
name: notebooks-environment
location: us-west1-a
containerImage:
repository: gcr.io/deeplearning-platform-release/base-cpu
Create Environment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Environment(name: string, args: EnvironmentArgs, opts?: CustomResourceOptions);
@overload
def Environment(resource_name: str,
args: EnvironmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Environment(resource_name: str,
opts: Optional[ResourceOptions] = None,
location: Optional[str] = None,
container_image: Optional[EnvironmentContainerImageArgs] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
name: Optional[str] = None,
post_startup_script: Optional[str] = None,
project: Optional[str] = None,
vm_image: Optional[EnvironmentVmImageArgs] = None)
func NewEnvironment(ctx *Context, name string, args EnvironmentArgs, opts ...ResourceOption) (*Environment, error)
public Environment(string name, EnvironmentArgs args, CustomResourceOptions? opts = null)
public Environment(String name, EnvironmentArgs args)
public Environment(String name, EnvironmentArgs args, CustomResourceOptions options)
type: gcp:notebooks:Environment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args EnvironmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args EnvironmentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args EnvironmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnvironmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EnvironmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var exampleenvironmentResourceResourceFromNotebooksenvironment = new Gcp.Notebooks.Environment("exampleenvironmentResourceResourceFromNotebooksenvironment", new()
{
Location = "string",
ContainerImage = new Gcp.Notebooks.Inputs.EnvironmentContainerImageArgs
{
Repository = "string",
Tag = "string",
},
Description = "string",
DisplayName = "string",
Name = "string",
PostStartupScript = "string",
Project = "string",
VmImage = new Gcp.Notebooks.Inputs.EnvironmentVmImageArgs
{
Project = "string",
ImageFamily = "string",
ImageName = "string",
},
});
example, err := notebooks.NewEnvironment(ctx, "exampleenvironmentResourceResourceFromNotebooksenvironment", ¬ebooks.EnvironmentArgs{
Location: pulumi.String("string"),
ContainerImage: ¬ebooks.EnvironmentContainerImageArgs{
Repository: pulumi.String("string"),
Tag: pulumi.String("string"),
},
Description: pulumi.String("string"),
DisplayName: pulumi.String("string"),
Name: pulumi.String("string"),
PostStartupScript: pulumi.String("string"),
Project: pulumi.String("string"),
VmImage: ¬ebooks.EnvironmentVmImageArgs{
Project: pulumi.String("string"),
ImageFamily: pulumi.String("string"),
ImageName: pulumi.String("string"),
},
})
var exampleenvironmentResourceResourceFromNotebooksenvironment = new Environment("exampleenvironmentResourceResourceFromNotebooksenvironment", EnvironmentArgs.builder()
.location("string")
.containerImage(EnvironmentContainerImageArgs.builder()
.repository("string")
.tag("string")
.build())
.description("string")
.displayName("string")
.name("string")
.postStartupScript("string")
.project("string")
.vmImage(EnvironmentVmImageArgs.builder()
.project("string")
.imageFamily("string")
.imageName("string")
.build())
.build());
exampleenvironment_resource_resource_from_notebooksenvironment = gcp.notebooks.Environment("exampleenvironmentResourceResourceFromNotebooksenvironment",
location="string",
container_image=gcp.notebooks.EnvironmentContainerImageArgs(
repository="string",
tag="string",
),
description="string",
display_name="string",
name="string",
post_startup_script="string",
project="string",
vm_image=gcp.notebooks.EnvironmentVmImageArgs(
project="string",
image_family="string",
image_name="string",
))
const exampleenvironmentResourceResourceFromNotebooksenvironment = new gcp.notebooks.Environment("exampleenvironmentResourceResourceFromNotebooksenvironment", {
location: "string",
containerImage: {
repository: "string",
tag: "string",
},
description: "string",
displayName: "string",
name: "string",
postStartupScript: "string",
project: "string",
vmImage: {
project: "string",
imageFamily: "string",
imageName: "string",
},
});
type: gcp:notebooks:Environment
properties:
containerImage:
repository: string
tag: string
description: string
displayName: string
location: string
name: string
postStartupScript: string
project: string
vmImage:
imageFamily: string
imageName: string
project: string
Environment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Environment resource accepts the following input properties:
- Location string
- A reference to the zone where the machine resides.
- Container
Image EnvironmentContainer Image - Use a container image to start the notebook instance. Structure is documented below.
- Description string
- A brief description of this environment.
- Display
Name string - Display name of this environment for the UI.
- Name string
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- Post
Startup stringScript - 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"
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Vm
Image EnvironmentVm Image - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
- Location string
- A reference to the zone where the machine resides.
- Container
Image EnvironmentContainer Image Args - Use a container image to start the notebook instance. Structure is documented below.
- Description string
- A brief description of this environment.
- Display
Name string - Display name of this environment for the UI.
- Name string
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- Post
Startup stringScript - 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"
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Vm
Image EnvironmentVm Image Args - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
- location String
- A reference to the zone where the machine resides.
- container
Image EnvironmentContainer Image - Use a container image to start the notebook instance. Structure is documented below.
- description String
- A brief description of this environment.
- display
Name String - Display name of this environment for the UI.
- name String
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- post
Startup StringScript - 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"
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- vm
Image EnvironmentVm Image - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
- location string
- A reference to the zone where the machine resides.
- container
Image EnvironmentContainer Image - Use a container image to start the notebook instance. Structure is documented below.
- description string
- A brief description of this environment.
- display
Name string - Display name of this environment for the UI.
- name string
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- post
Startup stringScript - 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"
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- vm
Image EnvironmentVm Image - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
- location str
- A reference to the zone where the machine resides.
- container_
image EnvironmentContainer Image Args - Use a container image to start the notebook instance. Structure is documented below.
- description str
- A brief description of this environment.
- display_
name str - Display name of this environment for the UI.
- name str
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- post_
startup_ strscript - 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"
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- vm_
image EnvironmentVm Image Args - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
- location String
- A reference to the zone where the machine resides.
- container
Image Property Map - Use a container image to start the notebook instance. Structure is documented below.
- description String
- A brief description of this environment.
- display
Name String - Display name of this environment for the UI.
- name String
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- post
Startup StringScript - 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"
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- vm
Image Property Map - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the Environment resource produces the following output properties:
- Create
Time string - Instance creation time
- Id string
- The provider-assigned unique ID for this managed resource.
- Create
Time string - Instance creation time
- Id string
- The provider-assigned unique ID for this managed resource.
- create
Time String - Instance creation time
- id String
- The provider-assigned unique ID for this managed resource.
- create
Time string - Instance creation time
- id string
- The provider-assigned unique ID for this managed resource.
- create_
time str - Instance creation time
- id str
- The provider-assigned unique ID for this managed resource.
- create
Time String - Instance creation time
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Environment Resource
Get an existing Environment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: EnvironmentState, opts?: CustomResourceOptions): Environment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
container_image: Optional[EnvironmentContainerImageArgs] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
post_startup_script: Optional[str] = None,
project: Optional[str] = None,
vm_image: Optional[EnvironmentVmImageArgs] = None) -> Environment
func GetEnvironment(ctx *Context, name string, id IDInput, state *EnvironmentState, opts ...ResourceOption) (*Environment, error)
public static Environment Get(string name, Input<string> id, EnvironmentState? state, CustomResourceOptions? opts = null)
public static Environment get(String name, Output<String> id, EnvironmentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Container
Image EnvironmentContainer Image - Use a container image to start the notebook instance. Structure is documented below.
- Create
Time string - Instance creation time
- Description string
- A brief description of this environment.
- Display
Name string - Display name of this environment for the UI.
- Location string
- A reference to the zone where the machine resides.
- Name string
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- Post
Startup stringScript - 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"
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Vm
Image EnvironmentVm Image - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
- Container
Image EnvironmentContainer Image Args - Use a container image to start the notebook instance. Structure is documented below.
- Create
Time string - Instance creation time
- Description string
- A brief description of this environment.
- Display
Name string - Display name of this environment for the UI.
- Location string
- A reference to the zone where the machine resides.
- Name string
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- Post
Startup stringScript - 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"
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Vm
Image EnvironmentVm Image Args - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
- container
Image EnvironmentContainer Image - Use a container image to start the notebook instance. Structure is documented below.
- create
Time String - Instance creation time
- description String
- A brief description of this environment.
- display
Name String - Display name of this environment for the UI.
- location String
- A reference to the zone where the machine resides.
- name String
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- post
Startup StringScript - 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"
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- vm
Image EnvironmentVm Image - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
- container
Image EnvironmentContainer Image - Use a container image to start the notebook instance. Structure is documented below.
- create
Time string - Instance creation time
- description string
- A brief description of this environment.
- display
Name string - Display name of this environment for the UI.
- location string
- A reference to the zone where the machine resides.
- name string
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- post
Startup stringScript - 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"
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- vm
Image EnvironmentVm Image - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
- container_
image EnvironmentContainer Image Args - Use a container image to start the notebook instance. Structure is documented below.
- create_
time str - Instance creation time
- description str
- A brief description of this environment.
- display_
name str - Display name of this environment for the UI.
- location str
- A reference to the zone where the machine resides.
- name str
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- post_
startup_ strscript - 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"
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- vm_
image EnvironmentVm Image Args - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
- container
Image Property Map - Use a container image to start the notebook instance. Structure is documented below.
- create
Time String - Instance creation time
- description String
- A brief description of this environment.
- display
Name String - Display name of this environment for the UI.
- location String
- A reference to the zone where the machine resides.
- name String
- The name specified for the Environment instance. Format: projects/{project_id}/locations/{location}/environments/{environmentId}
- post
Startup StringScript - 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"
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- vm
Image Property Map - Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
Supporting Types
EnvironmentContainerImage, EnvironmentContainerImageArgs
- Repository string
- The path to the container image repository. For example: gcr.io/{project_id}/{imageName}
- Tag string
- The tag of the container image. If not specified, this defaults to the latest tag.
- Repository string
- The path to the container image repository. For example: gcr.io/{project_id}/{imageName}
- Tag string
- The tag of the container image. If not specified, this defaults to the latest tag.
- repository String
- The path to the container image repository. For example: gcr.io/{project_id}/{imageName}
- tag String
- The tag of the container image. If not specified, this defaults to the latest tag.
- repository string
- The path to the container image repository. For example: gcr.io/{project_id}/{imageName}
- tag string
- The tag of the container image. If not specified, this defaults to the latest tag.
- repository str
- The path to the container image repository. For example: gcr.io/{project_id}/{imageName}
- tag str
- The tag of the container image. If not specified, this defaults to the latest tag.
- repository String
- The path to the container image repository. For example: gcr.io/{project_id}/{imageName}
- tag String
- The tag of the container image. If not specified, this defaults to the latest tag.
EnvironmentVmImage, EnvironmentVmImageArgs
- Project string
- The name of the Google Cloud project that this VM image belongs to. Format: projects/{project_id}
- Image
Family string - Use this VM image family to find the image; the newest image in this family will be used.
- Image
Name string - Use VM image name to find the image.
- Project string
- The name of the Google Cloud project that this VM image belongs to. Format: projects/{project_id}
- Image
Family string - Use this VM image family to find the image; the newest image in this family will be used.
- Image
Name string - Use VM image name to find the image.
- project String
- The name of the Google Cloud project that this VM image belongs to. Format: projects/{project_id}
- image
Family String - Use this VM image family to find the image; the newest image in this family will be used.
- image
Name String - Use VM image name to find the image.
- project string
- The name of the Google Cloud project that this VM image belongs to. Format: projects/{project_id}
- image
Family string - Use this VM image family to find the image; the newest image in this family will be used.
- image
Name string - Use VM image name to find the image.
- project str
- The name of the Google Cloud project that this VM image belongs to. Format: projects/{project_id}
- image_
family str - Use this VM image family to find the image; the newest image in this family will be used.
- image_
name str - Use VM image name to find the image.
- project String
- The name of the Google Cloud project that this VM image belongs to. Format: projects/{project_id}
- image
Family String - Use this VM image family to find the image; the newest image in this family will be used.
- image
Name String - Use VM image name to find the image.
Import
Environment can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/environments/{{name}}
{{project}}/{{location}}/{{name}}
{{location}}/{{name}}
When using the pulumi import
command, Environment can be imported using one of the formats above. For example:
$ pulumi import gcp:notebooks/environment:Environment default projects/{{project}}/locations/{{location}}/environments/{{name}}
$ pulumi import gcp:notebooks/environment:Environment default {{project}}/{{location}}/{{name}}
$ pulumi import gcp:notebooks/environment:Environment default {{location}}/{{name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.