Manage GCP Colab Runtime Template IAM Bindings

The gcp:colab/runtimeTemplateIamBinding:RuntimeTemplateIamBinding resource, part of the Pulumi GCP provider, grants IAM roles to members for Colab Enterprise runtime templates, controlling who can view, edit, or manage notebook environments. This guide focuses on two capabilities: authoritative role binding for multiple members and non-authoritative member addition.

IAM bindings reference existing runtime templates and require project and location configuration. The examples are intentionally small. Combine them with your own runtime template resources and access policies.

Grant a role to multiple members

Teams managing runtime templates often need to grant viewer or editor access to multiple users or service accounts at once.

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

const binding = new gcp.colab.RuntimeTemplateIamBinding("binding", {
    project: runtime_template.project,
    location: runtime_template.location,
    runtimeTemplate: runtime_template.name,
    role: "roles/viewer",
    members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp

binding = gcp.colab.RuntimeTemplateIamBinding("binding",
    project=runtime_template["project"],
    location=runtime_template["location"],
    runtime_template=runtime_template["name"],
    role="roles/viewer",
    members=["user:jane@example.com"])
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/colab"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := colab.NewRuntimeTemplateIamBinding(ctx, "binding", &colab.RuntimeTemplateIamBindingArgs{
			Project:         pulumi.Any(runtime_template.Project),
			Location:        pulumi.Any(runtime_template.Location),
			RuntimeTemplate: pulumi.Any(runtime_template.Name),
			Role:            pulumi.String("roles/viewer"),
			Members: pulumi.StringArray{
				pulumi.String("user:jane@example.com"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var binding = new Gcp.Colab.RuntimeTemplateIamBinding("binding", new()
    {
        Project = runtime_template.Project,
        Location = runtime_template.Location,
        RuntimeTemplate = runtime_template.Name,
        Role = "roles/viewer",
        Members = new[]
        {
            "user:jane@example.com",
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.colab.RuntimeTemplateIamBinding;
import com.pulumi.gcp.colab.RuntimeTemplateIamBindingArgs;
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 binding = new RuntimeTemplateIamBinding("binding", RuntimeTemplateIamBindingArgs.builder()
            .project(runtime_template.project())
            .location(runtime_template.location())
            .runtimeTemplate(runtime_template.name())
            .role("roles/viewer")
            .members("user:jane@example.com")
            .build());

    }
}
resources:
  binding:
    type: gcp:colab:RuntimeTemplateIamBinding
    properties:
      project: ${["runtime-template"].project}
      location: ${["runtime-template"].location}
      runtimeTemplate: ${["runtime-template"].name}
      role: roles/viewer
      members:
        - user:jane@example.com

RuntimeTemplateIamBinding is authoritative for the specified role: it replaces all members for that role while preserving other roles on the template. The members array accepts user accounts, service accounts, groups, and special identifiers like allAuthenticatedUsers. The role property specifies which permission set to grant, and runtimeTemplate identifies the target resource.

Add a single member to a role

When you need to grant access to one additional user without affecting existing members, use RuntimeTemplateIamMember.

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

const member = new gcp.colab.RuntimeTemplateIamMember("member", {
    project: runtime_template.project,
    location: runtime_template.location,
    runtimeTemplate: runtime_template.name,
    role: "roles/viewer",
    member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp

member = gcp.colab.RuntimeTemplateIamMember("member",
    project=runtime_template["project"],
    location=runtime_template["location"],
    runtime_template=runtime_template["name"],
    role="roles/viewer",
    member="user:jane@example.com")
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/colab"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := colab.NewRuntimeTemplateIamMember(ctx, "member", &colab.RuntimeTemplateIamMemberArgs{
			Project:         pulumi.Any(runtime_template.Project),
			Location:        pulumi.Any(runtime_template.Location),
			RuntimeTemplate: pulumi.Any(runtime_template.Name),
			Role:            pulumi.String("roles/viewer"),
			Member:          pulumi.String("user:jane@example.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var member = new Gcp.Colab.RuntimeTemplateIamMember("member", new()
    {
        Project = runtime_template.Project,
        Location = runtime_template.Location,
        RuntimeTemplate = runtime_template.Name,
        Role = "roles/viewer",
        Member = "user:jane@example.com",
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.colab.RuntimeTemplateIamMember;
import com.pulumi.gcp.colab.RuntimeTemplateIamMemberArgs;
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 member = new RuntimeTemplateIamMember("member", RuntimeTemplateIamMemberArgs.builder()
            .project(runtime_template.project())
            .location(runtime_template.location())
            .runtimeTemplate(runtime_template.name())
            .role("roles/viewer")
            .member("user:jane@example.com")
            .build());

    }
}
resources:
  member:
    type: gcp:colab:RuntimeTemplateIamMember
    properties:
      project: ${["runtime-template"].project}
      location: ${["runtime-template"].location}
      runtimeTemplate: ${["runtime-template"].name}
      role: roles/viewer
      member: user:jane@example.com

RuntimeTemplateIamMember is non-authoritative: it adds a single member to a role without replacing existing members. This lets you incrementally grant access without coordinating with other IAM resources. The member property takes a single identity string, while role and runtimeTemplate work the same as in RuntimeTemplateIamBinding.

Beyond these examples

These snippets focus on specific IAM binding features: role-based access control and authoritative vs non-authoritative binding. They’re intentionally minimal rather than full access management solutions.

The examples reference pre-existing infrastructure such as Colab Enterprise runtime templates and GCP project with location configured. They focus on configuring IAM bindings rather than provisioning the underlying resources.

To keep things focused, common IAM patterns are omitted, including:

  • Conditional IAM bindings (condition property)
  • Full policy replacement (RuntimeTemplateIamPolicy)
  • Custom role definitions
  • Federated identity configuration

These omissions are intentional: the goal is to illustrate how IAM binding resources are wired, not provide drop-in access control modules. See the RuntimeTemplateIamBinding resource reference for all available configuration options.

Let's manage GCP Colab Runtime Template IAM Bindings

Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.

Try Pulumi Cloud for FREE

Frequently Asked Questions

Resource Conflicts & Compatibility
Can I use RuntimeTemplateIamPolicy with RuntimeTemplateIamBinding or RuntimeTemplateIamMember?
No, RuntimeTemplateIamPolicy cannot be used with RuntimeTemplateIamBinding or RuntimeTemplateIamMember because they will conflict over the policy configuration. Choose one approach: use IamPolicy alone for full control, or use IamBinding/IamMember together.
Can I use RuntimeTemplateIamBinding and RuntimeTemplateIamMember together?
Yes, but only if they don’t grant privileges to the same role. Each role must be managed by only one resource type to avoid conflicts.
Resource Selection
Which IAM resource should I use to manage RuntimeTemplate permissions?

You have three options:

  1. RuntimeTemplateIamPolicy - Authoritative, replaces the entire IAM policy
  2. RuntimeTemplateIamBinding - Authoritative for a specific role, preserves other roles
  3. RuntimeTemplateIamMember - Non-authoritative, adds a single member to a role while preserving other members
Configuration & Permissions
How do I specify custom roles?
Custom roles must use the format [projects|organizations]/{parent-name}/roles/{role-name}. For example, projects/my-project/roles/my-custom-role.
What member identity formats are supported?

The members property supports multiple formats:

  • allUsers - Anyone on the internet
  • allAuthenticatedUsers - Anyone with a Google account
  • user:{email} - Specific Google account (e.g., user:alice@gmail.com)
  • serviceAccount:{email} - Service account (e.g., serviceAccount:my-app@appspot.gserviceaccount.com)
  • group:{email} - Google group (e.g., group:admins@example.com)
  • domain:{domain} - G Suite domain (e.g., domain:example.com)
  • projectOwner:projectid, projectEditor:projectid, projectViewer:projectid - Project-level roles
  • Federated identities (e.g., principal://iam.googleapis.com/...)
What properties can't I change after creating the resource?
The following properties are immutable: location, project, role, runtimeTemplate, and condition.

Using a different cloud?

Explore security guides for other cloud providers: