gitlab.ProjectLabel
Explore with Pulumi AI
The gitlab.ProjectLabel
resource allows to manage 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 fixme = new gitlab.ProjectLabel("fixme", {
project: "example",
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
fixme = gitlab.ProjectLabel("fixme",
project="example",
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/v8/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.NewProjectLabel(ctx, "fixme", &gitlab.ProjectLabelArgs{
Project: pulumi.String("example"),
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: pulumi.Any(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 fixme = new GitLab.ProjectLabel("fixme", new()
{
Project = "example",
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.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 fixme = new ProjectLabel("fixme", ProjectLabelArgs.builder()
.project("example")
.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:
fixme:
type: gitlab:ProjectLabel
properties:
project: example
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:
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,
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)
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
Gitlab Project labels can be imported using an id made up of {project_id}:{group_label_id}
, 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.