Manage GCP Healthcare Dataset IAM Permissions

The gcp:healthcare/datasetIamBinding:DatasetIamBinding resource, part of the Pulumi GCP provider, grants IAM roles to members on Healthcare datasets, controlling who can access and manage medical data stores. This guide focuses on two capabilities: authoritative role bindings for multiple members and non-authoritative single-member grants.

This resource manages access to existing Healthcare datasets. The examples are intentionally small. Combine them with your own dataset infrastructure and organizational identity management.

Grant a role to multiple members authoritatively

Teams managing Healthcare datasets often need to grant a specific role to multiple users or service accounts while preserving other role assignments.

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

const dataset = new gcp.healthcare.DatasetIamBinding("dataset", {
    datasetId: "your-dataset-id",
    role: "roles/editor",
    members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp

dataset = gcp.healthcare.DatasetIamBinding("dataset",
    dataset_id="your-dataset-id",
    role="roles/editor",
    members=["user:jane@example.com"])
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := healthcare.NewDatasetIamBinding(ctx, "dataset", &healthcare.DatasetIamBindingArgs{
			DatasetId: pulumi.String("your-dataset-id"),
			Role:      pulumi.String("roles/editor"),
			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 dataset = new Gcp.Healthcare.DatasetIamBinding("dataset", new()
    {
        DatasetId = "your-dataset-id",
        Role = "roles/editor",
        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.healthcare.DatasetIamBinding;
import com.pulumi.gcp.healthcare.DatasetIamBindingArgs;
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 dataset = new DatasetIamBinding("dataset", DatasetIamBindingArgs.builder()
            .datasetId("your-dataset-id")
            .role("roles/editor")
            .members("user:jane@example.com")
            .build());

    }
}
resources:
  dataset:
    type: gcp:healthcare:DatasetIamBinding
    properties:
      datasetId: your-dataset-id
      role: roles/editor
      members:
        - user:jane@example.com

The binding grants the specified role to all listed members. The datasetId references your Healthcare dataset using the format {project_id}/{location_name}/{dataset_name}. The members array accepts user accounts, service accounts, groups, and domain identifiers. This resource is authoritative for the specified role: it replaces any existing member list for that role while leaving other roles untouched.

Add a single member to a role non-authoritatively

When multiple teams manage access to the same dataset, non-authoritative member grants allow each team to add their own users without overwriting others’ assignments.

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

const dataset = new gcp.healthcare.DatasetIamMember("dataset", {
    datasetId: "your-dataset-id",
    role: "roles/editor",
    member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp

dataset = gcp.healthcare.DatasetIamMember("dataset",
    dataset_id="your-dataset-id",
    role="roles/editor",
    member="user:jane@example.com")
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := healthcare.NewDatasetIamMember(ctx, "dataset", &healthcare.DatasetIamMemberArgs{
			DatasetId: pulumi.String("your-dataset-id"),
			Role:      pulumi.String("roles/editor"),
			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 dataset = new Gcp.Healthcare.DatasetIamMember("dataset", new()
    {
        DatasetId = "your-dataset-id",
        Role = "roles/editor",
        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.healthcare.DatasetIamMember;
import com.pulumi.gcp.healthcare.DatasetIamMemberArgs;
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 dataset = new DatasetIamMember("dataset", DatasetIamMemberArgs.builder()
            .datasetId("your-dataset-id")
            .role("roles/editor")
            .member("user:jane@example.com")
            .build());

    }
}
resources:
  dataset:
    type: gcp:healthcare:DatasetIamMember
    properties:
      datasetId: your-dataset-id
      role: roles/editor
      member: user:jane@example.com

The member property specifies a single identity to grant the role. Unlike DatasetIamBinding, this resource is non-authoritative: it adds the member to the role without affecting other members already assigned to that role. Use this when multiple Pulumi stacks or teams need to grant access independently.

Beyond these examples

These snippets focus on specific IAM binding features: authoritative role bindings and non-authoritative member grants. They’re intentionally minimal rather than full access control configurations.

The examples reference pre-existing infrastructure such as Healthcare datasets. They focus on configuring access rather than provisioning the datasets themselves.

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

  • Conditional IAM bindings (condition property)
  • Policy-level management (DatasetIamPolicy)
  • Custom role definitions

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 Healthcare DatasetIamBinding resource reference for all available configuration options.

Let's manage GCP Healthcare Dataset IAM Permissions

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
Which IAM resource should I use for Healthcare datasets?
Choose based on your needs: DatasetIamPolicy for complete policy control (replaces entire policy), DatasetIamBinding for managing all members of a specific role (preserves other roles), or DatasetIamMember for adding individual members (preserves other members for the role).
Can I use DatasetIamPolicy with DatasetIamBinding or DatasetIamMember?
No, DatasetIamPolicy cannot be used with DatasetIamBinding or DatasetIamMember because they will conflict over policy management.
Can I use DatasetIamBinding and DatasetIamMember together?
Yes, but only if they grant privileges to different roles. Using both on the same role causes conflicts.
Configuration & Formats
What are the valid formats for datasetId?
Use either {project_id}/{location_name}/{dataset_name} or {location_name}/{dataset_name}. In the second format, your provider’s project setting is used as a fallback.
What's the format for custom roles?
Custom roles must use the format [projects|organizations]/{parent-name}/roles/{role-name}.
What member identity formats are supported?
You can use allUsers, allAuthenticatedUsers, user:{email}, serviceAccount:{email}, group:{email}, or domain:{domain}.
What properties are immutable after creation?
The datasetId, role, and condition properties cannot be changed after creation.
Can I grant a role to multiple users at once?
Yes, use DatasetIamBinding with a members array containing multiple identities.
Beta & Provider Requirements
Do I need a special provider for Healthcare dataset IAM resources?
Yes, these resources are in beta and require the terraform-provider-google-beta provider.

Using a different cloud?

Explore iam guides for other cloud providers: