1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. notebooks
  5. Environment
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.notebooks.Environment

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    A Cloud AI Platform Notebook environment.

    To get more information about Environment, see:

    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={
            "repository": "gcr.io/deeplearning-platform-release/base-cpu",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/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", &notebooks.EnvironmentArgs{
    			Name:     pulumi.String("notebooks-environment"),
    			Location: pulumi.String("us-west1-a"),
    			ContainerImage: &notebooks.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", &notebooks.EnvironmentArgs{
    	Location: pulumi.String("string"),
    	ContainerImage: &notebooks.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: &notebooks.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={
            "repository": "string",
            "tag": "string",
        },
        description="string",
        display_name="string",
        name="string",
        post_startup_script="string",
        project="string",
        vm_image={
            "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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Environment resource accepts the following input properties:

    Location string
    A reference to the zone where the machine resides.


    ContainerImage EnvironmentContainerImage
    Use a container image to start the notebook instance. Structure is documented below.
    Description string
    A brief description of this environment.
    DisplayName 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}
    PostStartupScript string
    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.
    VmImage EnvironmentVmImage
    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.


    ContainerImage EnvironmentContainerImageArgs
    Use a container image to start the notebook instance. Structure is documented below.
    Description string
    A brief description of this environment.
    DisplayName 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}
    PostStartupScript string
    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.
    VmImage EnvironmentVmImageArgs
    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.


    containerImage EnvironmentContainerImage
    Use a container image to start the notebook instance. Structure is documented below.
    description String
    A brief description of this environment.
    displayName 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}
    postStartupScript String
    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.
    vmImage EnvironmentVmImage
    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.


    containerImage EnvironmentContainerImage
    Use a container image to start the notebook instance. Structure is documented below.
    description string
    A brief description of this environment.
    displayName 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}
    postStartupScript string
    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.
    vmImage EnvironmentVmImage
    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 EnvironmentContainerImageArgs
    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_script str
    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 EnvironmentVmImageArgs
    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.


    containerImage Property Map
    Use a container image to start the notebook instance. Structure is documented below.
    description String
    A brief description of this environment.
    displayName 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}
    postStartupScript String
    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.
    vmImage 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:

    CreateTime string
    Instance creation time
    Id string
    The provider-assigned unique ID for this managed resource.
    CreateTime string
    Instance creation time
    Id string
    The provider-assigned unique ID for this managed resource.
    createTime String
    Instance creation time
    id String
    The provider-assigned unique ID for this managed resource.
    createTime 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.
    createTime 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.
    The following state arguments are supported:
    ContainerImage EnvironmentContainerImage
    Use a container image to start the notebook instance. Structure is documented below.
    CreateTime string
    Instance creation time
    Description string
    A brief description of this environment.
    DisplayName 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}
    PostStartupScript string
    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.
    VmImage EnvironmentVmImage
    Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
    ContainerImage EnvironmentContainerImageArgs
    Use a container image to start the notebook instance. Structure is documented below.
    CreateTime string
    Instance creation time
    Description string
    A brief description of this environment.
    DisplayName 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}
    PostStartupScript string
    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.
    VmImage EnvironmentVmImageArgs
    Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
    containerImage EnvironmentContainerImage
    Use a container image to start the notebook instance. Structure is documented below.
    createTime String
    Instance creation time
    description String
    A brief description of this environment.
    displayName 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}
    postStartupScript String
    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.
    vmImage EnvironmentVmImage
    Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
    containerImage EnvironmentContainerImage
    Use a container image to start the notebook instance. Structure is documented below.
    createTime string
    Instance creation time
    description string
    A brief description of this environment.
    displayName 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}
    postStartupScript string
    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.
    vmImage EnvironmentVmImage
    Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
    container_image EnvironmentContainerImageArgs
    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_script str
    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 EnvironmentVmImageArgs
    Use a Compute Engine VM image to start the notebook instance. Structure is documented below.
    containerImage Property Map
    Use a container image to start the notebook instance. Structure is documented below.
    createTime String
    Instance creation time
    description String
    A brief description of this environment.
    displayName 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}
    postStartupScript String
    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.
    vmImage 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}
    ImageFamily string
    Use this VM image family to find the image; the newest image in this family will be used.
    ImageName 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}
    ImageFamily string
    Use this VM image family to find the image; the newest image in this family will be used.
    ImageName 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}
    imageFamily String
    Use this VM image family to find the image; the newest image in this family will be used.
    imageName 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}
    imageFamily string
    Use this VM image family to find the image; the newest image in this family will be used.
    imageName 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}
    imageFamily String
    Use this VM image family to find the image; the newest image in this family will be used.
    imageName 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.
    gcp logo
    Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi