The gcp:gkebackup/restorePlanIamMember:RestorePlanIamMember resource, part of the Pulumi GCP provider, manages IAM permissions for GKE Backup RestorePlans, controlling which identities can access or modify restore configurations. This guide focuses on three capabilities: single-member role grants, multi-member role bindings, and full policy replacement.
GCP provides three IAM resources for RestorePlans, each with different authoritativeness guarantees. RestorePlanIamMember is non-authoritative (preserves other members), RestorePlanIamBinding is authoritative for a specific role (replaces all members for that role), and RestorePlanIamPolicy is authoritative for the entire policy (replaces all roles and members). The examples are intentionally small. Combine them with your own RestorePlans and identity management.
Grant a role to a single member
Most IAM configurations start by granting a specific role to one identity without affecting other members who already have the same role.
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 specifies the identity receiving access, using formats like “user:email@example.com” or “serviceAccount:name@project.iam.gserviceaccount.com”. The role property defines the permission level. This resource is non-authoritative, meaning it adds the member without removing others who already have the role.
Grant a role to multiple members at once
When multiple identities need the same role, RestorePlanIamBinding defines the complete member list in a single resource.
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 lists all identities that should have the role. This resource is authoritative for the specified role, replacing any existing members. If you later add another RestorePlanIamBinding for the same role, they will conflict. Use RestorePlanIamMember instead if you need to manage members independently.
Replace the entire IAM policy
Some workflows require complete control over all roles and members, replacing any existing policy.
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 complete IAM policy document, typically constructed using the getIAMPolicy data source. This resource is authoritative for the entire policy and cannot be used alongside RestorePlanIamBinding or RestorePlanIamMember, as they will conflict over policy ownership.
Beyond these examples
These snippets focus on specific IAM management features: single-member grants, multi-member role bindings, and full policy replacement. They’re intentionally minimal rather than complete access control configurations.
The examples reference pre-existing infrastructure such as GKE Backup RestorePlan resources and Google Cloud identities (users, service accounts, groups). They focus on configuring IAM permissions rather than provisioning the underlying resources.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM bindings (condition property)
- Custom role definitions
- Federated identity configuration
- Policy conflict resolution between resource types
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 Conflicts & Compatibility
RestorePlanIamPolicy cannot be used together with RestorePlanIamBinding or RestorePlanIamMember because they will conflict over the IAM policy configuration.Resource Selection & Use Cases
RestorePlanIamPolicy is authoritative and replaces the entire IAM policy. RestorePlanIamBinding is authoritative for a specific role, managing all members for that role while preserving other roles. RestorePlanIamMember is non-authoritative, adding individual members without affecting other members for the same role.RestorePlanIamMember to add individual permissions without affecting existing ones, RestorePlanIamBinding to manage all members for a specific role, or RestorePlanIamPolicy for complete control over the entire IAM policy.Configuration & Identity Formats
member parameter supports multiple formats: allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner/Editor/Viewer:{projectid}, and federated identities like principal://iam.googleapis.com/....[projects|organizations]/{parent-name}/roles/{role-name}. For example, projects/my-project/roles/my-custom-role or organizations/my-org/roles/my-custom-role.member, role, location, name, and project properties are all immutable and cannot be changed after the resource is created.