entrepot_role_binding
Grants a role to a subject on the repositories matching a pattern. Bindings are immutable: changing any attribute replaces the binding.
Subjects are users (OIDC usernames, or sa:<name> for service accounts — use entrepot_service_account.<x>.username), OIDC groups, GitLab trust policies, or every authenticated principal.
Example Usage
Section titled “Example Usage”# Let the CI service account publish to every npm-* repository.resource "entrepot_role_binding" "ci_npm" { role = entrepot_role.publisher.name subject_type = "user" subject = entrepot_service_account.ci.username # "sa:ci" repository_pattern = "npm-*"}
# Members of the OIDC group "platform-admins" administer the whole server.resource "entrepot_role_binding" "admins" { role = "admin" subject_type = "group" subject = "platform-admins"}
# Every signed-in user can read the public-* repositories.resource "entrepot_role_binding" "readers" { role = "viewer" subject_type = "authenticated" repository_pattern = "public-*"}
# GitLab CI jobs matching a trust policy can upload to the internal repositories.resource "entrepot_role_binding" "gitlab_ci" { role = "developer" subject_type = "gitlab_policy" subject = entrepot_gitlab_trust_policy.platform.name repository_pattern = "internal-*"}Schema
Section titled “Schema”Required
Section titled “Required”role(String) Role name: a built-in role (viewer,developer,maintainer,admin) or anentrepot_role. Changing it forces a new binding.subject_type(String)user,group(OIDC group),gitlab_policy(anentrepot_gitlab_trust_policy) orauthenticated(anyone who is signed in). Changing it forces a new binding.
Optional
Section titled “Optional”repository_pattern(String) Glob over repository names (default*, all repositories). A role withadminon*grants system administration. Changing it forces a new binding.subject(String) Username (sa:<name>for service accounts), group name or trust policy name. Required unlesssubject_type = "authenticated", where it must be omitted. Changing it forces a new binding.
Read-Only
Section titled “Read-Only”created_at(String) Creation time (RFC 3339).id(String) Server-assigned binding ID (used for import).
Import
Section titled “Import”The terraform import command can be used, for example:
# Role bindings are imported by their ID (see GET /api/v1/role-bindings).terraform import entrepot_role_binding.ci_npm 3f2b8f1e-6a0c-4f43-9f57-2d7f4b1c9e10Resource documentation generated from the provider’s schema (docs/resources/role_binding.md in terraform-provider-entrepot).