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: authoritative role bindings with multiple members, time-based access with IAM Conditions, and non-authoritative member additions.

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

Grant a role to multiple members at once

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, meaning it replaces any existing member list for that role. The name, project, and zone properties identify which storage pool to configure.

Add time-based access with IAM Conditions

Access requirements sometimes include expiration dates or time windows. IAM Conditions attach temporal constraints to role bindings.

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 a CEL expression that must evaluate to true for the binding to apply. The title identifies the condition, while expression defines the logic (here, checking if the current time is before 2020-01-01). When the condition becomes false, access is automatically revoked. IAM Conditions have known limitations documented in the GCP IAM Conditions overview.

Add a single member to an existing role

When you need to grant access to one additional user without affecting other members, StoragePoolIamMember provides non-authoritative updates.

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

Unlike StoragePoolIamBinding, StoragePoolIamMember adds a single identity to a role without replacing the existing member list. The member property specifies one identity (user, service account, group, or domain). Multiple StoragePoolIamMember resources can target the same role, and they can coexist with StoragePoolIamBinding resources as long as they don’t manage the same role.

Beyond these examples

These snippets focus on specific IAM binding features: role binding with multiple members, IAM Conditions for temporal access, and non-authoritative member additions. They’re intentionally minimal rather than full access control configurations.

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

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

  • Full policy replacement (StoragePoolIamPolicy)
  • Complex condition expressions (location, resource attributes)
  • Custom role definitions
  • Federated identity configuration

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 Selection & Conflicts
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 but preserves other roles. StoragePoolIamMember is non-authoritative and adds individual members without affecting other members for the same role.
Can I use StoragePoolIamPolicy with StoragePoolIamBinding or StoragePoolIamMember?
No, StoragePoolIamPolicy cannot be used with StoragePoolIamBinding or StoragePoolIamMember because they will conflict over the policy configuration.
Can I use StoragePoolIamBinding and StoragePoolIamMember together?
Yes, but only if they manage different roles. Using both resources for the same role will cause conflicts.
Configuration & Properties
What properties can't I change after creating a StoragePoolIamBinding?
The role, name, project, zone, and condition properties are immutable and cannot be changed after creation.
How do I specify a role for the IAM binding?
Use the role property with a standard role like roles/compute.viewer or a custom role in the format [projects|organizations]/{parent-name}/roles/{role-name}.
What member identity formats are supported?
Supported formats include allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner:projectid, projectEditor:projectid, projectViewer:projectid, and federated identities like principal://iam.googleapis.com/....
What happens if I don't specify a project or zone?
If not specified, project and zone are parsed from the parent resource identifier. If still unavailable, project defaults to the provider configuration and zone to the provider’s zone setting.
IAM Conditions & Advanced Features
How do I add time-based conditions to an IAM binding?
Use the condition property with title, description, and expression fields. For example: expression: "request.time < timestamp(\"2020-01-01T00:00:00Z\")" creates an expiring permission.
Are there limitations when using IAM Conditions?
Yes, IAM Conditions have known limitations. Review the GCP IAM Conditions limitations documentation if you encounter issues.
Can I import existing IAM bindings into Pulumi?
Yes, use the format projects/{{project}}/zones/{{zone}}/storagePools/{{storage_pool}} roles/compute.viewer for bindings. The resource identifier, role, and member identity are space-delimited for member imports.

Using a different cloud?

Explore security guides for other cloud providers: