1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. colab
  5. NotebookExecution
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.colab.NotebookExecution

Explore with Pulumi AI

‘An instance of a notebook Execution’

To get more information about NotebookExecution, see:

Example Usage

Colab Notebook Execution Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import * as std from "@pulumi/std";

const myRuntimeTemplate = new gcp.colab.RuntimeTemplate("my_runtime_template", {
    name: "runtime-template-name",
    displayName: "Runtime template",
    location: "us-central1",
    machineSpec: {
        machineType: "e2-standard-4",
    },
    networkSpec: {
        enableInternetAccess: true,
    },
});
const outputBucket = new gcp.storage.Bucket("output_bucket", {
    name: "my_bucket",
    location: "US",
    forceDestroy: true,
    uniformBucketLevelAccess: true,
});
const notebook_execution = new gcp.colab.NotebookExecution("notebook-execution", {
    displayName: "Notebook execution basic",
    location: "us-central1",
    directNotebookSource: {
        content: std.base64encode({
            input: `    {
      "cells": [
        {
          "cell_type": "code",
          "execution_count": null,
          "metadata": {},
          "outputs": [],
          "source": [
            "print(\\"Hello, World!\\")"
          ]
        }
      ],
      "metadata": {
        "kernelspec": {
          "display_name": "Python 3",
          "language": "python",
          "name": "python3"
        },
        "language_info": {
          "codemirror_mode": {
            "name": "ipython",
            "version": 3
          },
          "file_extension": ".py",
          "mimetype": "text/x-python",
          "name": "python",
          "nbconvert_exporter": "python",
          "pygments_lexer": "ipython3",
          "version": "3.8.5"
        }
      },
      "nbformat": 4,
      "nbformat_minor": 4
    }
`,
        }).then(invoke => invoke.result),
    },
    notebookRuntimeTemplateResourceName: pulumi.interpolate`projects/${myRuntimeTemplate.project}/locations/${myRuntimeTemplate.location}/notebookRuntimeTemplates/${myRuntimeTemplate.name}`,
    gcsOutputUri: pulumi.interpolate`gs://${outputBucket.name}`,
    serviceAccount: "my@service-account.com",
}, {
    dependsOn: [
        myRuntimeTemplate,
        outputBucket,
    ],
});
Copy
import pulumi
import pulumi_gcp as gcp
import pulumi_std as std

my_runtime_template = gcp.colab.RuntimeTemplate("my_runtime_template",
    name="runtime-template-name",
    display_name="Runtime template",
    location="us-central1",
    machine_spec={
        "machine_type": "e2-standard-4",
    },
    network_spec={
        "enable_internet_access": True,
    })
output_bucket = gcp.storage.Bucket("output_bucket",
    name="my_bucket",
    location="US",
    force_destroy=True,
    uniform_bucket_level_access=True)
