Manage GCP GKE Backup Plan IAM Access

The gcp:gkebackup/backupPlanIamMember:BackupPlanIamMember resource, part of the Pulumi GCP provider, manages IAM permissions for GKE backup plans. The GCP provider offers three related resources for this purpose: BackupPlanIamMember adds individual members to roles without affecting other permissions (non-authoritative), BackupPlanIamBinding manages all members for a specific role (authoritative for that role), and BackupPlanIamPolicy replaces the entire IAM policy (fully authoritative). This guide focuses on three capabilities: adding single members, binding multiple members to a role, and replacing complete policies.

All three resources reference existing backup plans and require valid IAM member identifiers. The examples are intentionally small. Combine them with your own backup plan infrastructure and identity management strategy.

Grant a single user access to a backup plan

When you need to add one user or service account to a backup plan without affecting other permissions, BackupPlanIamMember provides incremental access control.

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

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

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

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gkebackup.NewBackupPlanIamMember(ctx, "member", &gkebackup.BackupPlanIamMemberArgs{
			Project:  pulumi.Any(basic.Project),
			Location: pulumi.Any(basic.Location),
			Name:     pulumi.Any(basic.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.GkeBackup.BackupPlanIamMember("member", new()
    {
        Project = basic.Project,
        Location = basic.Location,
        Name = basic.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.gkebackup.BackupPlanIamMember;
import com.pulumi.gcp.gkebackup.BackupPlanIamMemberArgs;
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 BackupPlanIamMember("member", BackupPlanIamMemberArgs.builder()
            .project(basic.project())
            .location(basic.location())
            .name(basic.name())
            .role("roles/viewer")
            .member("user:jane@example.com")
            .build());

    }
}
resources:
  member:
    type: gcp:gkebackup:BackupPlanIamMember
    properties:
      project: ${basic.project}
      location: ${basic.location}
      name: ${basic.name}
      role: roles/viewer
      member: user:jane@example.com

The member property specifies a single identity using IAM’s standard syntax (user:email, serviceAccount:email, group:email, or special identifiers like allUsers). The role property defines what that identity can do. This resource adds the member to the role without modifying other members who already have access, making it safe to use alongside other IAM resources as long as they don’t grant the same role.

Grant a role to multiple members at once

When several identities need the same permissions, BackupPlanIamBinding manages them as a group.

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

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

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

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gkebackup.NewBackupPlanIamBinding(ctx, "binding", &gkebackup.BackupPlanIamBindingArgs{
			Project:  pulumi.Any(basic.Project),
			Location: pulumi.Any(basic.Location),
			Name:     pulumi.Any(basic.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.GkeBackup.BackupPlanIamBinding("binding", new()
    {
        Project = basic.Project,
        Location = basic.Location,
        Name = basic.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.gkebackup.BackupPlanIamBinding;
import com.pulumi.gcp.gkebackup.BackupPlanIamBindingArgs;
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 BackupPlanIamBinding("binding", BackupPlanIamBindingArgs.builder()
            .project(basic.project())
            .location(basic.location())
            .name(basic.name())
            .role("roles/viewer")
            .members("user:jane@example.com")
            .build());

    }
}
resources:
  binding:
    type: gcp:gkebackup:BackupPlanIamBinding
    properties:
      project: ${basic.project}
      location: ${basic.location}
      name: ${basic.name}
      role: roles/viewer
      members:
        - user:jane@example.com

The members property takes a list of identities that will all receive the specified role. This resource is authoritative for the role: it replaces all members for that role with the list you provide. If another member had this role before and isn’t in your list, they lose access. You can use BackupPlanIamBinding alongside BackupPlanIamMember resources as long as they manage different roles.

Replace the entire IAM policy for a backup plan

Organizations with strict access requirements sometimes need to define the complete IAM policy from scratch.

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

const admin = gcp.organizations.getIAMPolicy({
    bindings: [{
        role: "roles/viewer",
        members: ["user:jane@example.com"],
    }],
});
const policy = new gcp.gkebackup.BackupPlanIamPolicy("policy", {
    project: basic.project,
    location: basic.location,
    name: basic.name,
    policyData: admin.then(admin => admin.policyData),
});
import pulumi
import pulumi_gcp as gcp

admin = gcp.organizations.get_iam_policy(bindings=[{
    "role": "roles/viewer",
    "members": ["user:jane@example.com"],
}])
policy = gcp.gkebackup.BackupPlanIamPolicy("policy",
    project=basic["project"],
    location=basic["location"],
    name=basic["name"],
    policy_data=admin.policy_data)
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		admin, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
			Bindings: []organizations.GetIAMPolicyBinding{
				{
					Role: "roles/viewer",
					Members: []string{
						"user:jane@example.com",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = gkebackup.NewBackupPlanIamPolicy(ctx, "policy", &gkebackup.BackupPlanIamPolicyArgs{
			Project:    pulumi.Any(basic.Project),
			Location:   pulumi.Any(basic.Location),
			Name:       pulumi.Any(basic.Name),
			PolicyData: pulumi.String(admin.PolicyData),
		})
		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 admin = Gcp.Organizations.GetIAMPolicy.Invoke(new()
    {
        Bindings = new[]
        {
            new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
            {
                Role = "roles/viewer",
                Members = new[]
                {
                    "user:jane@example.com",
                },
            },
        },
    });

    var policy = new Gcp.GkeBackup.BackupPlanIamPolicy("policy", new()
    {
        Project = basic.Project,
        Location = basic.Location,
        Name = basic.Name,
        PolicyData = admin.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData),
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
import com.pulumi.gcp.gkebackup.BackupPlanIamPolicy;
import com.pulumi.gcp.gkebackup.BackupPlanIamPolicyArgs;
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) {
        final var admin = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
            .bindings(GetIAMPolicyBindingArgs.builder()
                .role("roles/viewer")
                .members("user:jane@example.com")
                .build())
            .build());

        var policy = new BackupPlanIamPolicy("policy", BackupPlanIamPolicyArgs.builder()
            .project(basic.project())
            .location(basic.location())
            .name(basic.name())
            .policyData(admin.policyData())
            .build());

    }
}
resources:
  policy:
    type: gcp:gkebackup:BackupPlanIamPolicy
    properties:
      project: ${basic.project}
      location: ${basic.location}
      name: ${basic.name}
      policyData: ${admin.policyData}
variables:
  admin:
    fn::invoke:
      function: gcp:organizations:getIAMPolicy
      arguments:
        bindings:
          - role: roles/viewer
            members:
              - user:jane@example.com

The policyData property accepts output from the getIAMPolicy data source, which defines all roles and their members in a single structure. This resource is fully authoritative: it replaces the entire IAM policy, removing any permissions not specified in the policy data. BackupPlanIamPolicy cannot be used with BackupPlanIamBinding or BackupPlanIamMember resources because they would conflict over policy ownership.

Beyond these examples

These snippets focus on specific IAM management features: incremental member grants, role-level binding management, and complete policy replacement. They’re intentionally minimal rather than full access control solutions.

The examples reference pre-existing infrastructure such as GKE backup plans (by name, location, and project). They focus on configuring IAM permissions rather than provisioning backup plans themselves.

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

  • Conditional IAM bindings (condition property)
  • Custom role definitions
  • Federated identity configuration
  • Policy conflict resolution strategies

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

Let's manage GCP GKE Backup Plan IAM Access

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 BackupPlanIamPolicy, BackupPlanIamBinding, and BackupPlanIamMember?
BackupPlanIamPolicy is authoritative and replaces the entire IAM policy. BackupPlanIamBinding is authoritative for a specific role, preserving other roles. BackupPlanIamMember is non-authoritative, adding a single member to a role while preserving other members.
Why are my BackupPlanIam resources conflicting?
BackupPlanIamPolicy cannot be used with BackupPlanIamBinding or BackupPlanIamMember because they manage policies differently and will conflict. Choose either the authoritative Policy resource OR the non-authoritative Binding/Member resources.
Can I use BackupPlanIamBinding and BackupPlanIamMember together?
Yes, but only if they don’t grant privileges to the same role. Each role must be managed by either Binding or Member, not both.
Configuration & Identity Formats
What member identity formats are supported?
You can use allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner/Editor/Viewer:{projectid}, and federated identities (e.g., principal://iam.googleapis.com/...).
How do I specify custom roles?
Custom roles must use the full format: [projects|organizations]/{parent-name}/roles/{role-name}. For example, projects/my-project/roles/my-custom-role.
Can I modify IAM bindings after creation?
No, all properties (location, member, name, project, role, condition) are immutable. You must recreate the resource to change any of these values.

Using a different cloud?

Explore security guides for other cloud providers: