The gcp:gkebackup/restorePlanIamBinding:RestorePlanIamBinding resource, part of the Pulumi GCP provider, manages IAM role bindings for GKE Backup RestorePlans. This guide focuses on two capabilities: authoritative role-to-members binding and non-authoritative member addition.
IAM bindings reference existing RestorePlan resources and require project and location identifiers. The examples are intentionally small. Combine them with your own RestorePlan resources and identity management workflows.
Grant a role to multiple members
Teams managing restore plans often need to grant the same role to multiple users or service accounts at once, such as giving viewer access to an operations team.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.gkebackup.RestorePlanIamBinding("binding", {
project: allNs.project,
location: allNs.location,
name: allNs.name,
role: "roles/viewer",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.gkebackup.RestorePlanIamBinding("binding",
project=all_ns["project"],
location=all_ns["location"],
name=all_ns["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.NewRestorePlanIamBinding(ctx, "binding", &gkebackup.RestorePlanIamBindingArgs{
Project: pulumi.Any(allNs.Project),
Location: pulumi.Any(allNs.Location),
Name: pulumi.Any(allNs.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.RestorePlanIamBinding("binding", new()
{
Project = allNs.Project,
Location = allNs.Location,
Name = allNs.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.RestorePlanIamBinding;
import com.pulumi.gcp.gkebackup.RestorePlanIamBindingArgs;
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 RestorePlanIamBinding("binding", RestorePlanIamBindingArgs.builder()
.project(allNs.project())
.location(allNs.location())
.name(allNs.name())
.role("roles/viewer")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:gkebackup:RestorePlanIamBinding
properties:
project: ${allNs.project}
location: ${allNs.location}
name: ${allNs.name}
role: roles/viewer
members:
- user:jane@example.com
The RestorePlanIamBinding resource is authoritative for the specified role: it replaces all members for that role while preserving other roles on the RestorePlan. The members array accepts user accounts, service accounts, groups, and domain identities. The project, location, and name properties identify which RestorePlan to bind the role to.
Add a single member to a role
When onboarding individual users or granting access to specific service accounts, teams add members one at a time without affecting existing assignments.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.gkebackup.RestorePlanIamMember("member", {
project: allNs.project,
location: allNs.location,
name: allNs.name,
role: "roles/viewer",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.gkebackup.RestorePlanIamMember("member",
project=all_ns["project"],
location=all_ns["location"],
name=all_ns["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.NewRestorePlanIamMember(ctx, "member", &gkebackup.RestorePlanIamMemberArgs{
Project: pulumi.Any(allNs.Project),
Location: pulumi.Any(allNs.Location),
Name: pulumi.Any(allNs.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.RestorePlanIamMember("member", new()
{
Project = allNs.Project,
Location = allNs.Location,
Name = allNs.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.RestorePlanIamMember;
import com.pulumi.gcp.gkebackup.RestorePlanIamMemberArgs;
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 RestorePlanIamMember("member", RestorePlanIamMemberArgs.builder()
.project(allNs.project())
.location(allNs.location())
.name(allNs.name())
.role("roles/viewer")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:gkebackup:RestorePlanIamMember
properties:
project: ${allNs.project}
location: ${allNs.location}
name: ${allNs.name}
role: roles/viewer
member: user:jane@example.com
The RestorePlanIamMember resource is non-authoritative: it adds one member to a role without removing other members already assigned to that role. Use this when you need to grant access incrementally, such as onboarding new team members. The member property accepts the same identity formats as the members array in RestorePlanIamBinding.
Beyond these examples
These snippets focus on specific IAM binding features: role-based access control 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 GKE Backup RestorePlan resources and a GCP project with configured location. They focus on configuring IAM bindings rather than provisioning the underlying backup infrastructure.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM bindings (condition property)
- Full policy replacement (RestorePlanIamPolicy)
- Custom role definitions
- Federated identity configuration
These omissions are intentional: the goal is to illustrate how each IAM binding approach is wired, not provide drop-in access control modules. See the RestorePlanIamBinding resource reference for all available configuration options.
Let's configure GCP GKE Backup Restore Plan IAM Bindings
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Resource Selection & Conflicts
RestorePlanIamPolicy is authoritative and replaces the entire IAM policy. RestorePlanIamBinding is authoritative for a given role, granting it to a list of members while preserving other roles. RestorePlanIamMember is non-authoritative, adding a single member to a role while preserving other members.RestorePlanIamPolicy cannot be used with RestorePlanIamBinding or RestorePlanIamMember as they will conflict over the policy.IAM Configuration
[projects|organizations]/{parent-name}/roles/{role-name}, for example projects/my-project/roles/my-custom-role.allUsers, allAuthenticatedUsers, user:{emailid}, serviceAccount:{emailid}, group:{emailid}, domain:{domain}, projectOwner:projectid, projectEditor:projectid, projectViewer:projectid, or federated identities like principal://iam.googleapis.com/locations/global/workforcePools/example-contractors/subject/joe@example.com.location, name, project, role, and condition properties cannot be changed after creation.Import & Custom Roles
projects/my-project/roles/my-custom-role or organizations/my-org/roles/my-custom-role.