Manage GCP Compute Storage Pool IAM Bindings

The gcp:compute/storagePoolIamBinding:StoragePoolIamBinding resource, part of the Pulumi GCP provider, manages IAM role bindings for Compute Engine storage pools, controlling which identities can access pool resources. This guide focuses on three capabilities: granting roles to multiple members, time-based access with IAM Conditions, and adding individual members non-authoritatively.

Storage pool IAM bindings reference existing storage pools by name, zone, and project. The examples are intentionally small. Combine them with your own storage pool infrastructure and identity management strategy.

Grant a role to multiple members

Teams managing storage pool access often need to grant the same role to multiple users, service accounts, or groups simultaneously.

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

const binding = new gcp.compute.StoragePoolIamBinding("binding", {
    project: test_storage_pool_basic.project,
    zone: test_storage_pool_basic.zone,
    name: test_storage_pool_basic.name,
    role: "roles/compute.viewer",
    members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp

binding = gcp.compute.StoragePoolIamBinding("binding",
    project=test_storage_pool_basic["project"],
    zone=test_storage_pool_basic["zone"],
    name=test_storage_pool_basic["name"],
    role="roles/compute.viewer",
    members=["user:jane@example.com"])
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewStoragePoolIamBinding(ctx, "binding", &compute.StoragePoolIamBindingArgs{
			Project: pulumi.Any(test_storage_pool_basic.Project),
			Zone:    pulumi.Any(test_storage_pool_basic.Zone),
			Name:    pulumi.Any(test_storage_pool_basic.Name),
			Role:    pulumi.String("roles/compute.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.Compute.StoragePoolIamBinding("binding", new()
    {
        Project = test_storage_pool_basic.Project,
        Zone = test_storage_pool_basic.Zone,
        Name = test_storage_pool_basic.Name,
        Role = "roles/compute.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.compute.StoragePoolIamBinding;
import com.pulumi.gcp.compute.StoragePoolIamBindingArgs;
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 StoragePoolIamBinding("binding", StoragePoolIamBindingArgs.builder()
            .project(test_storage_pool_basic.project())
            .zone(test_storage_pool_basic.zone())
            .name(test_storage_pool_basic.name())
            .role("roles/compute.viewer")
            .members("user:jane@example.com")
            .build());

    }
}
resources:
  binding:
    type: gcp:compute:StoragePoolIamBinding
    properties:
      project: ${["test-storage-pool-basic"].project}
      zone: ${["test-storage-pool-basic"].zone}
      name: ${["test-storage-pool-basic"].name}
      role: roles/compute.viewer
      members:
        - user:jane@example.com

The role property specifies which permission set to grant (e.g., “roles/compute.viewer”). The members array lists all identities that receive this role. StoragePoolIamBinding is authoritative for the specified role: it replaces any existing members for that role, but preserves other roles on the storage pool.

Add time-based access with IAM Conditions

Temporary access grants expire automatically when you attach IAM Conditions, eliminating manual cleanup for contractors or time-limited projects.

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

const binding = new gcp.compute.StoragePoolIamBinding("binding", {
    project: test_storage_pool_basic.project,
    zone: test_storage_pool_basic.zone,
    name: test_storage_pool_basic.name,
    role: "roles/compute.viewer",
    members: ["user:jane@example.com"],
    condition: {
        title: "expires_after_2019_12_31",
        description: "Expiring at midnight of 2019-12-31",
        expression: "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
    },
});
import pulumi
import pulumi_gcp as gcp

binding = gcp.compute.StoragePoolIamBinding("binding",
    project=test_storage_pool_basic["project"],
    zone=test_storage_pool_basic["zone"],
    name=test_storage_pool_basic["name"],
    role="roles/compute.viewer",
    members=["user:jane@example.com"],
    condition={
        "title": "expires_after_2019_12_31",
        "description": "Expiring at midnight of 2019-12-31",
        "expression": "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
    })
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewStoragePoolIamBinding(ctx, "binding", &compute.StoragePoolIamBindingArgs{
			Project: pulumi.Any(test_storage_pool_basic.Project),
			Zone:    pulumi.Any(test_storage_pool_basic.Zone),
			Name:    pulumi.Any(test_storage_pool_basic.Name),
			Role:    pulumi.String("roles/compute.viewer"),
			Members: pulumi.StringArray{
				pulumi.String("user:jane@example.com"),
			},
			Condition: &compute.StoragePoolIamBindingConditionArgs{
				Title:       pulumi.String("expires_after_2019_12_31"),
				Description: pulumi.String("Expiring at midnight of 2019-12-31"),
				Expression:  pulumi.String("request.time < timestamp(\"2020-01-01T00:00:00Z\")"),
			},
		})
		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.Compute.StoragePoolIamBinding("binding", new()
    {
        Project = test_storage_pool_basic.Project,
        Zone = test_storage_pool_basic.Zone,
        Name = test_storage_pool_basic.Name,
        Role = "roles/compute.viewer",
        Members = new[]
        {
            "user:jane@example.com",
        },
        Condition = new Gcp.Compute.Inputs.StoragePoolIamBindingConditionArgs
        {
            Title = "expires_after_2019_12_31",
            Description = "Expiring at midnight of 2019-12-31",
            Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
        },
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.StoragePoolIamBinding;
import com.pulumi.gcp.compute.StoragePoolIamBindingArgs;
import com.pulumi.gcp.compute.inputs.StoragePoolIamBindingConditionArgs;
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 StoragePoolIamBinding("binding", StoragePoolIamBindingArgs.builder()
            .project(test_storage_pool_basic.project())
            .zone(test_storage_pool_basic.zone())
            .name(test_storage_pool_basic.name())
            .role("roles/compute.viewer")
            .members("user:jane@example.com")
            .condition(StoragePoolIamBindingConditionArgs.builder()
                .title("expires_after_2019_12_31")
                .description("Expiring at midnight of 2019-12-31")
                .expression("request.time < timestamp(\"2020-01-01T00:00:00Z\")")
                .build())
            .build());

    }
}
resources:
  binding:
    type: gcp:compute:StoragePoolIamBinding
    properties:
      project: ${["test-storage-pool-basic"].project}
      zone: ${["test-storage-pool-basic"].zone}
      name: ${["test-storage-pool-basic"].name}
      role: roles/compute.viewer
      members:
        - user:jane@example.com
      condition:
        title: expires_after_2019_12_31
        description: Expiring at midnight of 2019-12-31
        expression: request.time < timestamp("2020-01-01T00:00:00Z")

The condition block adds time-based constraints to the binding. The expression property uses CEL (Common Expression Language) to define when access is valid. Here, access expires at midnight on 2020-01-01. The title and description provide human-readable context for auditing.

Add a single member to an existing role

When you need to grant access to one additional user without affecting other members, StoragePoolIamMember adds that identity non-authoritatively.

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

const member = new gcp.compute.StoragePoolIamMember("member", {
    project: test_storage_pool_basic.project,
    zone: test_storage_pool_basic.zone,
    name: test_storage_pool_basic.name,
    role: "roles/compute.viewer",
    member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp

member = gcp.compute.StoragePoolIamMember("member",
    project=test_storage_pool_basic["project"],
    zone=test_storage_pool_basic["zone"],
    name=test_storage_pool_basic["name"],
    role="roles/compute.viewer",
    member="user:jane@example.com")
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewStoragePoolIamMember(ctx, "member", &compute.StoragePoolIamMemberArgs{
			Project: pulumi.Any(test_storage_pool_basic.Project),
			Zone:    pulumi.Any(test_storage_pool_basic.Zone),
			Name:    pulumi.Any(test_storage_pool_basic.Name),
			Role:    pulumi.String("roles/compute.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.Compute.StoragePoolIamMember("member", new()
    {
        Project = test_storage_pool_basic.Project,
        Zone = test_storage_pool_basic.Zone,
        Name = test_storage_pool_basic.Name,
        Role = "roles/compute.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.compute.StoragePoolIamMember;
import com.pulumi.gcp.compute.StoragePoolIamMemberArgs;
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 StoragePoolIamMember("member", StoragePoolIamMemberArgs.builder()
            .project(test_storage_pool_basic.project())
            .zone(test_storage_pool_basic.zone())
            .name(test_storage_pool_basic.name())
            .role("roles/compute.viewer")
            .member("user:jane@example.com")
            .build());

    }
}
resources:
  member:
    type: gcp:compute:StoragePoolIamMember
    properties:
      project: ${["test-storage-pool-basic"].project}
      zone: ${["test-storage-pool-basic"].zone}
      name: ${["test-storage-pool-basic"].name}
      role: roles/compute.viewer
      member: user:jane@example.com

The member property specifies a single identity to add. Unlike StoragePoolIamBinding, this resource is non-authoritative: it adds the specified member without removing other members who already have the same role. Use this when multiple teams manage access independently.

Beyond these examples

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

The examples reference pre-existing infrastructure such as storage pools (by name, zone, and project). They focus on configuring IAM bindings rather than provisioning storage pools themselves.

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

  • Policy-level management (StoragePoolIamPolicy)
  • Multiple role bindings in one configuration
  • Custom role definitions
  • Federated identity and workload identity pool examples

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

Let's manage GCP Compute Storage Pool 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 Compatibility & Conflicts
Can I use StoragePoolIamPolicy with StoragePoolIamBinding or StoragePoolIamMember?
No, gcp.compute.StoragePoolIamPolicy cannot be used with gcp.compute.StoragePoolIamBinding or gcp.compute.StoragePoolIamMember because they will conflict over the policy. Use either the authoritative StoragePoolIamPolicy (which replaces the entire policy) or the role-specific StoragePoolIamBinding/StoragePoolIamMember resources.
Can I use StoragePoolIamBinding and StoragePoolIamMember together?
Yes, but only if they grant different roles. Using both resources for the same role will cause conflicts.
IAM Configuration & Roles
What's the difference between StoragePoolIamPolicy, StoragePoolIamBinding, and StoragePoolIamMember?
StoragePoolIamPolicy is authoritative and replaces the entire IAM policy. StoragePoolIamBinding is authoritative for a specific role and grants it to multiple members while preserving other roles. StoragePoolIamMember is non-authoritative and adds a single member to a role while preserving other members.
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 or organizations/my-org/roles/my-custom-role.
How do I add time-based or conditional access restrictions?
Use the condition property with title, description, and expression fields. For example, to expire access at a specific time, set expression to request.time < timestamp("2020-01-01T00:00:00Z").
What are the limitations of IAM Conditions?
IAM Conditions are supported but have known limitations. Review the GCP IAM Conditions limitations documentation if you encounter issues when using conditions.
Identity & Member Management
What types of identities can I grant access to?
The members property supports multiple identity types: specific users (user:alice@gmail.com), service accounts (serviceAccount:my-app@appspot.gserviceaccount.com), groups (group:admins@example.com), domains (domain:example.com), project roles (projectOwner:my-project), special identifiers (allUsers, allAuthenticatedUsers), and federated identities (principal://iam.googleapis.com/...).
Immutability & Lifecycle
What properties can't I change after creating a StoragePoolIamBinding?
The role, name, project, zone, and condition properties are all immutable. To change any of these, you must recreate the resource.

Using a different cloud?

Explore security guides for other cloud providers: