Skip to main content

Binding

Provides a IAM Binding for a project.

Examples

Bind a user to a role

const iamBinding = provider.iam.makeBinding({
name: "roles/editor",
properties: () => ({
members: ["user:jane@example.com"],
}),
});

Bind a service account to a role

const serviceAccount = provider.iam.makeServiceAccount({
name: "sa",
properties: () => ({
accountId: "sa",
}),
});

const iamBinding = provider.iam.makeBinding({
name: "roles/editor",
dependencies: () => ({ serviceAccounts: ["sa"] }),
});

Example Code

Used By