gitlab.ProjectLabel
Explore with Pulumi AI
The gitlab.ProjectLabel
resource manages the lifecycle of a project label.
Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const example = new gitlab.Project("example", {name: "project"});
const fixme = new gitlab.ProjectLabel("fixme", {
project: example.id,
name: "fixme",
description: "issue with failing tests",
color: "#ffcc00",
});
// Scoped label
const devopsCreate = new gitlab.ProjectLabel("devops_create", {
project: example.id,
name: "devops::create",
description: "issue for creating infrastructure resources",
color: "#ffa500",
});
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.Project("example", name="project")
fixme = gitlab.ProjectLabel("fixme",
project=example.id,
name="fixme",
description="issue with failing tests",
color="#ffcc00")
# Scoped label
devops_create = gitlab.ProjectLabel("devops_create",
project=example.id,
name="devops::create",
description="issue for creating infrastructure resources",
color="#ffa500")
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v9/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := gitlab.NewProject(ctx, "example", &gitlab.ProjectArgs{
Name: pulumi.String("project"),
})
if err != nil {
return err
}
_, err = gitlab.NewProjectLabel(ctx, "fixme", &gitlab.ProjectLabelArgs{
Project: example.ID(),
Name: pulumi.String("fixme"),
Description: pulumi.String("issue with failing tests"),
Color: pulumi.String("#ffcc00"),
})
if err != nil {
return err
}
// Scoped label
_, err = gitlab.NewProjectLabel(ctx, "devops_create", &gitlab.ProjectLabelArgs{
Project: example.ID(),
Name: pulumi.String("devops::create"),
Description: pulumi.String("issue for creating infrastructure resources"),
Color: pulumi.String("#ffa500"),
})
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 example = new GitLab.Project("example", new()
{
Name = "project",
});
var fixme = new GitLab.ProjectLabel("fixme", new()
{
Project = example.Id,
Name = "fixme",
Description = "issue with failing tests",
Color = "#ffcc00",
});
// Scoped label
var devopsCreate = new GitLab.ProjectLabel("devops_create", new()
{
Project = example.Id,
Name = "devops::create",
Description = "issue for creating infrastructure resources",
Color = "#ffa500",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.ProjectLabel;
import com.pulumi.gitlab.ProjectLabelArgs;
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 example = new Project("example", ProjectArgs.builder()
.name("project")
.build());
var fixme = new ProjectLabel("fixme", ProjectLabelArgs.builder()
.project(example.id())
.name("fixme")
.description("issue with failing tests")
.color("#ffcc00")
.build());
// Scoped label
var devopsCreate = new ProjectLabel("devopsCreate", ProjectLabelArgs.builder()
.project(example.id())
.name("devops::create")
.description("issue for creating infrastructure resources")
.color("#ffa500")
.build());
}
}
resources:
example:
type: gitlab:Project
properties:
name: project
fixme:
type: gitlab:ProjectLabel
properties:
project: ${example.id}
name: fixme
description: issue with failing tests
color: '#ffcc00'
# Scoped label
devopsCreate:
type: gitlab:ProjectLabel
name: devops_create
properties:
project: ${example.id}
name: devops::create
description: issue for creating infrastructure resources
color: '#ffa500'
Create ProjectLabel Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectLabel(name: string, args: ProjectLabelArgs, opts?: CustomResourceOptions);
@overload
def ProjectLabel(resource_name: str,
args: ProjectLabelArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectLabel(resource_name: str,
opts: Optional[ResourceOptions] = None,
color: Optional[str] = None,
project: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None)
func NewProjectLabel(ctx *Context, name string, args ProjectLabelArgs, opts ...ResourceOption) (*ProjectLabel, error)
public ProjectLabel(string name, ProjectLabelArgs args, CustomResourceOptions? opts = null)
public ProjectLabel(String name, ProjectLabelArgs args)
public ProjectLabel(String name, ProjectLabelArgs args, CustomResourceOptions options)
type: gitlab:ProjectLabel
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 ProjectLabelArgs
- 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 ProjectLabelArgs
- 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 ProjectLabelArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectLabelArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectLabelArgs
- 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 projectLabelResource = new GitLab.ProjectLabel("projectLabelResource", new()
{
Color = "string",
Project = "string",
Description = "string",
Name = "string",
});
example, err := gitlab.NewProjectLabel(ctx, "projectLabelResource", &gitlab.ProjectLabelArgs{
Color: pulumi.String("string"),
Project: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
})
var projectLabelResource = new ProjectLabel("projectLabelResource", ProjectLabelArgs.builder()
.color("string")
.project("string")
.description("string")
.name("string")
.build());
project_label_resource = gitlab.ProjectLabel("projectLabelResource",
color="string",
project="string",
description="string",
name="string")
const projectLabelResource = new gitlab.ProjectLabel("projectLabelResource", {
color: "string",
project: "string",
description: "string",
name: "string",
});
type: gitlab:ProjectLabel
properties:
color: string
description: string
name: string
project: string
ProjectLabel 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 ProjectLabel resource accepts the following input properties:
- Color string
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- Project string
- The name or id of the project to add the label to.
- Description string
- The description of the label.
- Name string
- The name of the label.
- Color string
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- Project string
- The name or id of the project to add the label to.
- Description string
- The description of the label.
- Name string
- The name of the label.
- color String
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- project String
- The name or id of the project to add the label to.
- description String
- The description of the label.
- name String
- The name of the label.
- color string
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- project string
- The name or id of the project to add the label to.
- description string
- The description of the label.
- name string
- The name of the label.
- color str
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- project str
- The name or id of the project to add the label to.
- description str
- The description of the label.
- name str
- The name of the label.
- color String
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- project String
- The name or id of the project to add the label to.
- description String
- The description of the label.
- name String
- The name of the label.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectLabel resource produces the following output properties:
- Color
Hex string - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - Id string
- The provider-assigned unique ID for this managed resource.
- Label
Id int - The id of the project label.
- Color
Hex string - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - Id string
- The provider-assigned unique ID for this managed resource.
- Label
Id int - The id of the project label.
- color
Hex String - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - id String
- The provider-assigned unique ID for this managed resource.
- label
Id Integer - The id of the project label.
- color
Hex string - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - id string
- The provider-assigned unique ID for this managed resource.
- label
Id number - The id of the project label.
- color_
hex str - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - id str
- The provider-assigned unique ID for this managed resource.
- label_
id int - The id of the project label.
- color
Hex String - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - id String
- The provider-assigned unique ID for this managed resource.
- label
Id Number - The id of the project label.
Look up Existing ProjectLabel Resource
Get an existing ProjectLabel 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?: ProjectLabelState, opts?: CustomResourceOptions): ProjectLabel
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
color: Optional[str] = None,
color_hex: Optional[str] = None,
description: Optional[str] = None,
label_id: Optional[int] = None,
name: Optional[str] = None,
project: Optional[str] = None) -> ProjectLabel
func GetProjectLabel(ctx *Context, name string, id IDInput, state *ProjectLabelState, opts ...ResourceOption) (*ProjectLabel, error)
public static ProjectLabel Get(string name, Input<string> id, ProjectLabelState? state, CustomResourceOptions? opts = null)
public static ProjectLabel get(String name, Output<String> id, ProjectLabelState state, CustomResourceOptions options)
resources: _: type: gitlab:ProjectLabel get: id: ${id}
- 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.
- Color string
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- Color
Hex string - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - Description string
- The description of the label.
- Label
Id int - The id of the project label.
- Name string
- The name of the label.
- Project string
- The name or id of the project to add the label to.
- Color string
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- Color
Hex string - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - Description string
- The description of the label.
- Label
Id int - The id of the project label.
- Name string
- The name of the label.
- Project string
- The name or id of the project to add the label to.
- color String
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- color
Hex String - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - description String
- The description of the label.
- label
Id Integer - The id of the project label.
- name String
- The name of the label.
- project String
- The name or id of the project to add the label to.
- color string
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- color
Hex string - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - description string
- The description of the label.
- label
Id number - The id of the project label.
- name string
- The name of the label.
- project string
- The name or id of the project to add the label to.
- color str
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- color_
hex str - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - description str
- The description of the label.
- label_
id int - The id of the project label.
- name str
- The name of the label.
- project str
- The name or id of the project to add the label to.
- color String
- The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the CSS color names.
- color
Hex String - Read-only, used by the provider to store the API response color. This is always in the 6-digit hex notation with leading '#' sign (e.g. #FFAABB). If
color
contains a color name, this attribute contains the hex notation equivalent. Otherwise, the value of this attribute is the same ascolor
. - description String
- The description of the label.
- label
Id Number - The id of the project label.
- name String
- The name of the label.
- project String
- The name or id of the project to add the label to.
Import
Starting in Terraform v1.5.0, you can use an import block to import gitlab_project_label
. For example:
terraform
import {
to = gitlab_project_label.example
id = “see CLI command below for ID”
}
Importing using the CLI is supported with the following syntax:
Gitlab Project labels can be imported using an id made up of {project_id}:{label_name}
, e.g.
$ pulumi import gitlab:index/projectLabel:ProjectLabel example 12345:fixme
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.