Manage GCP GKE Hub Feature IAM Access

The gcp:gkehub/featureIamMember:FeatureIamMember resource, part of the Pulumi GCP provider, manages IAM permissions for GKEHub Features by granting roles to identities. This guide focuses on three approaches: single-member grants (non-authoritative), multi-member grants (role-authoritative), and complete policy replacement (fully authoritative).

IAM resources for GKEHub Features reference existing features by project, location, and name. The examples are intentionally small. Combine them with your own feature definitions 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 that role.

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 one identity using formats like “user:jane@example.com” or “serviceAccount:app@project.iam.gserviceaccount.com”. The role property sets which permissions to grant. This resource is non-authoritative: it adds one member to the role without removing existing members. You can create multiple FeatureIamMember resources for the same role to grant it to different identities incrementally.

Grant a role to multiple members at once

When multiple identities need the same role, FeatureIamBinding sets the complete member list for that role.

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. This resource is authoritative for the specified role: it replaces any existing members for that role while preserving other roles on the feature. If you later add or remove members from the list, Pulumi updates the binding to match. You cannot combine FeatureIamBinding with FeatureIamMember for the same role, as they would conflict over who should have access.

Replace the entire IAM policy

FeatureIamPolicy sets the complete IAM policy, replacing any existing policy entirely.

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 constructed using the getIAMPolicy data source. This resource is fully authoritative: it defines all roles and members for the feature. You cannot use FeatureIamPolicy alongside FeatureIamBinding or FeatureIamMember, as they would conflict over the policy contents. Use this approach when you need complete control over all permissions, not just one role.

Beyond these examples

These snippets focus on specific IAM management approaches: single-member grants, role-level member lists, and complete policy replacement. They’re intentionally minimal rather than full access control configurations.

The examples reference pre-existing infrastructure such as GKEHub Features (by project, location, name). They focus on IAM binding configuration rather than feature provisioning or identity creation.

To keep things focused, common IAM patterns are omitted, including:

  • Conditional IAM bindings (condition property)
  • Custom role definitions
  • Federated identity configuration
  • Service account creation and management

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 GKEHub 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 FREE

Frequently Asked Questions

Resource Selection & Conflicts
What's the difference between FeatureIamPolicy, FeatureIamBinding, and FeatureIamMember?
gcp.gkehub.FeatureIamPolicy is authoritative and replaces the entire IAM policy. gcp.gkehub.FeatureIamBinding is authoritative for a specific role but preserves other roles. gcp.gkehub.FeatureIamMember is non-authoritative and preserves other members for the same role.
Can I use FeatureIamPolicy with FeatureIamBinding or FeatureIamMember?
No, 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 FeatureIamPolicy alone, or use FeatureIamBinding/FeatureIamMember together.
Can I use FeatureIamBinding and FeatureIamMember together?
Yes, but only if they don’t grant privileges to the same role. If both resources manage the same role, they will conflict.
IAM Configuration
What member identity formats are supported?
You can use allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, projectOwner:{projectid}, projectEditor:{projectid}, projectViewer:{projectid}, and federated identities (e.g., principal://iam.googleapis.com/...).
How do I specify a custom IAM role?
Custom roles must use the format [projects|organizations]/{parent-name}/roles/{role-name}.
How do I grant a role to a single user?
Use gcp.gkehub.FeatureIamMember with role set to the desired role and member set to user:{emailid}.
How do I grant a role to multiple users at once?
Use gcp.gkehub.FeatureIamBinding with role set to the desired role and members containing a list of identities.
Resource Properties & Immutability
What properties can't be changed after creating a FeatureIamMember?
All input properties are immutable: location, member, name, project, role, and condition. Changing any of these requires recreating the resource.

Using a different cloud?

Explore security guides for other cloud providers: