The gcp:healthcare/consentStoreIamBinding:ConsentStoreIamBinding resource, part of the Pulumi GCP provider, manages IAM role bindings for Healthcare API consent stores. This guide focuses on two capabilities: granting roles to multiple members and adding individual members incrementally.
IAM bindings reference existing consent stores within Healthcare datasets and grant access to Google Cloud identities. The examples are intentionally small. Combine them with your own consent store infrastructure and identity management.
Grant a role to multiple members at once
Teams managing consent store access often need to assign the same role to multiple users or service accounts simultaneously.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const binding = new gcp.healthcare.ConsentStoreIamBinding("binding", {
dataset: my_consent.dataset,
consentStoreId: my_consent.name,
role: "roles/viewer",
members: ["user:jane@example.com"],
});
import pulumi
import pulumi_gcp as gcp
binding = gcp.healthcare.ConsentStoreIamBinding("binding",
dataset=my_consent["dataset"],
consent_store_id=my_consent["name"],
role="roles/viewer",
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.NewConsentStoreIamBinding(ctx, "binding", &healthcare.ConsentStoreIamBindingArgs{
Dataset: pulumi.Any(my_consent.Dataset),
ConsentStoreId: pulumi.Any(my_consent.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.Healthcare.ConsentStoreIamBinding("binding", new()
{
Dataset = my_consent.Dataset,
ConsentStoreId = my_consent.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.healthcare.ConsentStoreIamBinding;
import com.pulumi.gcp.healthcare.ConsentStoreIamBindingArgs;
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 ConsentStoreIamBinding("binding", ConsentStoreIamBindingArgs.builder()
.dataset(my_consent.dataset())
.consentStoreId(my_consent.name())
.role("roles/viewer")
.members("user:jane@example.com")
.build());
}
}
resources:
binding:
type: gcp:healthcare:ConsentStoreIamBinding
properties:
dataset: ${["my-consent"].dataset}
consentStoreId: ${["my-consent"].name}
role: roles/viewer
members:
- user:jane@example.com
The role property specifies which IAM role to grant (e.g., “roles/viewer”). The members array lists all identities that receive this role; ConsentStoreIamBinding is authoritative for this role, meaning it replaces any existing members for that role. The consentStoreId and dataset properties identify which consent store to configure.
Add a single member to a role incrementally
When onboarding individual users, you can add members one at a time without affecting existing assignments.
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const member = new gcp.healthcare.ConsentStoreIamMember("member", {
dataset: my_consent.dataset,
consentStoreId: my_consent.name,
role: "roles/viewer",
member: "user:jane@example.com",
});
import pulumi
import pulumi_gcp as gcp
member = gcp.healthcare.ConsentStoreIamMember("member",
dataset=my_consent["dataset"],
consent_store_id=my_consent["name"],
role="roles/viewer",
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.NewConsentStoreIamMember(ctx, "member", &healthcare.ConsentStoreIamMemberArgs{
Dataset: pulumi.Any(my_consent.Dataset),
ConsentStoreId: pulumi.Any(my_consent.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.Healthcare.ConsentStoreIamMember("member", new()
{
Dataset = my_consent.Dataset,
ConsentStoreId = my_consent.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.healthcare.ConsentStoreIamMember;
import com.pulumi.gcp.healthcare.ConsentStoreIamMemberArgs;
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 ConsentStoreIamMember("member", ConsentStoreIamMemberArgs.builder()
.dataset(my_consent.dataset())
.consentStoreId(my_consent.name())
.role("roles/viewer")
.member("user:jane@example.com")
.build());
}
}
resources:
member:
type: gcp:healthcare:ConsentStoreIamMember
properties:
dataset: ${["my-consent"].dataset}
consentStoreId: ${["my-consent"].name}
role: roles/viewer
member: user:jane@example.com
The member property (singular) specifies one identity to add. Unlike ConsentStoreIamBinding, ConsentStoreIamMember is non-authoritative: it adds this member without removing others already assigned to the role. Use this when you need to grant access incrementally or when multiple teams manage different members for the same role.
Beyond these examples
These snippets focus on specific IAM binding features: role-based access control and batch and incremental member assignment. They’re intentionally minimal rather than full access control configurations.
The examples reference pre-existing infrastructure such as Healthcare datasets and consent stores, and user accounts, service accounts, or groups to grant access to. They focus on configuring IAM bindings rather than provisioning the underlying consent store infrastructure.
To keep things focused, common IAM patterns are omitted, including:
- Conditional IAM bindings (condition property)
- Policy-level management (ConsentStoreIamPolicy resource)
- Custom role definitions
- Federated identity configuration
These omissions are intentional: the goal is to illustrate how each IAM binding feature is wired, not provide drop-in access control modules. See the ConsentStoreIamBinding resource reference for all available configuration options.
Let's manage GCP Cloud Healthcare Consent Store IAM Bindings
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
ConsentStoreIamPolicy is authoritative and replaces the entire IAM policy. ConsentStoreIamBinding is authoritative for a specific role but preserves other roles in the policy. ConsentStoreIamMember is non-authoritative and adds a single member to a role while preserving other members.ConsentStoreIamPolicy cannot be used with ConsentStoreIamBinding or ConsentStoreIamMember because they will conflict over the policy.ConsentStoreIamPolicy to manage the entire policy authoritatively. Use ConsentStoreIamBinding to manage all members for a specific role. Use ConsentStoreIamMember to add individual members without affecting others. Choose based on whether you need full control (Policy), role-level control (Binding), or member-level control (Member).Configuration & Permissions
Supported formats include:
allUsersandallAuthenticatedUsers(special identifiers)user:{emailid}(e.g.,user:alice@gmail.com)serviceAccount:{emailid}(e.g.,serviceAccount:my-app@appspot.gserviceaccount.com)group:{emailid}(e.g.,group:admins@example.com)domain:{domain}(e.g.,domain:example.com)projectOwner:projectid,projectEditor:projectid,projectViewer:projectid- Federated identities (e.g.,
principal://iam.googleapis.com/...)
[projects|organizations]/{parent-name}/roles/{role-name}. For example, projects/my-project/roles/my-custom-role or organizations/my-org/roles/my-custom-role.consentStoreId, dataset, role, and condition properties are immutable and cannot be changed after creation.dataset property must be in the format projects/{project}/locations/{location}/datasets/{dataset}.