Manage GCP Dataproc Metastore Federation IAM Bindings

The gcp:dataproc/metastoreFederationIamBinding:MetastoreFederationIamBinding resource, part of the Pulumi GCP provider, manages IAM role bindings for Dataproc Metastore Federation instances. This guide focuses on two capabilities: authoritative role binding that replaces all members for a role, and non-authoritative member addition that preserves existing members.

IAM bindings reference existing Metastore Federation instances and require a GCP project and location. The examples are intentionally small. Combine them with your own federation infrastructure and identity management workflows.

Grant a role to multiple members at once

Teams managing federation access often need to assign the same role to multiple users or service accounts simultaneously, such as giving viewer access to an entire team.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const binding = new gcp.dataproc.MetastoreFederationIamBinding("binding", {
    project: _default.project,
    location: _default.location,
    federationId: _default.federationId,
    role: "roles/viewer",
    members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp

binding = gcp.dataproc.MetastoreFederationIamBinding("binding",
    project=default["project"],
    location=default["location"],
    federation_id=default["federationId"],
    role="roles/viewer",
    members=["user:jane@example.com"])
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/dataproc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dataproc.NewMetastoreFederationIamBinding(ctx, "binding", &dataproc.MetastoreFederationIamBindingArgs{
			Project:      pulumi.Any(_default.Project),
			Location:     pulumi.Any(_default.Location),
			FederationId: pulumi.Any(_default.FederationId),
			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.Dataproc.MetastoreFederationIamBinding("binding", new()
    {
        Project = @default.Project,
        Location = @default.Location,
        FederationId = @default.FederationId,
        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.dataproc.MetastoreFederationIamBinding;
import com.pulumi.gcp.dataproc.MetastoreFederationIamBindingArgs;
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 MetastoreFederationIamBinding("binding", MetastoreFederationIamBindingArgs.builder()
            .project(default_.project())
            .location(default_.location())
            .federationId(default_.federationId())
            .role("roles/viewer")
            .members("user:jane@example.com")
            .build());

    }
}
resources:
  binding:
    type: gcp:dataproc:MetastoreFederationIamBinding
    properties:
      project: ${default.project}
      location: ${default.location}
      federationId: ${default.federationId}
      role: roles/viewer
      members:
        - user:jane@example.com

The MetastoreFederationIamBinding resource is authoritative for the specified role. When you set the members list, it replaces any existing members for that role on the federation. The role property specifies the IAM role (predefined or custom), and members accepts a list of identity strings in formats like “user:jane@example.com” or “serviceAccount:app@project.iam.gserviceaccount.com”. The federationId and location properties identify which federation to bind the role to.

Add a single member to a role incrementally

When onboarding individual users or service accounts, teams often add them one at a time 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.dataproc.MetastoreFederationIamMember("member", {
    project: _default.project,
    location: _default.location,
    federationId: _default.federationId,
    role: "roles/viewer",
    member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp

member = gcp.dataproc.MetastoreFederationIamMember("member",
    project=default["project"],
    location=default["location"],
    federation_id=default["federationId"],
    role="roles/viewer",
    member="user:jane@example.com")
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/dataproc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dataproc.NewMetastoreFederationIamMember(ctx, "member", &dataproc.MetastoreFederationIamMemberArgs{
			Project:      pulumi.Any(_default.Project),
			Location:     pulumi.Any(_default.Location),
			FederationId: pulumi.Any(_default.FederationId),
			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.Dataproc.MetastoreFederationIamMember("member", new()
    {
        Project = @default.Project,
        Location = @default.Location,
        FederationId = @default.FederationId,
        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.dataproc.MetastoreFederationIamMember;
import com.pulumi.gcp.dataproc.MetastoreFederationIamMemberArgs;
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 MetastoreFederationIamMember("member", MetastoreFederationIamMemberArgs.builder()
            .project(default_.project())
            .location(default_.location())
            .federationId(default_.federationId())
            .role("roles/viewer")
            .member("user:jane@example.com")
            .build());

    }
}
resources:
  member:
    type: gcp:dataproc:MetastoreFederationIamMember
    properties:
      project: ${default.project}
      location: ${default.location}
      federationId: ${default.federationId}
      role: roles/viewer
      member: user:jane@example.com

The MetastoreFederationIamMember resource is non-authoritative. It adds a single member to a role without removing existing members. This approach works well for incremental access grants where you don’t want to manage the complete member list. You can use MetastoreFederationIamBinding and MetastoreFederationIamMember together, but only if they manage different roles; otherwise they’ll conflict over the member list.

Beyond these examples

These snippets focus on specific IAM binding features: role-based access control and authoritative vs non-authoritative member management. They’re intentionally minimal rather than full access control solutions.

The examples reference pre-existing infrastructure such as Dataproc Metastore Federation instances and a GCP project with configured location. They focus on configuring IAM bindings rather than provisioning the federation itself.

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

  • Conditional IAM bindings (condition property)
  • Policy-level management (MetastoreFederationIamPolicy)
  • Custom role definitions
  • Audit logging and access reviews

These omissions are intentional: the goal is to illustrate how each IAM binding approach is wired, not provide drop-in access control modules. See the Metastore Federation IAM Binding resource reference for all available configuration options.

Let's manage GCP Dataproc Metastore Federation IAM Bindings

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 & Compatibility
Which IAM resource should I use for managing federation permissions?

Choose based on your needs:

  • IamPolicy - Full control, replaces entire IAM policy (authoritative)
  • IamBinding - Manage all members for a specific role, preserves other roles (authoritative per role)
  • IamMember - Add individual members without affecting others (non-authoritative)
Can I use IamPolicy together with IamBinding or IamMember?
No, MetastoreFederationIamPolicy cannot be used with MetastoreFederationIamBinding or MetastoreFederationIamMember because they will conflict over policy control.
Can I use IamBinding and IamMember together?
Yes, but only if they manage different roles. You cannot have both an IamBinding and IamMember granting privileges to the same role.
Identity & Role Configuration
What member identity formats are supported?

Supported formats include:

  • allUsers - Anyone on the internet
  • allAuthenticatedUsers - Anyone with a Google account
  • user:{emailid} - Specific Google account (e.g., user:alice@gmail.com)
  • serviceAccount:{emailid} - Service account (e.g., serviceAccount:my-app@appspot.gserviceaccount.com)
  • group:{emailid} - 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 (e.g., principal://iam.googleapis.com/locations/global/workforcePools/...)
How do I specify a custom IAM role?
Custom roles must use the format [projects|organizations]/{parent-name}/roles/{role-name} (e.g., projects/my-project/roles/my-custom-role).
How do I grant a role to multiple members at once?
Use MetastoreFederationIamBinding with the members array property containing all identity strings for that role.
How do I add a single member without affecting existing members?
Use MetastoreFederationIamMember with the member property (singular) to add one identity non-authoritatively.
Resource Properties
What properties can't I change after creation?
The following properties are immutable: federationId, location, project, role, and condition. Changing these requires recreating the resource.

Using a different cloud?

Explore security guides for other cloud providers: