entrepot_gitlab_trust_policy
A GitLab trust policy lets GitLab CI/CD jobs authenticate with their id_token (no stored secrets). A job is matched to the policy when its token was issued by the named GitLab instance and every condition matches; bind roles to the policy with entrepot_role_binding (subject_type = "gitlab_policy"). Deleting a policy also deletes the role bindings that reference it.
Example Usage
Section titled “Example Usage”# Trust id_tokens from protected branches of projects under platform/ on the# GitLab instance configured as "gitlab" in the server's auth.gitlab list.resource "entrepot_gitlab_trust_policy" "platform" { name = "platform-protected" description = "Protected pipelines of the platform group" gitlab = "gitlab" conditions = { project_path = "platform/**" ref_protected = "true" }}
# In .gitlab-ci.yml:# id_tokens:# ENTREPOT_TOKEN:# aud: https://entrepot.example.comSchema
Section titled “Schema”Required
Section titled “Required”conditions(Map of String)id_tokenclaim → glob pattern; all must match. Common claims:project_path,namespace_path,ref,ref_type,ref_protected,environment,pipeline_source.*matches within a path segment,**across segments anda|beither alternative, e.g.{ project_path = "platform/**", ref_protected = "true" }.gitlab(String) Name of a trusted GitLab instance from the server’sauth.gitlabconfiguration (listed inGET /api/v1/system/infoasgitlabInstances).name(String) Policy name, used as the role binding subject. Changing it forces a new policy.
Optional
Section titled “Optional”description(String) Free-form description.
Read-Only
Section titled “Read-Only”id(String) Same asname.
Import
Section titled “Import”The terraform import command can be used, for example:
# GitLab trust policies are imported by name.terraform import entrepot_gitlab_trust_policy.platform platform-protectedResource documentation generated from the provider’s schema (docs/resources/gitlab_trust_policy.md in terraform-provider-entrepot).