The gcp:gkebackup/restorePlanIamMember:RestorePlanIamMember resource, part of the Pulumi GCP provider, manages IAM permissions for GKE backup restore plans by adding individual members to roles without affecting other role assignments. This guide focuses on three approaches: adding single members, binding multiple members, and replacing entire policies.
These resources reference existing restore plans and have compatibility constraints. RestorePlanIamPolicy cannot be used with RestorePlanIamBinding or RestorePlanIamMember. RestorePlanIamBinding and RestorePlanIamMember can coexist only if they manage different roles. The examples are intentionally small. Combine them with your own restore plan infrastructure and access control requirements.
Grant a role to a single member
When you need to give specific permissions to one user or service account, RestorePlanIamMember adds them without changing other role 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 member property identifies who receives access using formats like “user:jane@example.com” or “serviceAccount:app@project.iam.gserviceaccount.com”. The role property specifies the permission level. This resource is non-authoritative: it adds the member to the role while preserving other members already assigned to that role.
Grant a role to multiple members at once
When several users or service accounts need identical permissions, RestorePlanIamBinding assigns them as a group.
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 members property takes a list of identifiers. RestorePlanIamBinding is authoritative for the specified role: it replaces all members for that role but leaves other roles untouched. If you later add another RestorePlanIamBinding for the same role, they will conflict.
Replace the entire IAM policy
Organizations with strict access requirements can define the complete IAM policy from scratch using RestorePlanIamPolicy.
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.RestorePlanIamPolicy("policy", {
project: allNs.project,
location: allNs.location,
name: allNs.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.RestorePlanIamPolicy("policy",
project=all_ns["project"],
location=all_ns["location"],
name=all_ns["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.NewRestorePlanIamPolicy(ctx, "policy", &gkebackup.RestorePlanIamPolicyArgs{
Project: pulumi.Any(allNs.Project),
Location: pulumi.Any(allNs.Location),
Name: pulumi.Any(allNs.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.RestorePlanIamPolicy("policy", new()
{
Project = allNs.Project,
Location = allNs.Location,
Name = allNs.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.RestorePlanIamPolicy;
import com.pulumi.gcp.gkebackup.RestorePlanIamPolicyArgs;
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 RestorePlanIamPolicy("policy", RestorePlanIamPolicyArgs.builder()
.project(allNs.project())
.location(allNs.location())
.name(allNs.name())
.policyData(admin.policyData())
.build());
}
}
resources:
policy:
type: gcp:gkebackup:RestorePlanIamPolicy
properties:
project: ${allNs.project}
location: ${allNs.location}
name: ${allNs.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 contains the full policy definition, typically constructed using getIAMPolicy. RestorePlanIamPolicy is fully authoritative: it replaces the entire IAM policy for the restore plan. This approach cannot coexist with RestorePlanIamBinding or RestorePlanIamMember because they would compete to control the policy.
Beyond these examples
These snippets focus on specific IAM management approaches: incremental member and binding management, and authoritative policy replacement. They’re intentionally minimal rather than complete access control solutions.
The examples reference pre-existing infrastructure such as GKE backup restore plans identified by project, location, and name. They focus on IAM configuration rather than provisioning the restore plans themselves.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM bindings (condition property)
- Custom role definitions and formatting
- Policy conflict resolution between resource types
- Federated identity configuration
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 RestorePlanIamMember resource reference for all available configuration options.
Let's manage GCP GKE Backup Restore Plan IAM Access
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 specific role, replacing all members for that role while preserving other roles. RestorePlanIamMember is non-authoritative, adding a single member to a role without affecting other members.RestorePlanIamPolicy cannot be used with RestorePlanIamBinding or RestorePlanIamMember because they will conflict over the policy state.Identity & Role Configuration
allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner/Editor/Viewer:{projectid}, or federated identities (e.g., principal://iam.googleapis.com/...).[projects|organizations]/{parent-name}/roles/{role-name} (e.g., projects/my-project/roles/my-custom-role).Common Use Cases
RestorePlanIamMember with member set to user:{email} (e.g., user:jane@example.com) and specify the desired role.RestorePlanIamBinding with a members array containing all user identities and specify the role to grant.