The gitlab_group_badge
resource allows to manage the lifecycle of group badges.
Upstream API: GitLab REST API docs
resource "gitlab_group" "foo" {
name = "foo-group"
}
resource "gitlab_group_badge" "example" {
group = gitlab_group.foo.id
link_url = "https://example.com/badge-123"
image_url = "https://example.com/badge-123.svg"
}
# Pipeline status badges with placeholders will be enabled for each project
resource "gitlab_group_badge" "gitlab_pipeline" {
group = gitlab_group.foo.id
link_url = "https://gitlab.example.com/%%{project_path}/-/pipelines?ref=%%{default_branch}"
image_url = "https://gitlab.example.com/%%{project_path}/badges/%%{default_branch}/pipeline.svg"
}
# Test coverage report badges with placeholders will be enabled for each project
resource "gitlab_group_badge" "gitlab_coverage" {
group = gitlab_group.foo.id
link_url = "https://gitlab.example.com/%%{project_path}/-/jobs"
image_url = "https://gitlab.example.com/%%{project_path}/badges/%%{default_branch}/coverage.svg"
}
# Latest release badges with placeholders will be enabled for each project
resource "gitlab_group_badge" "gitlab_release" {
group = gitlab_group.foo.id
link_url = "https://gitlab.example.com/%%{project_path}/-/releases"
image_url = "https://gitlab.example.com/%%{project_path}/-/badges/release.svg"
}
group
(String) The id of the group to add the badge to.image_url
(String) The image url which will be presented on group overview.link_url
(String) The url linked with the badge.name
(String) The name of the badge.id
(String) The ID of this resource.rendered_image_url
(String) The image_url argument rendered (in case of use of placeholders).rendered_link_url
(String) The link_url argument rendered (in case of use of placeholders).Import is supported using the following syntax:
# GitLab group badges can be imported using an id made up of `{group_id}:{badge_id}`, e.g.
terraform import gitlab_group_badge.foo 1:3