notebook_execution = gcp.colab.NotebookExecution("notebook-execution",
    display_name="Notebook execution basic",
    location="us-central1",
    direct_notebook_source={
        "content": std.base64encode(input="""    {
      "cells": [
        {
          "cell_type": "code",
          "execution_count": null,
          "metadata": {},
          "outputs": [],
          "source": [
            "print(\"Hello, World!\")"
          ]
        }
      ],
      "metadata": {
        "kernelspec": {
          "display_name": "Python 3",
          "language": "python",
          "name": "python3"
        },
        "language_info": {
          "codemirror_mode": {
            "name": "ipython",
            "version": 3
          },
          "file_extension": ".py",
          "mimetype": "text/x-python",
          "name": "python",
          "nbconvert_exporter": "python",
          "pygments_lexer": "ipython3",
          "version": "3.8.5"
        }
      },
      "nbformat": 4,
      "nbformat_minor": 4
    }
""").result,
    },
    notebook_runtime_template_resource_name=pulumi.Output.all(
        project=my_runtime_template.project,
        location=my_runtime_template.location,
        name=my_runtime_template.name
).apply(lambda resolved_outputs: f"projects/{resolved_outputs['project']}/locations/{resolved_outputs['location']}/notebookRuntimeTemplates/{resolved_outputs['name']}")
,
    gcs_output_uri=output_bucket.name.apply(lambda name: f"gs://{name}"),
    service_account="my@service-account.com",
    opts = pulumi.ResourceOptions(depends_on=[
            my_runtime_template,
            output_bucket,
        ]))
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/colab"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/storage"
	"github.com/pulumi/pulumi-std/sdk/go/std"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		myRuntimeTemplate, err := colab.NewRuntimeTemplate(ctx, "my_runtime_template", &colab.RuntimeTemplateArgs{
			Name:        pulumi.String("runtime-template-name"),
			DisplayName: pulumi.String("Runtime template"),
			Location:    pulumi.String("us-central1"),
			MachineSpec: &colab.RuntimeTemplateMachineSpecArgs{
				MachineType: pulumi.String("e2-standard-4"),
			},
			NetworkSpec: &colab.RuntimeTemplateNetworkSpecArgs{
				EnableInternetAccess: pulumi.Bool(true),
			},
		})
		if err != nil {
			return err
		}
		outputBucket, err := storage.NewBucket(ctx, "output_bucket", &storage.BucketArgs{
			Name:                     pulumi.String("my_bucket"),
			Location:                 pulumi.String("US"),
			ForceDestroy:             pulumi.Bool(true),
			UniformBucketLevelAccess: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		invokeBase64encode, err := std.Base64encode(ctx, &std.Base64encodeArgs{
			Input: `    {
      "cells": [
        {
          "cell_type": "code",
          "execution_count": null,
          "metadata": {},
          "outputs": [],
          "source": [
            "print(\"Hello, World!\")"
          ]
        }
      ],
      "metadata": {
        "kernelspec": {
          "display_name": "Python 3",
          "language": "python",
          "name": "python3"
        },
        "language_info": {
          "codemirror_mode": {
            "name": "ipython",
            "version": 3
          },
          "file_extension": ".py",
          "mimetype": "text/x-python",
          "name": "python",
          "nbconvert_exporter": "python",
          "pygments_lexer": "ipython3",
          "version": "3.8.5"
        }
      },
      "nbformat": 4,
      "nbformat_minor": 4
    }
`,
		}, nil)
		if err != nil {
			return err
		}
		_, err = colab.NewNotebookExecution(ctx, "notebook-execution", &colab.NotebookExecutionArgs{
			DisplayName: pulumi.String("Notebook execution basic"),
			Location:    pulumi.String("us-central1"),
			DirectNotebookSource: &colab.NotebookExecutionDirectNotebookSourceArgs{
				Content: pulumi.String(invokeBase64encode.Result),
			},
			NotebookRuntimeTemplateResourceName: pulumi.All(myRuntimeTemplate.Project, myRuntimeTemplate.Location, myRuntimeTemplate.Name).ApplyT(func(_args []interface{}) (string, error) {
				project := _args[0].(string)
				location := _args[1].(string)
				name := _args[2].(string)
				return fmt.Sprintf("projects/%v/locations/%v/notebookRuntimeTemplates/%v", project, location, name), nil
			}).(pulumi.StringOutput),
			GcsOutputUri: outputBucket.Name.ApplyT(func(name string) (string, error) {
				return fmt.Sprintf("gs://%v", name), nil
			}).(pulumi.StringOutput),
			ServiceAccount: pulumi.String("my@service-account.com"),
		}, pulumi.DependsOn([]pulumi.Resource{
			myRuntimeTemplate,
			outputBucket,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
using Std = Pulumi.Std;

return await Deployment.RunAsync(() => 
{
    var myRuntimeTemplate = new Gcp.Colab.RuntimeTemplate("my_runtime_template", new()
    {
        Name = "runtime-template-name",
        DisplayName = "Runtime template",
        Location = "us-central1",
        MachineSpec = new Gcp.Colab.Inputs.RuntimeTemplateMachineSpecArgs
        {
            MachineType = "e2-standard-4",
        },
        NetworkSpec = new Gcp.Colab.Inputs.RuntimeTemplateNetworkSpecArgs
        {
            EnableInternetAccess = true,
        },
    });

    var outputBucket = new Gcp.Storage.Bucket("output_bucket", new()
    {
        Name = "my_bucket",
        Location = "US",
        ForceDestroy = true,
        UniformBucketLevelAccess = true,
    });

    var notebook_execution = new Gcp.Colab.NotebookExecution("notebook-execution", new()
    {
        DisplayName = "Notebook execution basic",
        Location = "us-central1",
        DirectNotebookSource = new Gcp.Colab.Inputs.NotebookExecutionDirectNotebookSourceArgs
        {
            Content = Std.Base64encode.Invoke(new()
            {
                Input = @"    {
      ""cells"": [
        {
          ""cell_type"": ""code"",
          ""execution_count"": null,
          ""metadata"": {},
          ""outputs"": [],
          ""source"": [
            ""print(\""Hello, World!\"")""
          ]
        }
      ],
      ""metadata"": {
        ""kernelspec"": {
          ""display_name"": ""Python 3"",
          ""language"": ""python"",
          ""name"": ""python3""
        },
        ""language_info"": {
          ""codemirror_mode"": {
            ""name"": ""ipython"",
            ""version"": 3
          },
          ""file_extension"": "".py"",
          ""mimetype"": ""text/x-python"",
          ""name"": ""python"",
          ""nbconvert_exporter"": ""python"",
          ""pygments_lexer"": ""ipython3"",
          ""version"": ""3.8.5""
        }
      },
      ""nbformat"": 4,
      ""nbformat_minor"": 4
    }
",
            }).Apply(invoke => invoke.Result),
        },
        NotebookRuntimeTemplateResourceName = Output.Tuple(myRuntimeTemplate.Project, myRuntimeTemplate.Location, myRuntimeTemplate.Name).Apply(values =>
        {
            var project = values.Item1;
            var location = values.Item2;
            var name = values.Item3;
            return $"projects/{project}/locations/{location}/notebookRuntimeTemplates/{name}";
        }),
        GcsOutputUri = outputBucket.Name.Apply(name => $"gs://{name}"),
        ServiceAccount = "my@service-account.com",
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            myRuntimeTemplate,
            outputBucket,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.colab.RuntimeTemplate;
import com.pulumi.gcp.colab.RuntimeTemplateArgs;
import com.pulumi.gcp.colab.inputs.RuntimeTemplateMachineSpecArgs;
import com.pulumi.gcp.colab.inputs.RuntimeTemplateNetworkSpecArgs;
import com.pulumi.gcp.storage.Bucket;
import com.pulumi.gcp.storage.BucketArgs;
import com.pulumi.gcp.colab.NotebookExecution;
import com.pulumi.gcp.colab.NotebookExecutionArgs;
import com.pulumi.gcp.colab.inputs.NotebookExecutionDirectNotebookSourceArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.Base64encodeArgs;
import com.pulumi.resources.CustomResourceOptions;
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 myRuntimeTemplate = new RuntimeTemplate("myRuntimeTemplate", RuntimeTemplateArgs.builder()
            .name("runtime-template-name")
            .displayName("Runtime template")
            .location("us-central1")
            .machineSpec(RuntimeTemplateMachineSpecArgs.builder()
                .machineType("e2-standard-4")
                .build())
            .networkSpec(RuntimeTemplateNetworkSpecArgs.builder()
                .enableInternetAccess(true)
                .build())
            .build());

        var outputBucket = new Bucket("outputBucket", BucketArgs.builder()
            .name("my_bucket")
            .location("US")
            .forceDestroy(true)
            .uniformBucketLevelAccess(true)
            .build());

        var notebook_execution = new NotebookExecution("notebook-execution", NotebookExecutionArgs.builder()
            .displayName("Notebook execution basic")
            .location("us-central1")
            .directNotebookSource(NotebookExecutionDirectNotebookSourceArgs.builder()
                .content(StdFunctions.base64encode(Base64encodeArgs.builder()
                    .input("""
    {
      "cells": [
        {
          "cell_type": "code",
          "execution_count": null,
          "metadata": {},
          "outputs": [],
          "source": [
            "print(\"Hello, World!\")"
          ]
        }
      ],
      "metadata": {
        "kernelspec": {
          "display_name": "Python 3",
          "language": "python",
          "name": "python3"
        },
        "language_info": {
          "codemirror_mode": {
            "name": "ipython",
            "version": 3
          },
          "file_extension": ".py",
          "mimetype": "text/x-python",
          "name": "python",
          "nbconvert_exporter": "python",
          "pygments_lexer": "ipython3",
          "version": "3.8.5"
        }
      },
      "nbformat": 4,
      "nbformat_minor": 4
    }
                    """)
                    .build()).result())
                .build())
            .notebookRuntimeTemplateResourceName(Output.tuple(myRuntimeTemplate.project(), myRuntimeTemplate.location(), myRuntimeTemplate.name()).applyValue(values -> {
                var project = values.t1;
                var location = values.t2;
                var name = values.t3;
                return String.format("projects/%s/locations/%s/notebookRuntimeTemplates/%s", project,location,name);
            }))
            .gcsOutputUri(outputBucket.name().applyValue(_name -> String.format("gs://%s", _name)))
            .serviceAccount("my@service-account.com")
            .build(), CustomResourceOptions.builder()
                .dependsOn(                
                    myRuntimeTemplate,
                    outputBucket)
                .build());

    }
}
Copy
resources:
  myRuntimeTemplate:
    type: gcp:colab:RuntimeTemplate
    name: my_runtime_template
    properties:
      name: runtime-template-name
      displayName: Runtime template
      location: us-central1
      machineSpec:
        machineType: e2-standard-4
      networkSpec:
        enableInternetAccess: true
  outputBucket:
    type: gcp:storage:Bucket
    name: output_bucket
    properties:
      name: my_bucket
      location: US
      forceDestroy: true
      uniformBucketLevelAccess: true
  notebook-execution:
    type: gcp:colab:NotebookExecution
    properties:
      displayName: Notebook execution basic
      location: us-central1
      directNotebookSource:
        content:
          fn::invoke:
            function: std:base64encode
            arguments:
              input: |2
                    {
                      "cells": [
                        {
                          "cell_type": "code",
                          "execution_count": null,
                          "metadata": {},
                          "outputs": [],
                          "source": [
                            "print(\"Hello, World!\")"
                          ]
                        }
                      ],
                      "metadata": {
                        "kernelspec": {
                          "display_name": "Python 3",
                          "language": "python",
                          "name": "python3"
                        },
                        "language_info": {
                          "codemirror_mode": {
                            "name": "ipython",
                            "version": 3
                          },
                          "file_extension": ".py",
                          "mimetype": "text/x-python",
                          "name": "python",
                          "nbconvert_exporter": "python",
                          "pygments_lexer": "ipython3",
                          "version": "3.8.5"
                        }
                      },
                      "nbformat": 4,
                      "nbformat_minor": 4
                    }
            return: result
      notebookRuntimeTemplateResourceName: projects/${myRuntimeTemplate.project}/locations/${myRuntimeTemplate.location}/notebookRuntimeTemplates/${myRuntimeTemplate.name}
      gcsOutputUri: gs://${outputBucket.name}
      serviceAccount: my@service-account.com
    options:
      dependsOn:
        - ${myRuntimeTemplate}
        - ${outputBucket}
Copy

Colab Notebook Execution Full

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const myRuntimeTemplate = new gcp.colab.RuntimeTemplate("my_runtime_template", {
    name: "runtime-template-name",
    displayName: "Runtime template",
    location: "us-central1",
    machineSpec: {
        machineType: "e2-standard-4",
    },
    networkSpec: {
        enableInternetAccess: true,
    },
});
const outputBucket = new gcp.storage.Bucket("output_bucket", {
    name: "my_bucket",
    location: "US",
    forceDestroy: true,
    uniformBucketLevelAccess: true,
});
const notebook = new gcp.storage.BucketObject("notebook", {
    name: "hello_world.ipynb",
    bucket: outputBucket.name,
    content: `    {
      "cells": [
        {
          "cell_type": "code",
          "execution_count": null,
          "metadata": {},
          "outputs": [],
          "source": [
            "print(\\"Hello, World!\\")"
          ]
        }
      ],
      "metadata": {
        "kernelspec": {
          "display_name": "Python 3",
          "language": "python",
          "name": "python3"
        },
        "language_info": {
          "codemirror_mode": {
            "name": "ipython",
            "version": 3
          },
          "file_extension": ".py",
          "mimetype": "text/x-python",
          "name": "python",
          "nbconvert_exporter": "python",
          "pygments_lexer": "ipython3",
          "version": "3.8.5"
        }
      },
      "nbformat": 4,
      "nbformat_minor": 4
    }
`,
});
const notebook_execution = new gcp.colab.NotebookExecution("notebook-execution", {
    notebookExecutionJobId: "colab-notebook-execution",
    displayName: "Notebook execution full",
    location: "us-central1",
    executionTimeout: "86400s",
    gcsNotebookSource: {
        uri: pulumi.interpolate`gs://${notebook.bucket}/${notebook.name}`,
        generation: notebook.generation,
    },
    serviceAccount: "my@service-account.com",
    gcsOutputUri: pulumi.interpolate`gs://${outputBucket.name}`,
    notebookRuntimeTemplateResourceName: pulumi.interpolate`projects/${myRuntimeTemplate.project}/locations/${myRuntimeTemplate.location}/notebookRuntimeTemplates/${myRuntimeTemplate.name}`,
}, {
    dependsOn: [
        notebook,
        outputBucket,
        myRuntimeTemplate,
    ],
});
Copy
import pulumi
import pulumi_gcp as gcp

my_runtime_template = gcp.colab.RuntimeTemplate("my_runtime_template",
    name="runtime-template-name",
    display_name="Runtime template",
    location="us-central1",
    machine_spec={
        "machine_type": "e2-standard-4",
    },
    network_spec={
        "enable_internet_access": True,
    })
output_bucket = gcp.storage.Bucket("output_bucket",
    name="my_bucket",
    location="US",
    force_destroy=True,
    uniform_bucket_level_access=True)
notebook = gcp.storage.BucketObject("notebook",
    name="hello_world.ipynb",
    bucket=output_bucket.name,
    content="""    {
      "cells": [
        {
          "cell_type": "code",
          "execution_count": null,
          "metadata": {},
          "outputs": [],
          "source": [
            "print(\"Hello, World!\")"
          ]
        }
      ],
      "metadata": {
        "kernelspec": {
          "display_name": "Python 3",
          "language": "python",
          "name": "python3"
        },
        "language_info": {
          "codemirror_mode": {
            "name": "ipython",
            "version": 3
          },
          "file_extension": ".py",
          "mimetype": "text/x-python",
          "name": "python",
          "nbconvert_exporter": "python",
          "pygments_lexer": "ipython3",
          "version": "3.8.5"
        }
      },
      "nbformat": 4,
      "nbformat_minor": 4
    }
""")
notebook_execution = gcp.colab.NotebookExecution("notebook-execution",
    notebook_execution_job_id="colab-notebook-execution",
    display_name="Notebook execution full",
    location="us-central1",
    execution_timeout="86400s",
    gcs_notebook_source={
        "uri": pulumi.Output.all(
            bucket=notebook.bucket,
            name=notebook.name
).apply(lambda resolved_outputs: f"gs://{resolved_outputs['bucket']}/{resolved_outputs['name']}")
,
        "generation": notebook.generation,
    },
    service_account="my@service-account.com",
    gcs_output_uri=output_bucket.name.apply(lambda name: f"gs://{name}"),
    notebook_runtime_template_resource_name=pulumi.Output.all(
        project=my_runtime_template.project,
        location=my_runtime_template.location,
        name=my_runtime_template.name
).apply(lambda resolved_outputs: f"projects/{resolved_outputs['project']}/locations/{resolved_outputs['location']}/notebookRuntimeTemplates/{resolved_outputs['name']}")
,
    opts = pulumi.ResourceOptions(depends_on=[
            notebook,
            output_bucket,
            my_runtime_template,
        ]))
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/colab"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		myRuntimeTemplate, err := colab.NewRuntimeTemplate(ctx, "my_runtime_template", &colab.RuntimeTemplateArgs{
			Name:        pulumi.String("runtime-template-name"),
			DisplayName: pulumi.String("Runtime template"),
			Location:    pulumi.String("us-central1"),
			MachineSpec: &colab.RuntimeTemplateMachineSpecArgs{
				MachineType: pulumi.String("e2-standard-4"),
			},
			NetworkSpec: &colab.RuntimeTemplateNetworkSpecArgs{
				EnableInternetAccess: pulumi.Bool(true),
			},
		})
		if err != nil {
			return err
		}
		outputBucket, err := storage.NewBucket(ctx, "output_bucket", &storage.BucketArgs{
			Name:                     pulumi.String("my_bucket"),
			Location:                 pulumi.String("US"),
			ForceDestroy:             pulumi.Bool(true),
			UniformBucketLevelAccess: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		notebook, err := storage.NewBucketObject(ctx, "notebook", &storage.BucketObjectArgs{
			Name:   pulumi.String("hello_world.ipynb"),
			Bucket: outputBucket.Name,
			Content: pulumi.String(`    {
      "cells": [
        {
          "cell_type": "code",
          "execution_count": null,
          "metadata": {},
          "outputs": [],
          "source": [
            "print(\"Hello, World!\")"
          ]
        }
      ],
      "metadata": {
        "kernelspec": {
          "display_name": "Python 3",
          "language": "python",
          "name": "python3"
        },
        "language_info": {
          "codemirror_mode": {
            "name": "ipython",
            "version": 3
          },
          "file_extension": ".py",
          "mimetype": "text/x-python",
          "name": "python",
          "nbconvert_exporter": "python",
          "pygments_lexer": "ipython3",
          "version": "3.8.5"
        }
      },
      "nbformat": 4,
      "nbformat_minor": 4
    }
`),
		})
		if err != nil {
			return err
		}
		_, err = colab.NewNotebookExecution(ctx, "notebook-execution", &colab.NotebookExecutionArgs{
			NotebookExecutionJobId: pulumi.String("colab-notebook-execution"),
			DisplayName:            pulumi.String("Notebook execution full"),
			Location:               pulumi.String("us-central1"),
			ExecutionTimeout:       pulumi.String("86400s"),
			GcsNotebookSource: &colab.NotebookExecutionGcsNotebookSourceArgs{
				Uri: pulumi.All(notebook.Bucket, notebook.Name).ApplyT(func(_args []interface{}) (string, error) {
					bucket := _args[0].(string)
					name := _args[1].(string)
					return fmt.Sprintf("gs://%v/%v", bucket, name), nil
				}).(pulumi.StringOutput),
				Generation: notebook.Generation,
			},
			ServiceAccount: pulumi.String("my@service-account.com"),
			GcsOutputUri: outputBucket.Name.ApplyT(func(name string) (string, error) {
				return fmt.Sprintf("gs://%v", name), nil
			}).(pulumi.StringOutput),
			NotebookRuntimeTemplateResourceName: pulumi.All(myRuntimeTemplate.Project, myRuntimeTemplate.Location, myRuntimeTemplate.Name).ApplyT(func(_args []interface{}) (string, error) {
				project := _args[0].(string)
				location := _args[1].(string)
				name := _args[2].(string)
				return fmt.Sprintf("projects/%v/locations/%v/notebookRuntimeTemplates/%v", project, location, name), nil
			}).(pulumi.StringOutput),
		}, pulumi.DependsOn([]pulumi.Resource{
			notebook,
			outputBucket,
			myRuntimeTemplate,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var myRuntimeTemplate = new Gcp.Colab.RuntimeTemplate("my_runtime_template", new()
    {
        Name = "runtime-template-name",
        DisplayName = "Runtime template",
        Location = "us-central1",
        MachineSpec = new Gcp.Colab.Inputs.RuntimeTemplateMachineSpecArgs
        {
            MachineType = "e2-standard-4",
        },
        NetworkSpec = new Gcp.Colab.Inputs.RuntimeTemplateNetworkSpecArgs
        {
            EnableInternetAccess = true,
        },
    });

    var outputBucket = new Gcp.Storage.Bucket("output_bucket", new()
    {
        Name = "my_bucket",
        Location = "US",
        ForceDestroy = true,
        UniformBucketLevelAccess = true,
    });

    var notebook = new Gcp.Storage.BucketObject("notebook", new()
    {
        Name = "hello_world.ipynb",
        Bucket = outputBucket.Name,
        Content = @"    {
      ""cells"": [
        {
          ""cell_type"": ""code"",
          ""execution_count"": null,
          ""metadata"": {},
          ""outputs"": [],
          ""source"": [
            ""print(\""Hello, World!\"")""
          ]
        }
      ],
      ""metadata"": {
        ""kernelspec"": {
          ""display_name"": ""Python 3"",
          ""language"": ""python"",
          ""name"": ""python3""
        },
        ""language_info"": {
          ""codemirror_mode"": {
            ""name"": ""ipython"",
            ""version"": 3
          },
          ""file_extension"": "".py"",
          ""mimetype"": ""text/x-python"",
          ""name"": ""python"",
          ""nbconvert_exporter"": ""python"",
          ""pygments_lexer"": ""ipython3"",
          ""version"": ""3.8.5""
        }
      },
      ""nbformat"": 4,
      ""nbformat_minor"": 4
    }
",
    });

    var notebook_execution = new Gcp.Colab.NotebookExecution("notebook-execution", new()
    {
        NotebookExecutionJobId = "colab-notebook-execution",
        DisplayName = "Notebook execution full",
        Location = "us-central1",
        ExecutionTimeout = "86400s",
        GcsNotebookSource = new Gcp.Colab.Inputs.NotebookExecutionGcsNotebookSourceArgs
        {
            Uri = Output.Tuple(notebook.Bucket, notebook.Name).Apply(values =>
            {
                var bucket = values.Item1;
                var name = values.Item2;
                return $"gs://{bucket}/{name}";
            }),
            Generation = notebook.Generation,
        },
        ServiceAccount = "my@service-account.com",
        GcsOutputUri = outputBucket.Name.Apply(name => $"gs://{name}"),
        NotebookRuntimeTemplateResourceName = Output.Tuple(myRuntimeTemplate.Project, myRuntimeTemplate.Location, myRuntimeTemplate.Name).Apply(values =>
        {
            var project = values.Item1;
            var location = values.Item2;
            var name = values.Item3;
            return $"projects/{project}/locations/{location}/notebookRuntimeTemplates/{name}";
        }),
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            notebook,
            outputBucket,
            myRuntimeTemplate,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.colab.RuntimeTemplate;
import com.pulumi.gcp.colab.RuntimeTemplateArgs;
import com.pulumi.gcp.colab.inputs.RuntimeTemplateMachineSpecArgs;
import com.pulumi.gcp.colab.inputs.RuntimeTemplateNetworkSpecArgs;
import com.pulumi.gcp.storage.Bucket;
import com.pulumi.gcp.storage.BucketArgs;
import com.pulumi.gcp.storage.BucketObject;
import com.pulumi.gcp.storage.BucketObjectArgs;
import com.pulumi.gcp.colab.NotebookExecution;
import com.pulumi.gcp.colab.NotebookExecutionArgs;
import com.pulumi.gcp.colab.inputs.NotebookExecutionGcsNotebookSourceArgs;
import com.pulumi.resources.CustomResourceOptions;
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 myRuntimeTemplate = new RuntimeTemplate("myRuntimeTemplate", RuntimeTemplateArgs.builder()
            .name("runtime-template-name")
            .displayName("Runtime template")
            .location("us-central1")
            .machineSpec(RuntimeTemplateMachineSpecArgs.builder()
                .machineType("e2-standard-4")
                .build())
            .networkSpec(RuntimeTemplateNetworkSpecArgs.builder()
                .enableInternetAccess(true)
                .build())
            .build());

        var outputBucket = new Bucket("outputBucket", BucketArgs.builder()
            .name("my_bucket")
            .location("US")
            .forceDestroy(true)
            .uniformBucketLevelAccess(true)
            .build());

        var notebook = new BucketObject("notebook", BucketObjectArgs.builder()
            .name("hello_world.ipynb")
            .bucket(outputBucket.name())
            .content("""
    {
      "cells": [
        {
          "cell_type": "code",
          "execution_count": null,
          "metadata": {},
          "outputs": [],
          "source": [
            "print(\"Hello, World!\")"
          ]
        }
      ],
      "metadata": {
        "kernelspec": {
          "display_name": "Python 3",
          "language": "python",
          "name": "python3"
        },
        "language_info": {
          "codemirror_mode": {
            "name": "ipython",
            "version": 3
          },
          "file_extension": ".py",
          "mimetype": "text/x-python",
          "name": "python",
          "nbconvert_exporter": "python",
          "pygments_lexer": "ipython3",
          "version": "3.8.5"
        }
      },
      "nbformat": 4,
      "nbformat_minor": 4
    }
            """)
            .build());

        var notebook_execution = new NotebookExecution("notebook-execution", NotebookExecutionArgs.builder()
            .notebookExecutionJobId("colab-notebook-execution")
            .displayName("Notebook execution full")
            .location("us-central1")
            .executionTimeout("86400s")
            .gcsNotebookSource(NotebookExecutionGcsNotebookSourceArgs.builder()
                .uri(Output.tuple(notebook.bucket(), notebook.name()).applyValue(values -> {
                    var bucket = values.t1;
                    var name = values.t2;
                    return String.format("gs://%s/%s", bucket,name);
                }))
                .generation(notebook.generation())
                .build())
            .serviceAccount("my@service-account.com")
            .gcsOutputUri(outputBucket.name().applyValue(_name -> String.format("gs://%s", _name)))
            .notebookRuntimeTemplateResourceName(Output.tuple(myRuntimeTemplate.project(), myRuntimeTemplate.location(), myRuntimeTemplate.name()).applyValue(values -> {
                var project = values.t1;
                var location = values.t2;
                var name = values.t3;
                return String.format("projects/%s/locations/%s/notebookRuntimeTemplates/%s", project,location,name);
            }))
            .build(), CustomResourceOptions.builder()
                .dependsOn(                
                    notebook,
                    outputBucket,
                    myRuntimeTemplate)
                .build());

    }
}
Copy
resources:
  myRuntimeTemplate:
    type: gcp:colab:RuntimeTemplate
    name: my_runtime_template
    properties:
      name: runtime-template-name
      displayName: Runtime template
      location: us-central1
      machineSpec:
        machineType: e2-standard-4
      networkSpec:
        enableInternetAccess: true
  outputBucket:
    type: gcp:storage:Bucket
    name: output_bucket
    properties:
      name: my_bucket
      location: US
      forceDestroy: true
      uniformBucketLevelAccess: true
  notebook:
    type: gcp:storage:BucketObject
    properties:
      name: hello_world.ipynb
      bucket: ${outputBucket.name}
      content: |2
            {
              "cells": [
                {
                  "cell_type": "code",
                  "execution_count": null,
                  "metadata": {},
                  "outputs": [],
                  "source": [
                    "print(\"Hello, World!\")"
                  ]
                }
              ],
              "metadata": {
                "kernelspec": {
                  "display_name": "Python 3",
                  "language": "python",
                  "name": "python3"
                },
                "language_info": {
                  "codemirror_mode": {
                    "name": "ipython",
                    "version": 3
                  },
                  "file_extension": ".py",
                  "mimetype": "text/x-python",
                  "name": "python",
                  "nbconvert_exporter": "python",
                  "pygments_lexer": "ipython3",
                  "version": "3.8.5"
                }
              },
              "nbformat": 4,
              "nbformat_minor": 4
            }
  notebook-execution:
    type: gcp:colab:NotebookExecution
    properties:
      notebookExecutionJobId: colab-notebook-execution
      displayName: Notebook execution full
      location: us-central1
      executionTimeout: 86400s
      gcsNotebookSource:
        uri: gs://${notebook.bucket}/${notebook.name}
        generation: ${notebook.generation}
      serviceAccount: my@service-account.com
      gcsOutputUri: gs://${outputBucket.name}
      notebookRuntimeTemplateResourceName: projects/${myRuntimeTemplate.project}/locations/${myRuntimeTemplate.location}/notebookRuntimeTemplates/${myRuntimeTemplate.name}
    options:
      dependsOn:
        - ${notebook}
        - ${outputBucket}
        - ${myRuntimeTemplate}
Copy

Colab Notebook Execution Dataform

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const myRuntimeTemplate = new gcp.colab.RuntimeTemplate("my_runtime_template", {
    name: "runtime-template-name",
    displayName: "Runtime template",
    location: "us-central1",
    machineSpec: {
        machineType: "e2-standard-4",
    },
    networkSpec: {
        enableInternetAccess: true,
    },
});
const outputBucket = new gcp.storage.Bucket("output_bucket", {
    name: "my_bucket",
    location: "US",
    forceDestroy: true,
    uniformBucketLevelAccess: true,
});
const secret = new gcp.secretmanager.Secret("secret", {
    secretId: "secret",
    replication: {
        auto: {},
    },
});
const secretVersion = new gcp.secretmanager.SecretVersion("secret_version", {
    secret: secret.id,
    secretData: "secret-data",
});
const dataformRepository = new gcp.dataform.Repository("dataform_repository", {
    name: "dataform-repository",
    displayName: "dataform_repository",
    npmrcEnvironmentVariablesSecretVersion: secretVersion.id,
    kmsKeyName: "my-crypto-key",
    labels: {
        label_foo1: "label-bar1",
    },
    gitRemoteSettings: {
        url: "https://github.com/OWNER/REPOSITORY.git",
        defaultBranch: "main",
        authenticationTokenSecretVersion: secretVersion.id,
    },
    workspaceCompilationOverrides: {
        defaultDatabase: "database",
        schemaSuffix: "_suffix",
        tablePrefix: "prefix_",
    },
});
const notebook_execution = new gcp.colab.NotebookExecution("notebook-execution", {
    displayName: "Notebook execution Dataform",
    location: "us-central1",
    dataformRepositorySource: {
        commitSha: "randomsha123",
        dataformRepositoryResourceName: pulumi.interpolate`projects/${myRuntimeTemplate.project}/locations/${myRuntimeTemplate.location}/repositories/${dataformRepository.name}`,
    },
    notebookRuntimeTemplateResourceName: pulumi.interpolate`projects/${myRuntimeTemplate.project}/locations/${myRuntimeTemplate.location}/notebookRuntimeTemplates/${myRuntimeTemplate.name}`,
    gcsOutputUri: pulumi.interpolate`gs://${outputBucket.name}`,
    serviceAccount: "my@service-account.com",
}, {
    dependsOn: [
        myRuntimeTemplate,
        outputBucket,
        secretVersion,
        dataformRepository,
        secret,
    ],
});
Copy
import pulumi
import pulumi_gcp as gcp

my_runtime_template = gcp.colab.RuntimeTemplate("my_runtime_template",
    name="runtime-template-name",
    display_name="Runtime template",
    location="us-central1",
    machine_spec={
        "machine_type": "e2-standard-4",
    },
    network_spec={
        "enable_internet_access": True,
    })
output_bucket = gcp.storage.Bucket("output_bucket",
    name="my_bucket",
    location="US",
    force_destroy=True,
    uniform_bucket_level_access=True)
secret = gcp.secretmanager.Secret("secret",
    secret_id="secret",
    replication={
        "auto": {},
    })
secret_version = gcp.secretmanager.SecretVersion("secret_version",
    secret=secret.id,
    secret_data="secret-data")
dataform_repository = gcp.dataform.Repository("dataform_repository",
    name="dataform-repository",
    display_name="dataform_repository",
    npmrc_environment_variables_secret_version=secret_version.id,
    kms_key_name="my-crypto-key",
    labels={
        "label_foo1": "label-bar1",
    },
    git_remote_settings={
        "url": "https://github.com/OWNER/REPOSITORY.git",
        "default_branch": "main",
        "authentication_token_secret_version": secret_version.id,
    },
    workspace_compilation_overrides={
        "default_database": "database",
        "schema_suffix": "_suffix",
        "table_prefix": "prefix_",
    })
notebook_execution = gcp.colab.NotebookExecution("notebook-execution",
    display_name="Notebook execution Dataform",
    location="us-central1",
    dataform_repository_source={
        "commit_sha": "randomsha123",
        "dataform_repository_resource_name": pulumi.Output.all(
            project=my_runtime_template.project,
            location=my_runtime_template.location,
            name=dataform_repository.name
).apply(lambda resolved_outputs: f"projects/{resolved_outputs['project']}/locations/{resolved_outputs['location']}/repositories/{resolved_outputs['name']}")
,
    },
    notebook_runtime_template_resource_name=pulumi.Output.all(
        project=my_runtime_template.project,
        location=my_runtime_template.location,
        name=my_runtime_template.name
).apply(lambda resolved_outputs: f"projects/{resolved_outputs['project']}/locations/{resolved_outputs['location']}/notebookRuntimeTemplates/{resolved_outputs['name']}")
,
    gcs_output_uri=output_bucket.name.apply(lambda name: f"gs://{name}"),
    service_account="my@service-account.com",
    opts = pulumi.ResourceOptions(depends_on=[
            my_runtime_template,
            output_bucket,
            secret_version,
            dataform_repository,
            secret,
        ]))
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/colab"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/dataform"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/secretmanager"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		myRuntimeTemplate, err := colab.NewRuntimeTemplate(ctx, "my_runtime_template", &colab.RuntimeTemplateArgs{
			Name:        pulumi.String("runtime-template-name"),
			DisplayName: pulumi.String("Runtime template"),
			Location:    pulumi.String("us-central1"),
			MachineSpec: &colab.RuntimeTemplateMachineSpecArgs{
				MachineType: pulumi.String("e2-standard-4"),
			},
			NetworkSpec: &colab.RuntimeTemplateNetworkSpecArgs{
				EnableInternetAccess: pulumi.Bool(true),
			},
		})
		if err != nil {
			return err
		}
		outputBucket, err := storage.NewBucket(ctx, "output_bucket", &storage.BucketArgs{
			Name:                     pulumi.String("my_bucket"),
			Location:                 pulumi.String("US"),
			ForceDestroy:             pulumi.Bool(true),
			UniformBucketLevelAccess: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		secret, err := secretmanager.NewSecret(ctx, "secret", &secretmanager.SecretArgs{
			SecretId: pulumi.String("secret"),
			Replication: &secretmanager.SecretReplicationArgs{
				Auto: &secretmanager.SecretReplicationAutoArgs{},
			},
		})
		if err != nil {
			return err
		}
		secretVersion, err := secretmanager.NewSecretVersion(ctx, "secret_version", &secretmanager.SecretVersionArgs{
			Secret:     secret.ID(),
			SecretData: pulumi.String("secret-data"),
		})
		if err != nil {
			return err
		}
		dataformRepository, err := dataform.NewRepository(ctx, "dataform_repository", &dataform.RepositoryArgs{
			Name:                                   pulumi.String("dataform-repository"),
			DisplayName:                            pulumi.String("dataform_repository"),
			NpmrcEnvironmentVariablesSecretVersion: secretVersion.ID(),
			KmsKeyName:                             pulumi.String("my-crypto-key"),
			Labels: pulumi.StringMap{
				"label_foo1": pulumi.String("label-bar1"),
			},
			GitRemoteSettings: &dataform.RepositoryGitRemoteSettingsArgs{
				Url:                              pulumi.String("https://github.com/OWNER/REPOSITORY.git"),
				DefaultBranch:                    pulumi.String("main"),
				AuthenticationTokenSecretVersion: secretVersion.ID(),
			},
			WorkspaceCompilationOverrides: &dataform.RepositoryWorkspaceCompilationOverridesArgs{
				DefaultDatabase: pulumi.String("database"),
				SchemaSuffix:    pulumi.String("_suffix"),
				TablePrefix:     pulumi.String("prefix_"),
			},
		})
		if err != nil {
			return err
		}
		_, err = colab.NewNotebookExecution(ctx, "notebook-execution", &colab.NotebookExecutionArgs{
			DisplayName: pulumi.String("Notebook execution Dataform"),
			Location:    pulumi.String("us-central1"),
			DataformRepositorySource: &colab.NotebookExecutionDataformRepositorySourceArgs{
				CommitSha: pulumi.String("randomsha123"),
				DataformRepositoryResourceName: pulumi.All(myRuntimeTemplate.Project, myRuntimeTemplate.Location, dataformRepository.Name).ApplyT(func(_args []interface{}) (string, error) {
					project := _args[0].(string)
					location := _args[1].(string)
					name := _args[2].(string)
					return fmt.Sprintf("projects/%v/locations/%v/repositories/%v", project, location, name), nil
				}).(pulumi.StringOutput),
			},
			NotebookRuntimeTemplateResourceName: pulumi.All(myRuntimeTemplate.Project, myRuntimeTemplate.Location, myRuntimeTemplate.Name).ApplyT(func(_args []interface{}) (string, error) {
				project := _args[0].(string)
				location := _args[1].(string)
				name := _args[2].(string)
				return fmt.Sprintf("projects/%v/locations/%v/notebookRuntimeTemplates/%v", project, location, name), nil
			}).(pulumi.StringOutput),
			GcsOutputUri: outputBucket.Name.ApplyT(func(name string) (string, error) {
				return fmt.Sprintf("gs://%v", name), nil
			}).(pulumi.StringOutput),
			ServiceAccount: pulumi.String("my@service-account.com"),
		}, pulumi.DependsOn([]pulumi.Resource{
			myRuntimeTemplate,
			outputBucket,
			secretVersion,
			dataformRepository,
			secret,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var myRuntimeTemplate = new Gcp.Colab.RuntimeTemplate("my_runtime_template", new()
    {
        Name = "runtime-template-name",
        DisplayName = "Runtime template",
        Location = "us-central1",
        MachineSpec = new Gcp.Colab.Inputs.RuntimeTemplateMachineSpecArgs
        {
            MachineType = "e2-standard-4",
        },
        NetworkSpec = new Gcp.Colab.Inputs.RuntimeTemplateNetworkSpecArgs
        {
            EnableInternetAccess = true,
        },
    });

    var outputBucket = new Gcp.Storage.Bucket("output_bucket", new()
    {
        Name = "my_bucket",
        Location = "US",
        ForceDestroy = true,
        UniformBucketLevelAccess = true,
    });

    var secret = new Gcp.SecretManager.Secret("secret", new()
    {
        SecretId = "secret",
        Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
        {
            Auto = null,
        },
    });

    var secretVersion = new Gcp.SecretManager.SecretVersion("secret_version", new()
    {
        Secret = secret.Id,
        SecretData = "secret-data",
    });

    var dataformRepository = new Gcp.Dataform.Repository("dataform_repository", new()
    {
        Name = "dataform-repository",
        DisplayName = "dataform_repository",
        NpmrcEnvironmentVariablesSecretVersion = secretVersion.Id,
        KmsKeyName = "my-crypto-key",
        Labels = 
        {
            { "label_foo1", "label-bar1" },
        },
        GitRemoteSettings = new Gcp.Dataform.Inputs.RepositoryGitRemoteSettingsArgs
        {
            Url = "https://github.com/OWNER/REPOSITORY.git",
            DefaultBranch = "main",
            AuthenticationTokenSecretVersion = secretVersion.Id,
        },
        WorkspaceCompilationOverrides = new Gcp.Dataform.Inputs.RepositoryWorkspaceCompilationOverridesArgs
        {
            DefaultDatabase = "database",
            SchemaSuffix = "_suffix",
            TablePrefix = "prefix_",
        },
    });

    var notebook_execution = new Gcp.Colab.NotebookExecution("notebook-execution", new()
    {
        DisplayName = "Notebook execution Dataform",
        Location = "us-central1",
        DataformRepositorySource = new Gcp.Colab.Inputs.NotebookExecutionDataformRepositorySourceArgs
        {
            CommitSha = "randomsha123",
            DataformRepositoryResourceName = Output.Tuple(myRuntimeTemplate.Project, myRuntimeTemplate.Location, dataformRepository.Name).Apply(values =>
            {
                var project = values.Item1;
                var location = values.Item2;
                var name = values.Item3;
                return $"projects/{project}/locations/{location}/repositories/{name}";
            }),
        },
        NotebookRuntimeTemplateResourceName = Output.Tuple(myRuntimeTemplate.Project, myRuntimeTemplate.Location, myRuntimeTemplate.Name).Apply(values =>
        {
            var project = values.Item1;
            var location = values.Item2;
            var name = values.Item3;
            return $"projects/{project}/locations/{location}/notebookRuntimeTemplates/{name}";
        }),
        GcsOutputUri = outputBucket.Name.Apply(name => $"gs://{name}"),
        ServiceAccount = "my@service-account.com",
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            myRuntimeTemplate,
            outputBucket,
            secretVersion,
            dataformRepository,
            secret,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.colab.RuntimeTemplate;
import com.pulumi.gcp.colab.RuntimeTemplateArgs;
import com.pulumi.gcp.colab.inputs.RuntimeTemplateMachineSpecArgs;
import com.pulumi.gcp.colab.inputs.RuntimeTemplateNetworkSpecArgs;
import com.pulumi.gcp.storage.Bucket;
import com.pulumi.gcp.storage.BucketArgs;
import com.pulumi.gcp.secretmanager.Secret;
import com.pulumi.gcp.secretmanager.SecretArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
import com.pulumi.gcp.secretmanager.inputs.SecretReplicationAutoArgs;
import com.pulumi.gcp.secretmanager.SecretVersion;
import com.pulumi.gcp.secretmanager.SecretVersionArgs;
import com.pulumi.gcp.dataform.Repository;
import com.pulumi.gcp.dataform.RepositoryArgs;
import com.pulumi.gcp.dataform.inputs.RepositoryGitRemoteSettingsArgs;
import com.pulumi.gcp.dataform.inputs.RepositoryWorkspaceCompilationOverridesArgs;
import com.pulumi.gcp.colab.NotebookExecution;
import com.pulumi.gcp.colab.NotebookExecutionArgs;
import com.pulumi.gcp.colab.inputs.NotebookExecutionDataformRepositorySourceArgs;
import com.pulumi.resources.CustomResourceOptions;
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 myRuntimeTemplate = new RuntimeTemplate("myRuntimeTemplate", RuntimeTemplateArgs.builder()
            .name("runtime-template-name")
            .displayName("Runtime template")
            .location("us-central1")
            .machineSpec(RuntimeTemplateMachineSpecArgs.builder()
                .machineType("e2-standard-4")
                .build())
            .networkSpec(RuntimeTemplateNetworkSpecArgs.builder()
                .enableInternetAccess(true)
                .build())
            .build());

        var outputBucket = new Bucket("outputBucket", BucketArgs.builder()
            .name("my_bucket")
            .location("US")
            .forceDestroy(true)
            .uniformBucketLevelAccess(true)
            .build());

        var secret = new Secret("secret", SecretArgs.builder()
            .secretId("secret")
            .replication(SecretReplicationArgs.builder()
                .auto(SecretReplicationAutoArgs.builder()
                    .build())
                .build())
            .build());

        var secretVersion = new SecretVersion("secretVersion", SecretVersionArgs.builder()
            .secret(secret.id())
            .secretData("secret-data")
            .build());

        var dataformRepository = new Repository("dataformRepository", RepositoryArgs.builder()
            .name("dataform-repository")
            .displayName("dataform_repository")
            .npmrcEnvironmentVariablesSecretVersion(secretVersion.id())
            .kmsKeyName("my-crypto-key")
            .labels(Map.of("label_foo1", "label-bar1"))
            .gitRemoteSettings(RepositoryGitRemoteSettingsArgs.builder()
                .url("https://github.com/OWNER/REPOSITORY.git")
                .defaultBranch("main")
                .authenticationTokenSecretVersion(secretVersion.id())
                .build())
            .workspaceCompilationOverrides(RepositoryWorkspaceCompilationOverridesArgs.builder()
                .defaultDatabase("database")
                .schemaSuffix("_suffix")
                .tablePrefix("prefix_")
                .build())
            .build());

        var notebook_execution = new NotebookExecution("notebook-execution", NotebookExecutionArgs.builder()
            .displayName("Notebook execution Dataform")
            .location("us-central1")
            .dataformRepositorySource(NotebookExecutionDataformRepositorySourceArgs.builder()
                .commitSha("randomsha123")
                .dataformRepositoryResourceName(Output.tuple(myRuntimeTemplate.project(), myRuntimeTemplate.location(), dataformRepository.name()).applyValue(values -> {
                    var project = values.t1;
                    var location = values.t2;
                    var name = values.t3;
                    return String.format("projects/%s/locations/%s/repositories/%s", project,location,name);
                }))
                .build())
            .notebookRuntimeTemplateResourceName(Output.tuple(myRuntimeTemplate.project(), myRuntimeTemplate.location(), myRuntimeTemplate.name()).applyValue(values -> {
                var project = values.t1;
                var location = values.t2;
                var name = values.t3;
                return String.format("projects/%s/locations/%s/notebookRuntimeTemplates/%s", project,location,name);
            }))
            .gcsOutputUri(outputBucket.name().applyValue(_name -> String.format("gs://%s", _name)))
            .serviceAccount("my@service-account.com")
            .build(), CustomResourceOptions.builder()
                .dependsOn(                
                    myRuntimeTemplate,
                    outputBucket,
                    secretVersion,
                    dataformRepository,
                    secret)
                .build());

    }
}
Copy
resources:
  myRuntimeTemplate:
    type: gcp:colab:RuntimeTemplate
    name: my_runtime_template
    properties:
      name: runtime-template-name
      displayName: Runtime template
      location: us-central1
      machineSpec:
        machineType: e2-standard-4
      networkSpec:
        enableInternetAccess: true
  outputBucket:
    type: gcp:storage:Bucket
    name: output_bucket
    properties:
      name: my_bucket
      location: US
      forceDestroy: true
      uniformBucketLevelAccess: true
  secret:
    type: gcp:secretmanager:Secret
    properties:
      secretId: secret
      replication:
        auto: {}
  secretVersion:
    type: gcp:secretmanager:SecretVersion
    name: secret_version
    properties:
      secret: ${secret.id}
      secretData: secret-data
  dataformRepository:
    type: gcp:dataform:Repository
    name: dataform_repository
    properties:
      name: dataform-repository
      displayName: dataform_repository
      npmrcEnvironmentVariablesSecretVersion: ${secretVersion.id}
      kmsKeyName: my-crypto-key
      labels:
        label_foo1: label-bar1
      gitRemoteSettings:
        url: https://github.com/OWNER/REPOSITORY.git
        defaultBranch: main
        authenticationTokenSecretVersion: ${secretVersion.id}
      workspaceCompilationOverrides:
        defaultDatabase: database
        schemaSuffix: _suffix
        tablePrefix: prefix_
  notebook-execution:
    type: gcp:colab:NotebookExecution
    properties:
      displayName: Notebook execution Dataform
      location: us-central1
      dataformRepositorySource:
        commitSha: randomsha123
        dataformRepositoryResourceName: projects/${myRuntimeTemplate.project}/locations/${myRuntimeTemplate.location}/repositories/${dataformRepository.name}
      notebookRuntimeTemplateResourceName: projects/${myRuntimeTemplate.project}/locations/${myRuntimeTemplate.location}/notebookRuntimeTemplates/${myRuntimeTemplate.name}
      gcsOutputUri: gs://${outputBucket.name}
      serviceAccount: my@service-account.com
    options:
      dependsOn:
        - ${myRuntimeTemplate}
        - ${outputBucket}
        - ${secretVersion}
        - ${dataformRepository}
        - ${secret}
Copy

Create NotebookExecution Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new NotebookExecution(name: string, args: NotebookExecutionArgs, opts?: CustomResourceOptions);
@overload
def NotebookExecution(resource_name: str,
                      args: NotebookExecutionArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def NotebookExecution(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      display_name: Optional[str] = None,
                      gcs_output_uri: Optional[str] = None,
                      location: Optional[str] = None,
                      dataform_repository_source: Optional[NotebookExecutionDataformRepositorySourceArgs] = None,
                      direct_notebook_source: Optional[NotebookExecutionDirectNotebookSourceArgs] = None,
                      execution_timeout: Optional[str] = None,
                      execution_user: Optional[str] = None,
                      gcs_notebook_source: Optional[NotebookExecutionGcsNotebookSourceArgs] = None,
                      notebook_execution_job_id: Optional[str] = None,
                      notebook_runtime_template_resource_name: Optional[str] = None,
                      project: Optional[str] = None,
                      service_account: Optional[str] = None)
func NewNotebookExecution(ctx *Context, name string, args NotebookExecutionArgs, opts ...ResourceOption) (*NotebookExecution, error)
public NotebookExecution(string name, NotebookExecutionArgs args, CustomResourceOptions? opts = null)
public NotebookExecution(String name, NotebookExecutionArgs args)
public NotebookExecution(String name, NotebookExecutionArgs args, CustomResourceOptions options)
type: gcp:colab:NotebookExecution
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. NotebookExecutionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. NotebookExecutionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. NotebookExecutionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. NotebookExecutionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. NotebookExecutionArgs
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 notebookExecutionResource = new Gcp.Colab.NotebookExecution("notebookExecutionResource", new()
{
    DisplayName = "string",
    GcsOutputUri = "string",
    Location = "string",
    DataformRepositorySource = new Gcp.Colab.Inputs.NotebookExecutionDataformRepositorySourceArgs
    {
        DataformRepositoryResourceName = "string",
        CommitSha = "string",
    },
    DirectNotebookSource = new Gcp.Colab.Inputs.NotebookExecutionDirectNotebookSourceArgs
    {
        Content = "string",
    },
    ExecutionTimeout = "string",
    ExecutionUser = "string",
    GcsNotebookSource = new Gcp.Colab.Inputs.NotebookExecutionGcsNotebookSourceArgs
    {
        Uri = "string",
        Generation = "string",
    },
    NotebookExecutionJobId = "string",
    NotebookRuntimeTemplateResourceName = "string",
    Project = "string",
    ServiceAccount = "string",
});
Copy
example, err := colab.NewNotebookExecution(ctx, "notebookExecutionResource", &colab.NotebookExecutionArgs{
	DisplayName:  pulumi.String("string"),
	GcsOutputUri: pulumi.String("string"),
	Location:     pulumi.String("string"),
	DataformRepositorySource: &colab.NotebookExecutionDataformRepositorySourceArgs{
		DataformRepositoryResourceName: pulumi.String("string"),
		CommitSha:                      pulumi.String("string"),
	},
	DirectNotebookSource: &colab.NotebookExecutionDirectNotebookSourceArgs{
		Content: pulumi.String("string"),
	},
	ExecutionTimeout: pulumi.String("string"),
	ExecutionUser:    pulumi.String("string"),
	GcsNotebookSource: &colab.NotebookExecutionGcsNotebookSourceArgs{
		Uri:        pulumi.String("string"),
		Generation: pulumi.String("string"),
	},
	NotebookExecutionJobId:              pulumi.String("string"),
	NotebookRuntimeTemplateResourceName: pulumi.String("string"),
	Project:                             pulumi.String("string"),
	ServiceAccount:                      pulumi.String("string"),
})
Copy
var notebookExecutionResource = new NotebookExecution("notebookExecutionResource", NotebookExecutionArgs.builder()
    .displayName("string")
    .gcsOutputUri("string")
    .location("string")
    .dataformRepositorySource(NotebookExecutionDataformRepositorySourceArgs.builder()
        .dataformRepositoryResourceName("string")
        .commitSha("string")
        .build())
    .directNotebookSource(NotebookExecutionDirectNotebookSourceArgs.builder()
        .content("string")
        .build())
    .executionTimeout("string")
    .executionUser("string")
    .gcsNotebookSource(NotebookExecutionGcsNotebookSourceArgs.builder()
        .uri("string")
        .generation("string")
        .build())
    .notebookExecutionJobId("string")
    .notebookRuntimeTemplateResourceName("string")
    .project("string")
    .serviceAccount("string")
    .build());
Copy
notebook_execution_resource = gcp.colab.NotebookExecution("notebookExecutionResource",
    display_name="string",
    gcs_output_uri="string",
    location="string",
    dataform_repository_source={
        "dataform_repository_resource_name": "string",
        "commit_sha": "string",
    },
    direct_notebook_source={
        "content": "string",
    },
    execution_timeout="string",
    execution_user="string",
    gcs_notebook_source={
        "uri": "string",
        "generation": "string",
    },
    notebook_execution_job_id="string",
    notebook_runtime_template_resource_name="string",
    project="string",
    service_account="string")
Copy
const notebookExecutionResource = new gcp.colab.NotebookExecution("notebookExecutionResource", {
    displayName: "string",
    gcsOutputUri: "string",
    location: "string",
    dataformRepositorySource: {
        dataformRepositoryResourceName: "string",
        commitSha: "string",
    },
    directNotebookSource: {
        content: "string",
    },
    executionTimeout: "string",
    executionUser: "string",
    gcsNotebookSource: {
        uri: "string",
        generation: "string",
    },
    notebookExecutionJobId: "string",
    notebookRuntimeTemplateResourceName: "string",
    project: "string",
    serviceAccount: "string",
});
Copy
type: gcp:colab:NotebookExecution
properties:
    dataformRepositorySource:
        commitSha: string
        dataformRepositoryResourceName: string
    directNotebookSource:
        content: string
    displayName: string
    executionTimeout: string
    executionUser: string
    gcsNotebookSource:
        generation: string
        uri: string
    gcsOutputUri: string
    location: string
    notebookExecutionJobId: string
    notebookRuntimeTemplateResourceName: string
    project: string
    serviceAccount: string
Copy

NotebookExecution 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 NotebookExecution resource accepts the following input properties:

DisplayName
This property is required.
Changes to this property will trigger replacement.
string
Required. The display name of the Notebook Execution.
GcsOutputUri
This property is required.
Changes to this property will trigger replacement.
string
The Cloud Storage location to upload the result to. Format:gs://bucket-name
Location
This property is required.
Changes to this property will trigger replacement.
string
The location for the resource: https://cloud.google.com/colab/docs/locations


DataformRepositorySource Changes to this property will trigger replacement. NotebookExecutionDataformRepositorySource
The Dataform Repository containing the input notebook. Structure is documented below.
DirectNotebookSource Changes to this property will trigger replacement. NotebookExecutionDirectNotebookSource
The content of the input notebook in ipynb format. Structure is documented below.
ExecutionTimeout Changes to this property will trigger replacement. string
Max running time of the execution job in seconds (default 86400s / 24 hrs).
ExecutionUser Changes to this property will trigger replacement. string
The user email to run the execution as.
GcsNotebookSource Changes to this property will trigger replacement. NotebookExecutionGcsNotebookSource
The Cloud Storage uri for the input notebook. Structure is documented below.
NotebookExecutionJobId Changes to this property will trigger replacement. string
User specified ID for the Notebook Execution Job
NotebookRuntimeTemplateResourceName Changes to this property will trigger replacement. string
The NotebookRuntimeTemplate to source compute configuration from.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ServiceAccount Changes to this property will trigger replacement. string
The service account to run the execution as.
DisplayName
This property is required.
Changes to this property will trigger replacement.
string
Required. The display name of the Notebook Execution.
GcsOutputUri
This property is required.
Changes to this property will trigger replacement.
string
The Cloud Storage location to upload the result to. Format:gs://bucket-name
Location
This property is required.
Changes to this property will trigger replacement.
string
The location for the resource: https://cloud.google.com/colab/docs/locations


DataformRepositorySource Changes to this property will trigger replacement. NotebookExecutionDataformRepositorySourceArgs
The Dataform Repository containing the input notebook. Structure is documented below.
DirectNotebookSource Changes to this property will trigger replacement. NotebookExecutionDirectNotebookSourceArgs
The content of the input notebook in ipynb format. Structure is documented below.
ExecutionTimeout Changes to this property will trigger replacement. string
Max running time of the execution job in seconds (default 86400s / 24 hrs).
ExecutionUser Changes to this property will trigger replacement. string
The user email to run the execution as.
GcsNotebookSource Changes to this property will trigger replacement. NotebookExecutionGcsNotebookSourceArgs
The Cloud Storage uri for the input notebook. Structure is documented below.
NotebookExecutionJobId Changes to this property will trigger replacement. string
User specified ID for the Notebook Execution Job
NotebookRuntimeTemplateResourceName Changes to this property will trigger replacement. string
The NotebookRuntimeTemplate to source compute configuration from.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ServiceAccount Changes to this property will trigger replacement. string
The service account to run the execution as.
displayName
This property is required.
Changes to this property will trigger replacement.
String
Required. The display name of the Notebook Execution.
gcsOutputUri
This property is required.
Changes to this property will trigger replacement.
String
The Cloud Storage location to upload the result to. Format:gs://bucket-name
location
This property is required.
Changes to this property will trigger replacement.
String
The location for the resource: https://cloud.google.com/colab/docs/locations


dataformRepositorySource Changes to this property will trigger replacement. NotebookExecutionDataformRepositorySource
The Dataform Repository containing the input notebook. Structure is documented below.
directNotebookSource Changes to this property will trigger replacement. NotebookExecutionDirectNotebookSource
The content of the input notebook in ipynb format. Structure is documented below.
executionTimeout Changes to this property will trigger replacement. String
Max running time of the execution job in seconds (default 86400s / 24 hrs).
executionUser Changes to this property will trigger replacement. String
The user email to run the execution as.
gcsNotebookSource Changes to this property will trigger replacement. NotebookExecutionGcsNotebookSource
The Cloud Storage uri for the input notebook. Structure is documented below.
notebookExecutionJobId Changes to this property will trigger replacement. String
User specified ID for the Notebook Execution Job
notebookRuntimeTemplateResourceName Changes to this property will trigger replacement. String
The NotebookRuntimeTemplate to source compute configuration from.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
serviceAccount Changes to this property will trigger replacement. String
The service account to run the execution as.
displayName
This property is required.
Changes to this property will trigger replacement.
string
Required. The display name of the Notebook Execution.
gcsOutputUri
This property is required.
Changes to this property will trigger replacement.
string
The Cloud Storage location to upload the result to. Format:gs://bucket-name
location
This property is required.
Changes to this property will trigger replacement.
string
The location for the resource: https://cloud.google.com/colab/docs/locations


dataformRepositorySource Changes to this property will trigger replacement. NotebookExecutionDataformRepositorySource
The Dataform Repository containing the input notebook. Structure is documented below.
directNotebookSource Changes to this property will trigger replacement. NotebookExecutionDirectNotebookSource
The content of the input notebook in ipynb format. Structure is documented below.
executionTimeout Changes to this property will trigger replacement. string
Max running time of the execution job in seconds (default 86400s / 24 hrs).
executionUser Changes to this property will trigger replacement. string
The user email to run the execution as.
gcsNotebookSource Changes to this property will trigger replacement. NotebookExecutionGcsNotebookSource
The Cloud Storage uri for the input notebook. Structure is documented below.
notebookExecutionJobId Changes to this property will trigger replacement. string
User specified ID for the Notebook Execution Job
notebookRuntimeTemplateResourceName Changes to this property will trigger replacement. string
The NotebookRuntimeTemplate to source compute configuration from.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
serviceAccount Changes to this property will trigger replacement. string
The service account to run the execution as.
display_name
This property is required.
Changes to this property will trigger replacement.
str
Required. The display name of the Notebook Execution.
gcs_output_uri
This property is required.
Changes to this property will trigger replacement.
str
The Cloud Storage location to upload the result to. Format:gs://bucket-name
location
This property is required.
Changes to this property will trigger replacement.
str
The location for the resource: https://cloud.google.com/colab/docs/locations


dataform_repository_source Changes to this property will trigger replacement. NotebookExecutionDataformRepositorySourceArgs
The Dataform Repository containing the input notebook. Structure is documented below.
direct_notebook_source Changes to this property will trigger replacement. NotebookExecutionDirectNotebookSourceArgs
The content of the input notebook in ipynb format. Structure is documented below.
execution_timeout Changes to this property will trigger replacement. str
Max running time of the execution job in seconds (default 86400s / 24 hrs).
execution_user Changes to this property will trigger replacement. str
The user email to run the execution as.
gcs_notebook_source Changes to this property will trigger replacement. NotebookExecutionGcsNotebookSourceArgs
The Cloud Storage uri for the input notebook. Structure is documented below.
notebook_execution_job_id Changes to this property will trigger replacement. str
User specified ID for the Notebook Execution Job
notebook_runtime_template_resource_name Changes to this property will trigger replacement. str
The NotebookRuntimeTemplate to source compute configuration from.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
service_account Changes to this property will trigger replacement. str
The service account to run the execution as.
displayName
This property is required.
Changes to this property will trigger replacement.
String
Required. The display name of the Notebook Execution.
gcsOutputUri
This property is required.
Changes to this property will trigger replacement.
String
The Cloud Storage location to upload the result to. Format:gs://bucket-name
location
This property is required.
Changes to this property will trigger replacement.
String
The location for the resource: https://cloud.google.com/colab/docs/locations


dataformRepositorySource Changes to this property will trigger replacement. Property Map
The Dataform Repository containing the input notebook. Structure is documented below.
directNotebookSource Changes to this property will trigger replacement. Property Map
The content of the input notebook in ipynb format. Structure is documented below.
executionTimeout Changes to this property will trigger replacement. String
Max running time of the execution job in seconds (default 86400s / 24 hrs).
executionUser Changes to this property will trigger replacement. String
The user email to run the execution as.
gcsNotebookSource Changes to this property will trigger replacement. Property Map
The Cloud Storage uri for the input notebook. Structure is documented below.
notebookExecutionJobId Changes to this property will trigger replacement. String
User specified ID for the Notebook Execution Job
notebookRuntimeTemplateResourceName Changes to this property will trigger replacement. String
The NotebookRuntimeTemplate to source compute configuration from.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
serviceAccount Changes to this property will trigger replacement. String
The service account to run the execution as.

Outputs

All input properties are implicitly available as output properties. Additionally, the NotebookExecution resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing NotebookExecution Resource

Get an existing NotebookExecution 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?: NotebookExecutionState, opts?: CustomResourceOptions): NotebookExecution
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        dataform_repository_source: Optional[NotebookExecutionDataformRepositorySourceArgs] = None,
        direct_notebook_source: Optional[NotebookExecutionDirectNotebookSourceArgs] = None,
        display_name: Optional[str] = None,
        execution_timeout: Optional[str] = None,
        execution_user: Optional[str] = None,
        gcs_notebook_source: Optional[NotebookExecutionGcsNotebookSourceArgs] = None,
        gcs_output_uri: Optional[str] = None,
        location: Optional[str] = None,
        notebook_execution_job_id: Optional[str] = None,
        notebook_runtime_template_resource_name: Optional[str] = None,
        project: Optional[str] = None,
        service_account: Optional[str] = None) -> NotebookExecution
func GetNotebookExecution(ctx *Context, name string, id IDInput, state *NotebookExecutionState, opts ...ResourceOption) (*NotebookExecution, error)
public static NotebookExecution Get(string name, Input<string> id, NotebookExecutionState? state, CustomResourceOptions? opts = null)
public static NotebookExecution get(String name, Output<String> id, NotebookExecutionState state, CustomResourceOptions options)
resources:  _:    type: gcp:colab:NotebookExecution    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
DataformRepositorySource Changes to this property will trigger replacement. NotebookExecutionDataformRepositorySource
The Dataform Repository containing the input notebook. Structure is documented below.
DirectNotebookSource Changes to this property will trigger replacement. NotebookExecutionDirectNotebookSource
The content of the input notebook in ipynb format. Structure is documented below.
DisplayName Changes to this property will trigger replacement. string
Required. The display name of the Notebook Execution.
ExecutionTimeout Changes to this property will trigger replacement. string
Max running time of the execution job in seconds (default 86400s / 24 hrs).
ExecutionUser Changes to this property will trigger replacement. string
The user email to run the execution as.
GcsNotebookSource Changes to this property will trigger replacement. NotebookExecutionGcsNotebookSource
The Cloud Storage uri for the input notebook. Structure is documented below.
GcsOutputUri Changes to this property will trigger replacement. string
The Cloud Storage location to upload the result to. Format:gs://bucket-name
Location Changes to this property will trigger replacement. string
The location for the resource: https://cloud.google.com/colab/docs/locations


NotebookExecutionJobId Changes to this property will trigger replacement. string
User specified ID for the Notebook Execution Job
NotebookRuntimeTemplateResourceName Changes to this property will trigger replacement. string
The NotebookRuntimeTemplate to source compute configuration from.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ServiceAccount Changes to this property will trigger replacement. string
The service account to run the execution as.
DataformRepositorySource Changes to this property will trigger replacement. NotebookExecutionDataformRepositorySourceArgs
The Dataform Repository containing the input notebook. Structure is documented below.
DirectNotebookSource Changes to this property will trigger replacement. NotebookExecutionDirectNotebookSourceArgs
The content of the input notebook in ipynb format. Structure is documented below.
DisplayName Changes to this property will trigger replacement. string
Required. The display name of the Notebook Execution.
ExecutionTimeout Changes to this property will trigger replacement. string
Max running time of the execution job in seconds (default 86400s / 24 hrs).
ExecutionUser Changes to this property will trigger replacement. string
The user email to run the execution as.
GcsNotebookSource Changes to this property will trigger replacement. NotebookExecutionGcsNotebookSourceArgs
The Cloud Storage uri for the input notebook. Structure is documented below.
GcsOutputUri Changes to this property will trigger replacement. string
The Cloud Storage location to upload the result to. Format:gs://bucket-name
Location Changes to this property will trigger replacement. string
The location for the resource: https://cloud.google.com/colab/docs/locations


NotebookExecutionJobId Changes to this property will trigger replacement. string
User specified ID for the Notebook Execution Job
NotebookRuntimeTemplateResourceName Changes to this property will trigger replacement. string
The NotebookRuntimeTemplate to source compute configuration from.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
ServiceAccount Changes to this property will trigger replacement. string
The service account to run the execution as.
dataformRepositorySource Changes to this property will trigger replacement. NotebookExecutionDataformRepositorySource
The Dataform Repository containing the input notebook. Structure is documented below.
directNotebookSource Changes to this property will trigger replacement. NotebookExecutionDirectNotebookSource
The content of the input notebook in ipynb format. Structure is documented below.
displayName Changes to this property will trigger replacement. String
Required. The display name of the Notebook Execution.
executionTimeout Changes to this property will trigger replacement. String
Max running time of the execution job in seconds (default 86400s / 24 hrs).
executionUser Changes to this property will trigger replacement. String
The user email to run the execution as.
gcsNotebookSource Changes to this property will trigger replacement. NotebookExecutionGcsNotebookSource
The Cloud Storage uri for the input notebook. Structure is documented below.
gcsOutputUri Changes to this property will trigger replacement. String
The Cloud Storage location to upload the result to. Format:gs://bucket-name
location Changes to this property will trigger replacement. String
The location for the resource: https://cloud.google.com/colab/docs/locations


notebookExecutionJobId Changes to this property will trigger replacement. String
User specified ID for the Notebook Execution Job
notebookRuntimeTemplateResourceName Changes to this property will trigger replacement. String
The NotebookRuntimeTemplate to source compute configuration from.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
serviceAccount Changes to this property will trigger replacement. String
The service account to run the execution as.
dataformRepositorySource Changes to this property will trigger replacement. NotebookExecutionDataformRepositorySource
The Dataform Repository containing the input notebook. Structure is documented below.
directNotebookSource Changes to this property will trigger replacement. NotebookExecutionDirectNotebookSource
The content of the input notebook in ipynb format. Structure is documented below.
displayName Changes to this property will trigger replacement. string
Required. The display name of the Notebook Execution.
executionTimeout Changes to this property will trigger replacement. string
Max running time of the execution job in seconds (default 86400s / 24 hrs).
executionUser Changes to this property will trigger replacement. string
The user email to run the execution as.
gcsNotebookSource Changes to this property will trigger replacement. NotebookExecutionGcsNotebookSource
The Cloud Storage uri for the input notebook. Structure is documented below.
gcsOutputUri Changes to this property will trigger replacement. string
The Cloud Storage location to upload the result to. Format:gs://bucket-name
location Changes to this property will trigger replacement. string
The location for the resource: https://cloud.google.com/colab/docs/locations


notebookExecutionJobId Changes to this property will trigger replacement. string
User specified ID for the Notebook Execution Job
notebookRuntimeTemplateResourceName Changes to this property will trigger replacement. string
The NotebookRuntimeTemplate to source compute configuration from.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
serviceAccount Changes to this property will trigger replacement. string
The service account to run the execution as.
dataform_repository_source Changes to this property will trigger replacement. NotebookExecutionDataformRepositorySourceArgs
The Dataform Repository containing the input notebook. Structure is documented below.
direct_notebook_source Changes to this property will trigger replacement. NotebookExecutionDirectNotebookSourceArgs
The content of the input notebook in ipynb format. Structure is documented below.
display_name Changes to this property will trigger replacement. str
Required. The display name of the Notebook Execution.
execution_timeout Changes to this property will trigger replacement. str
Max running time of the execution job in seconds (default 86400s / 24 hrs).
execution_user Changes to this property will trigger replacement. str
The user email to run the execution as.
gcs_notebook_source Changes to this property will trigger replacement. NotebookExecutionGcsNotebookSourceArgs
The Cloud Storage uri for the input notebook. Structure is documented below.
gcs_output_uri Changes to this property will trigger replacement. str
The Cloud Storage location to upload the result to. Format:gs://bucket-name
location Changes to this property will trigger replacement. str
The location for the resource: https://cloud.google.com/colab/docs/locations


notebook_execution_job_id Changes to this property will trigger replacement. str
User specified ID for the Notebook Execution Job
notebook_runtime_template_resource_name Changes to this property will trigger replacement. str
The NotebookRuntimeTemplate to source compute configuration from.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
service_account Changes to this property will trigger replacement. str
The service account to run the execution as.
dataformRepositorySource Changes to this property will trigger replacement. Property Map
The Dataform Repository containing the input notebook. Structure is documented below.
directNotebookSource Changes to this property will trigger replacement. Property Map
The content of the input notebook in ipynb format. Structure is documented below.
displayName Changes to this property will trigger replacement. String
Required. The display name of the Notebook Execution.
executionTimeout Changes to this property will trigger replacement. String
Max running time of the execution job in seconds (default 86400s / 24 hrs).
executionUser Changes to this property will trigger replacement. String
The user email to run the execution as.
gcsNotebookSource Changes to this property will trigger replacement. Property Map
The Cloud Storage uri for the input notebook. Structure is documented below.
gcsOutputUri Changes to this property will trigger replacement. String
The Cloud Storage location to upload the result to. Format:gs://bucket-name
location Changes to this property will trigger replacement. String
The location for the resource: https://cloud.google.com/colab/docs/locations


notebookExecutionJobId Changes to this property will trigger replacement. String
User specified ID for the Notebook Execution Job
notebookRuntimeTemplateResourceName Changes to this property will trigger replacement. String
The NotebookRuntimeTemplate to source compute configuration from.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
serviceAccount Changes to this property will trigger replacement. String
The service account to run the execution as.

Supporting Types

NotebookExecutionDataformRepositorySource
, NotebookExecutionDataformRepositorySourceArgs

DataformRepositoryResourceName
This property is required.
Changes to this property will trigger replacement.
string
The resource name of the Dataform Repository.
CommitSha Changes to this property will trigger replacement. string
The commit SHA to read repository with. If unset, the file will be read at HEAD.
DataformRepositoryResourceName
This property is required.
Changes to this property will trigger replacement.
string
The resource name of the Dataform Repository.
CommitSha Changes to this property will trigger replacement. string
The commit SHA to read repository with. If unset, the file will be read at HEAD.
dataformRepositoryResourceName
This property is required.
Changes to this property will trigger replacement.
String
The resource name of the Dataform Repository.
commitSha Changes to this property will trigger replacement. String
The commit SHA to read repository with. If unset, the file will be read at HEAD.
dataformRepositoryResourceName
This property is required.
Changes to this property will trigger replacement.
string
The resource name of the Dataform Repository.
commitSha Changes to this property will trigger replacement. string
The commit SHA to read repository with. If unset, the file will be read at HEAD.
dataform_repository_resource_name
This property is required.
Changes to this property will trigger replacement.
str
The resource name of the Dataform Repository.
commit_sha Changes to this property will trigger replacement. str
The commit SHA to read repository with. If unset, the file will be read at HEAD.
dataformRepositoryResourceName
This property is required.
Changes to this property will trigger replacement.
String
The resource name of the Dataform Repository.
commitSha Changes to this property will trigger replacement. String
The commit SHA to read repository with. If unset, the file will be read at HEAD.

NotebookExecutionDirectNotebookSource
, NotebookExecutionDirectNotebookSourceArgs

Content
This property is required.
Changes to this property will trigger replacement.
string
The base64-encoded contents of the input notebook file.
Content
This property is required.
Changes to this property will trigger replacement.
string
The base64-encoded contents of the input notebook file.
content
This property is required.
Changes to this property will trigger replacement.
String
The base64-encoded contents of the input notebook file.
content
This property is required.
Changes to this property will trigger replacement.
string
The base64-encoded contents of the input notebook file.
content
This property is required.
Changes to this property will trigger replacement.
str
The base64-encoded contents of the input notebook file.
content
This property is required.
Changes to this property will trigger replacement.
String
The base64-encoded contents of the input notebook file.

NotebookExecutionGcsNotebookSource
, NotebookExecutionGcsNotebookSourceArgs

Uri
This property is required.
Changes to this property will trigger replacement.
string
The Cloud Storage uri pointing to the ipynb file.
Generation Changes to this property will trigger replacement. string
The version of the Cloud Storage object to read. If unset, the current version of the object is read. See https://cloud.google.com/storage/docs/metadata#generation-number.
Uri
This property is required.
Changes to this property will trigger replacement.
string
The Cloud Storage uri pointing to the ipynb file.
Generation Changes to this property will trigger replacement. string
The version of the Cloud Storage object to read. If unset, the current version of the object is read. See https://cloud.google.com/storage/docs/metadata#generation-number.
uri
This property is required.
Changes to this property will trigger replacement.
String
The Cloud Storage uri pointing to the ipynb file.
generation Changes to this property will trigger replacement. String
The version of the Cloud Storage object to read. If unset, the current version of the object is read. See https://cloud.google.com/storage/docs/metadata#generation-number.
uri
This property is required.
Changes to this property will trigger replacement.
string
The Cloud Storage uri pointing to the ipynb file.
generation Changes to this property will trigger replacement. string
The version of the Cloud Storage object to read. If unset, the current version of the object is read. See https://cloud.google.com/storage/docs/metadata#generation-number.
uri
This property is required.
Changes to this property will trigger replacement.
str
The Cloud Storage uri pointing to the ipynb file.
generation Changes to this property will trigger replacement. str
The version of the Cloud Storage object to read. If unset, the current version of the object is read. See https://cloud.google.com/storage/docs/metadata#generation-number.
uri
This property is required.
Changes to this property will trigger replacement.
String
The Cloud Storage uri pointing to the ipynb file.
generation Changes to this property will trigger replacement. String
The version of the Cloud Storage object to read. If unset, the current version of the object is read. See https://cloud.google.com/storage/docs/metadata#generation-number.

Import

NotebookExecution can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/notebookExecutionJobs/{{notebook_execution_job_id}}

  • {{project}}/{{location}}/{{notebook_execution_job_id}}

  • {{location}}/{{notebook_execution_job_id}}

When using the pulumi import command, NotebookExecution can be imported using one of the formats above. For example:

$ pulumi import gcp:colab/notebookExecution:NotebookExecution default projects/{{project}}/locations/{{location}}/notebookExecutionJobs/{{notebook_execution_job_id}}
Copy
$ pulumi import gcp:colab/notebookExecution:NotebookExecution default {{project}}/{{location}}/{{notebook_execution_job_id}}
Copy
$ pulumi import gcp:colab/notebookExecution:NotebookExecution default {{location}}/{{notebook_execution_job_id}}
Copy

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.