The gcp:gkebackup/backupPlanIamMember:BackupPlanIamMember resource, part of the Pulumi GCP provider, grants IAM permissions to GKE backup plans by adding individual members to roles without affecting other permissions. This guide focuses on three capabilities: adding single members to roles, binding multiple members to one role, and replacing complete IAM policies.
GCP provides three related resources for managing backup plan IAM permissions. BackupPlanIamMember adds one identity to a role non-authoritatively. BackupPlanIamBinding manages all members for a single role authoritatively. BackupPlanIamPolicy replaces the entire policy. The examples are intentionally small. Combine them with your own backup plans and identity management strategy.
Grant a single user access to a backup plan
When you need to give one person or service account access without touching existing permissions, BackupPlanIamMember adds that identity to the specified role.
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 identifies who gets access using GCP’s identity format (user:, serviceAccount:, group:, etc.). The role property specifies what they can do. This resource preserves other members already granted the same role and doesn’t affect other roles in the policy.
Grant a role to multiple members at once
When several identities need identical permissions, BackupPlanIamBinding manages them as a group for that specific role.
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 array lists all identities that should have this role. BackupPlanIamBinding is authoritative for the specified role: it replaces the member list for that role but leaves other roles untouched. If you later remove an identity from the array, that identity loses access.
Replace the entire IAM policy for a backup plan
Organizations with strict access requirements can define the complete policy from scratch using BackupPlanIamPolicy.
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 comes from getIAMPolicy, which constructs a complete policy document with bindings for multiple roles. BackupPlanIamPolicy is fully authoritative: it replaces the entire IAM policy, removing any grants not specified in the policy data. This approach cannot coexist with BackupPlanIamBinding or BackupPlanIamMember on the same backup plan.
Beyond these examples
These snippets focus on specific IAM management approaches: incremental member grants, role-level bindings, and complete policy replacement. They’re intentionally minimal rather than full access control systems.
The examples reference pre-existing infrastructure such as GKE backup plans (identified by project, location, and name). 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 and formatting
- 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 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 FREEFrequently Asked Questions
Resource Selection & Conflicts
BackupPlanIamPolicy cannot be used with BackupPlanIamBinding or BackupPlanIamMember because they will conflict over the IAM policy state. Use BackupPlanIamPolicy alone for full policy control, or use BackupPlanIamBinding/BackupPlanIamMember together.Choose based on your needs:
BackupPlanIamPolicy: Authoritative control over the entire IAM policy (replaces existing policy)BackupPlanIamBinding: Authoritative control per role (replaces all members for a specific role)BackupPlanIamMember: Non-authoritative (adds a single member to a role without affecting others)
Configuration & Identity Formats
The member property supports:
allUsers: Anyone on the internetallAuthenticatedUsers: Anyone with a Google accountuser:{email}: Specific Google account (e.g.,user:alice@gmail.com)serviceAccount:{email}: Service account (e.g.,serviceAccount:my-app@appspot.gserviceaccount.com)group:{email}: Google group (e.g.,group:admins@example.com)domain:{domain}: G Suite domain (e.g.,domain:example.com)projectOwner:projectid,projectEditor:projectid,projectViewer:projectid: Project-level roles- Federated identities: Workload/workforce identity pools (see Principal identifiers documentation)
[projects|organizations]/{parent-name}/roles/{role-name}. For example, projects/my-project/roles/my-custom-role or organizations/my-org/roles/my-custom-role.Resource Properties & Lifecycle
location, member, name, project, role, and condition. To change any of these, you must recreate the resource.pulumi import gcp:gkebackup/backupPlanIamMember:BackupPlanIamMember editor "projects/{{project}}/locations/{{location}}/backupPlans/{{backup_plan}} roles/viewer user:jane@example.com"