The gcp:gkehub/featureIamMember:FeatureIamMember resource, part of the Pulumi GCP provider, manages IAM permissions for GKE Hub features by granting roles to individual members without affecting other permissions. This guide focuses on three approaches: non-authoritative member grants, role-level bindings, and complete policy replacement.
GKE Hub features must exist before you can configure their IAM policies. The three IAM resources (FeatureIamMember, FeatureIamBinding, FeatureIamPolicy) serve different use cases and have compatibility constraints: FeatureIamPolicy cannot be used with the other two, while FeatureIamBinding and FeatureIamMember can coexist only if they manage different roles. The examples are intentionally small. Combine them with your own GKE Hub features and identity management.
Grant a single user access to a feature
Most IAM configurations add individual users or service accounts to a feature without replacing existing permissions.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.gkehub.FeatureIamMember("member", {
project: feature.project,
location: feature.location,
name: feature.name,
role: "roles/viewer",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.gkehub.FeatureIamMember("member",
project=feature["project"],
location=feature["location"],
name=feature["name"],
role="roles/viewer",
member="user:jane@example.com")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/gkehub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gkehub.NewFeatureIamMember(ctx, "member", &gkehub.FeatureIamMemberArgs{
Project: pulumi.Any(feature.Project),
Location: pulumi.Any(feature.Location),
Name: pulumi.Any(feature.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.GkeHub.FeatureIamMember("member", new()
{
Project = feature.Project,
Location = feature.Location,
Name = feature.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.gkehub.FeatureIamMember;
import com.pulumi.gcp.gkehub.FeatureIamMemberArgs;
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 FeatureIamMember("member", FeatureIamMemberArgs.builder()
.project(feature.project())
.location(feature.location())
.name(feature.name())
.role("roles/viewer")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:gkehub:FeatureIamMember
properties:
project: ${feature.project}
location: ${feature.location}
name: ${feature.name}
role: roles/viewer
member: user:jane@example.com
The member property specifies who receives access using formats like “user:jane@example.com” or “serviceAccount:app@project.iam.gserviceaccount.com”. The role property defines what they can do. This resource is non-authoritative: it adds the member to the role without affecting other members or roles on the feature.
Grant a role to multiple members at once
When several users need the same access level, binding them together ensures consistency.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.gkehub.FeatureIamBinding("binding", {
project: feature.project,
location: feature.location,
name: feature.name,
role: "roles/viewer",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.gkehub.FeatureIamBinding("binding",
project=feature["project"],
location=feature["location"],
name=feature["name"],
role="roles/viewer",
members=["user:jane@example.com"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/gkehub"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gkehub.NewFeatureIamBinding(ctx, "binding", &gkehub.FeatureIamBindingArgs{
Project: pulumi.Any(feature.Project),
Location: pulumi.Any(feature.Location),
Name: pulumi.Any(feature.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.GkeHub.FeatureIamBinding("binding", new()
{
Project = feature.Project,
Location = feature.Location,
Name = feature.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.gkehub.FeatureIamBinding;
import com.pulumi.gcp.gkehub.FeatureIamBindingArgs;
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 FeatureIamBinding("binding", FeatureIamBindingArgs.builder()
.project(feature.project())
.location(feature.location())
.name(feature.name())
.role("roles/viewer")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:gkehub:FeatureIamBinding
properties:
project: ${feature.project}
location: ${feature.location}
name: ${feature.name}
role: roles/viewer
members:
- user:jane@example.com
The members property takes a list of identities to grant the role. FeatureIamBinding is authoritative for the specified role: it replaces any previous bindings for that role while preserving other roles. Use this when you want to manage all members for a role as a single unit.
Replace the entire IAM policy for a feature
Some workflows require complete control, replacing all existing permissions with a new 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.gkehub.FeatureIamPolicy("policy", {
project: feature.project,
location: feature.location,
name: feature.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.gkehub.FeatureIamPolicy("policy",
project=feature["project"],
location=feature["location"],
name=feature["name"],
policy_data=admin.policy_data)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/gkehub"
"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 = gkehub.NewFeatureIamPolicy(ctx, "policy", &gkehub.FeatureIamPolicyArgs{
Project: pulumi.Any(feature.Project),
Location: pulumi.Any(feature.Location),
Name: pulumi.Any(feature.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.GkeHub.FeatureIamPolicy("policy", new()
{
Project = feature.Project,
Location = feature.Location,
Name = feature.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.gkehub.FeatureIamPolicy;
import com.pulumi.gcp.gkehub.FeatureIamPolicyArgs;
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 FeatureIamPolicy("policy", FeatureIamPolicyArgs.builder()
.project(feature.project())
.location(feature.location())
.name(feature.name())
.policyData(admin.policyData())
.build());
}
}
resources:
policy:
type: gcp:gkehub:FeatureIamPolicy
properties:
project: ${feature.project}
location: ${feature.location}
name: ${feature.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 a complete IAM policy document, typically retrieved from getIAMPolicy. FeatureIamPolicy is fully authoritative: it replaces the entire IAM policy for the feature. This resource cannot be used alongside FeatureIamBinding or FeatureIamMember, as they would conflict over policy ownership.
Beyond these examples
These snippets focus on specific IAM management approaches: single-member grants, role-level bindings, and complete policy replacement. They’re intentionally minimal rather than full access control configurations.
The examples reference pre-existing infrastructure such as GKE Hub features (by project, location, and name). They focus on configuring IAM permissions rather than provisioning the features themselves.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM bindings (condition property)
- Custom role definitions
- Service account creation and management
- 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 GKE Hub FeatureIamMember resource reference for all available configuration options.
Let's manage GCP GKE Hub Feature 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
gcp.gkehub.FeatureIamPolicy cannot be used with gcp.gkehub.FeatureIamBinding or gcp.gkehub.FeatureIamMember because they will conflict over the policy. Choose one approach: use Policy alone for full control, or use Binding/Member for granular management.gcp.gkehub.FeatureIamBinding and gcp.gkehub.FeatureIamMember for the same role will cause conflicts.gcp.gkehub.FeatureIamPolicy to replace the entire policy (authoritative), gcp.gkehub.FeatureIamBinding to manage all members for a specific role (authoritative per role), or gcp.gkehub.FeatureIamMember to add individual members without affecting others (non-authoritative).Configuration & Identity Formats
[projects|organizations]/{parent-name}/roles/{role-name}, for example projects/my-project/roles/my-custom-role or organizations/my-org/roles/my-custom-role.allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner:{projectid}, projectEditor:{projectid}, projectViewer:{projectid}, and federated identities using principal identifiers.gcp.gkehub.FeatureIamMember with the member property set to the user’s identity (e.g., user:jane@example.com) and specify the desired role.gcp.gkehub.FeatureIamBinding with the members property containing a list of identities and specify the role to grant.Immutability & Limitations
role, member, location, name, project) are immutable and require resource replacement if changed.