1. Packages
  2. Gitlab Provider
  3. API Docs
  4. GroupBadge
GitLab v8.5.0 published on Friday, Oct 18, 2024 by Pulumi

gitlab.GroupBadge

Explore with Pulumi AI

gitlab logo
GitLab v8.5.0 published on Friday, Oct 18, 2024 by Pulumi

    The gitlab.GroupBadge resource allows to manage the lifecycle of group badges.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const foo = new gitlab.Group("foo", {name: "foo-group"});
    const example = new gitlab.GroupBadge("example", {
        group: foo.id,
        linkUrl: "https://example.com/badge-123",
        imageUrl: "https://example.com/badge-123.svg",
    });
    // Pipeline status badges with placeholders will be enabled for each project
    const gitlabPipeline = new gitlab.GroupBadge("gitlab_pipeline", {
        group: foo.id,
        linkUrl: "https://gitlab.example.com/%{project_path}/-/pipelines?ref=%{default_branch}",
        imageUrl: "https://gitlab.example.com/%{project_path}/badges/%{default_branch}/pipeline.svg",
    });
    // Test coverage report badges with placeholders will be enabled for each project
    const gitlabCoverage = new gitlab.GroupBadge("gitlab_coverage", {
        group: foo.id,
        linkUrl: "https://gitlab.example.com/%{project_path}/-/jobs",
        imageUrl: "https://gitlab.example.com/%{project_path}/badges/%{default_branch}/coverage.svg",
    });
    // Latest release badges with placeholders will be enabled for each project
    const gitlabRelease = new gitlab.GroupBadge("gitlab_release", {
        group: foo.id,
        linkUrl: "https://gitlab.example.com/%{project_path}/-/releases",
        imageUrl: "https://gitlab.example.com/%{project_path}/-/badges/release.svg",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    foo = gitlab.Group("foo", name="foo-group")
    example = gitlab.GroupBadge("example",
        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
    gitlab_pipeline = gitlab.GroupBadge("gitlab_pipeline",
        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
    gitlab_coverage = gitlab.GroupBadge("gitlab_coverage",
        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
    gitlab_release = gitlab.GroupBadge("gitlab_release",
        group=foo.id,
        link_url="https://gitlab.example.com/%{project_path}/-/releases",
        image_url="https://gitlab.example.com/%{project_path}/-/badges/release.svg")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := gitlab.NewGroup(ctx, "foo", &gitlab.GroupArgs{
    			Name: pulumi.String("foo-group"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gitlab.NewGroupBadge(ctx, "example", &gitlab.GroupBadgeArgs{
    			Group:    foo.ID(),
    			LinkUrl:  pulumi.String("https://example.com/badge-123"),
    			ImageUrl: pulumi.String("https://example.com/badge-123.svg"),
    		})
    		if err != nil {
    			return err
    		}
    		// Pipeline status badges with placeholders will be enabled for each project
    		_, err = gitlab.NewGroupBadge(ctx, "gitlab_pipeline", &gitlab.GroupBadgeArgs{
    			Group:    foo.ID(),
    			LinkUrl:  pulumi.String("https://gitlab.example.com/%{project_path}/-/pipelines?ref=%{default_branch}"),
    			ImageUrl: pulumi.String("https://gitlab.example.com/%{project_path}/badges/%{default_branch}/pipeline.svg"),
    		})
    		if err != nil {
    			return err
    		}
    		// Test coverage report badges with placeholders will be enabled for each project
    		_, err = gitlab.NewGroupBadge(ctx, "gitlab_coverage", &gitlab.GroupBadgeArgs{
    			Group:    foo.ID(),
    			LinkUrl:  pulumi.String("https://gitlab.example.com/%{project_path}/-/jobs"),
    			ImageUrl: pulumi.String("https://gitlab.example.com/%{project_path}/badges/%{default_branch}/coverage.svg"),
    		})
    		if err != nil {
    			return err
    		}
    		// Latest release badges with placeholders will be enabled for each project
    		_, err = gitlab.NewGroupBadge(ctx, "gitlab_release", &gitlab.GroupBadgeArgs{
    			Group:    foo.ID(),
    			LinkUrl:  pulumi.String("https://gitlab.example.com/%{project_path}/-/releases"),
    			ImageUrl: pulumi.String("https://gitlab.example.com/%{project_path}/-/badges/release.svg"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using GitLab = Pulumi.GitLab;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new GitLab.Group("foo", new()
        {
            Name = "foo-group",
        });
    
        var example = new GitLab.GroupBadge("example", new()
        {
            Group = foo.Id,
            LinkUrl = "https://example.com/badge-123",
            ImageUrl = "https://example.com/badge-123.svg",
        });
    
        // Pipeline status badges with placeholders will be enabled for each project
        var gitlabPipeline = new GitLab.GroupBadge("gitlab_pipeline", new()
        {
            Group = foo.Id,
            LinkUrl = "https://gitlab.example.com/%{project_path}/-/pipelines?ref=%{default_branch}",
            ImageUrl = "https://gitlab.example.com/%{project_path}/badges/%{default_branch}/pipeline.svg",
        });
    
        // Test coverage report badges with placeholders will be enabled for each project
        var gitlabCoverage = new GitLab.GroupBadge("gitlab_coverage", new()
        {
            Group = foo.Id,
            LinkUrl = "https://gitlab.example.com/%{project_path}/-/jobs",
            ImageUrl = "https://gitlab.example.com/%{project_path}/badges/%{default_branch}/coverage.svg",
        });
    
        // Latest release badges with placeholders will be enabled for each project
        var gitlabRelease = new GitLab.GroupBadge("gitlab_release", new()
        {
            Group = foo.Id,
            LinkUrl = "https://gitlab.example.com/%{project_path}/-/releases",
            ImageUrl = "https://gitlab.example.com/%{project_path}/-/badges/release.svg",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.Group;
    import com.pulumi.gitlab.GroupArgs;
    import com.pulumi.gitlab.GroupBadge;
    import com.pulumi.gitlab.GroupBadgeArgs;
    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 foo = new Group("foo", GroupArgs.builder()
                .name("foo-group")
                .build());
    
            var example = new GroupBadge("example", GroupBadgeArgs.builder()
                .group(foo.id())
                .linkUrl("https://example.com/badge-123")
                .imageUrl("https://example.com/badge-123.svg")
                .build());
    
            // Pipeline status badges with placeholders will be enabled for each project
            var gitlabPipeline = new GroupBadge("gitlabPipeline", GroupBadgeArgs.builder()
                .group(foo.id())
                .linkUrl("https://gitlab.example.com/%{project_path}/-/pipelines?ref=%{default_branch}")
                .imageUrl("https://gitlab.example.com/%{project_path}/badges/%{default_branch}/pipeline.svg")
                .build());
    
            // Test coverage report badges with placeholders will be enabled for each project
            var gitlabCoverage = new GroupBadge("gitlabCoverage", GroupBadgeArgs.builder()
                .group(foo.id())
                .linkUrl("https://gitlab.example.com/%{project_path}/-/jobs")
                .imageUrl("https://gitlab.example.com/%{project_path}/badges/%{default_branch}/coverage.svg")
                .build());
    
            // Latest release badges with placeholders will be enabled for each project
            var gitlabRelease = new GroupBadge("gitlabRelease", GroupBadgeArgs.builder()
                .group(foo.id())
                .linkUrl("https://gitlab.example.com/%{project_path}/-/releases")
                .imageUrl("https://gitlab.example.com/%{project_path}/-/badges/release.svg")
                .build());
    
        }
    }
    
    resources:
      foo:
        type: gitlab:Group
        properties:
          name: foo-group
      example:
        type: gitlab:GroupBadge
        properties:
          group: ${foo.id}
          linkUrl: https://example.com/badge-123
          imageUrl: https://example.com/badge-123.svg
      # Pipeline status badges with placeholders will be enabled for each project
      gitlabPipeline:
        type: gitlab:GroupBadge
        name: gitlab_pipeline
        properties:
          group: ${foo.id}
          linkUrl: https://gitlab.example.com/%{project_path}/-/pipelines?ref=%{default_branch}
          imageUrl: https://gitlab.example.com/%{project_path}/badges/%{default_branch}/pipeline.svg
      # Test coverage report badges with placeholders will be enabled for each project
      gitlabCoverage:
        type: gitlab:GroupBadge
        name: gitlab_coverage
        properties:
          group: ${foo.id}
          linkUrl: https://gitlab.example.com/%{project_path}/-/jobs
          imageUrl: https://gitlab.example.com/%{project_path}/badges/%{default_branch}/coverage.svg
      # Latest release badges with placeholders will be enabled for each project
      gitlabRelease:
        type: gitlab:GroupBadge
        name: gitlab_release
        properties:
          group: ${foo.id}
          linkUrl: https://gitlab.example.com/%{project_path}/-/releases
          imageUrl: https://gitlab.example.com/%{project_path}/-/badges/release.svg
    

    Create GroupBadge Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GroupBadge(name: string, args: GroupBadgeArgs, opts?: CustomResourceOptions);
    @overload
    def GroupBadge(resource_name: str,
                   args: GroupBadgeArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def GroupBadge(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   group: Optional[str] = None,
                   image_url: Optional[str] = None,
                   link_url: Optional[str] = None,
                   name: Optional[str] = None)
    func NewGroupBadge(ctx *Context, name string, args GroupBadgeArgs, opts ...ResourceOption) (*GroupBadge, error)
    public GroupBadge(string name, GroupBadgeArgs args, CustomResourceOptions? opts = null)
    public GroupBadge(String name, GroupBadgeArgs args)
    public GroupBadge(String name, GroupBadgeArgs args, CustomResourceOptions options)
    
    type: gitlab:GroupBadge
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args GroupBadgeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args GroupBadgeArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args GroupBadgeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GroupBadgeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GroupBadgeArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var groupBadgeResource = new GitLab.GroupBadge("groupBadgeResource", new()
    {
        Group = "string",
        ImageUrl = "string",
        LinkUrl = "string",
        Name = "string",
    });
    
    example, err := gitlab.NewGroupBadge(ctx, "groupBadgeResource", &gitlab.GroupBadgeArgs{
    	Group:    pulumi.String("string"),
    	ImageUrl: pulumi.String("string"),
    	LinkUrl:  pulumi.String("string"),
    	Name:     pulumi.String("string"),
    })
    
    var groupBadgeResource = new GroupBadge("groupBadgeResource", GroupBadgeArgs.builder()
        .group("string")
        .imageUrl("string")
        .linkUrl("string")
        .name("string")
        .build());
    
    group_badge_resource = gitlab.GroupBadge("groupBadgeResource",
        group="string",
        image_url="string",
        link_url="string",
        name="string")
    
    const groupBadgeResource = new gitlab.GroupBadge("groupBadgeResource", {
        group: "string",
        imageUrl: "string",
        linkUrl: "string",
        name: "string",
    });
    
    type: gitlab:GroupBadge
    properties:
        group: string
        imageUrl: string
        linkUrl: string
        name: string
    

    GroupBadge Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The GroupBadge resource accepts the following input properties:

    Group string
    The id of the group to add the badge to.
    ImageUrl string
    The image url which will be presented on group overview.
    LinkUrl string
    The url linked with the badge.
    Name string
    The name of the badge.
    Group string
    The id of the group to add the badge to.
    ImageUrl string
    The image url which will be presented on group overview.
    LinkUrl string
    The url linked with the badge.
    Name string
    The name of the badge.
    group String
    The id of the group to add the badge to.
    imageUrl String
    The image url which will be presented on group overview.
    linkUrl String
    The url linked with the badge.
    name String
    The name of the badge.
    group string
    The id of the group to add the badge to.
    imageUrl string
    The image url which will be presented on group overview.
    linkUrl string
    The url linked with the badge.
    name string
    The name of the badge.
    group str
    The id of the group to add the badge to.
    image_url str
    The image url which will be presented on group overview.
    link_url str
    The url linked with the badge.
    name str
    The name of the badge.
    group String
    The id of the group to add the badge to.
    imageUrl String
    The image url which will be presented on group overview.
    linkUrl String
    The url linked with the badge.
    name String
    The name of the badge.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GroupBadge resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    RenderedImageUrl string
    The image_url argument rendered (in case of use of placeholders).
    RenderedLinkUrl string
    The link_url argument rendered (in case of use of placeholders).
    Id string
    The provider-assigned unique ID for this managed resource.
    RenderedImageUrl string
    The image_url argument rendered (in case of use of placeholders).
    RenderedLinkUrl string
    The link_url argument rendered (in case of use of placeholders).
    id String
    The provider-assigned unique ID for this managed resource.
    renderedImageUrl String
    The image_url argument rendered (in case of use of placeholders).
    renderedLinkUrl String
    The link_url argument rendered (in case of use of placeholders).
    id string
    The provider-assigned unique ID for this managed resource.
    renderedImageUrl string
    The image_url argument rendered (in case of use of placeholders).
    renderedLinkUrl string
    The link_url argument rendered (in case of use of placeholders).
    id str
    The provider-assigned unique ID for this managed resource.
    rendered_image_url str
    The image_url argument rendered (in case of use of placeholders).
    rendered_link_url str
    The link_url argument rendered (in case of use of placeholders).
    id String
    The provider-assigned unique ID for this managed resource.
    renderedImageUrl String
    The image_url argument rendered (in case of use of placeholders).
    renderedLinkUrl String
    The link_url argument rendered (in case of use of placeholders).

    Look up Existing GroupBadge Resource

    Get an existing GroupBadge resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: GroupBadgeState, opts?: CustomResourceOptions): GroupBadge
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            group: Optional[str] = None,
            image_url: Optional[str] = None,
            link_url: Optional[str] = None,
            name: Optional[str] = None,
            rendered_image_url: Optional[str] = None,
            rendered_link_url: Optional[str] = None) -> GroupBadge
    func GetGroupBadge(ctx *Context, name string, id IDInput, state *GroupBadgeState, opts ...ResourceOption) (*GroupBadge, error)
    public static GroupBadge Get(string name, Input<string> id, GroupBadgeState? state, CustomResourceOptions? opts = null)
    public static GroupBadge get(String name, Output<String> id, GroupBadgeState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Group string
    The id of the group to add the badge to.
    ImageUrl string
    The image url which will be presented on group overview.
    LinkUrl string
    The url linked with the badge.
    Name string
    The name of the badge.
    RenderedImageUrl string
    The image_url argument rendered (in case of use of placeholders).
    RenderedLinkUrl string
    The link_url argument rendered (in case of use of placeholders).
    Group string
    The id of the group to add the badge to.
    ImageUrl string
    The image url which will be presented on group overview.
    LinkUrl string
    The url linked with the badge.
    Name string
    The name of the badge.
    RenderedImageUrl string
    The image_url argument rendered (in case of use of placeholders).
    RenderedLinkUrl string
    The link_url argument rendered (in case of use of placeholders).
    group String
    The id of the group to add the badge to.
    imageUrl String
    The image url which will be presented on group overview.
    linkUrl String
    The url linked with the badge.
    name String
    The name of the badge.
    renderedImageUrl String
    The image_url argument rendered (in case of use of placeholders).
    renderedLinkUrl String
    The link_url argument rendered (in case of use of placeholders).
    group string
    The id of the group to add the badge to.
    imageUrl string
    The image url which will be presented on group overview.
    linkUrl string
    The url linked with the badge.
    name string
    The name of the badge.
    renderedImageUrl string
    The image_url argument rendered (in case of use of placeholders).
    renderedLinkUrl string
    The link_url argument rendered (in case of use of placeholders).
    group str
    The id of the group to add the badge to.
    image_url str
    The image url which will be presented on group overview.
    link_url str
    The url linked with the badge.
    name str
    The name of the badge.
    rendered_image_url str
    The image_url argument rendered (in case of use of placeholders).
    rendered_link_url str
    The link_url argument rendered (in case of use of placeholders).
    group String
    The id of the group to add the badge to.
    imageUrl String
    The image url which will be presented on group overview.
    linkUrl String
    The url linked with the badge.
    name String
    The name of the badge.
    renderedImageUrl String
    The image_url argument rendered (in case of use of placeholders).
    renderedLinkUrl String
    The link_url argument rendered (in case of use of placeholders).

    Import

    GitLab group badges can be imported using an id made up of {group_id}:{badge_id}, e.g.

    $ pulumi import gitlab:index/groupBadge:GroupBadge foo 1:3
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    GitLab v8.5.0 published on Friday, Oct 18, 2024 by Pulumi