ProjectTag

class ProjectTag : KotlinCustomResource

The gitlab.ProjectTag resource allows to manage the lifecycle of a tag in a project. Upstream API: GitLab API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
// Create a project for the tag to use
const example = new gitlab.Project("example", {
name: "example",
description: "An example project",
namespaceId: exampleGitlabGroup.id,
});
const exampleProjectTag = new gitlab.ProjectTag("example", {
name: "example",
ref: "main",
project: example.id,
});
import pulumi
import pulumi_gitlab as gitlab
# Create a project for the tag to use
example = gitlab.Project("example",
name="example",
description="An example project",
namespace_id=example_gitlab_group["id"])
example_project_tag = gitlab.ProjectTag("example",
name="example",
ref="main",
project=example.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
// Create a project for the tag to use
var example = new GitLab.Project("example", new()
{
Name = "example",
Description = "An example project",
NamespaceId = exampleGitlabGroup.Id,
});
var exampleProjectTag = new GitLab.ProjectTag("example", new()
{
Name = "example",
Ref = "main",
Project = example.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v7/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create a project for the tag to use
example, err := gitlab.NewProject(ctx, "example", &gitlab.ProjectArgs{
Name: pulumi.String("example"),
Description: pulumi.String("An example project"),
NamespaceId: pulumi.Any(exampleGitlabGroup.Id),
})
if err != nil {
return err
}
_, err = gitlab.NewProjectTag(ctx, "example", &gitlab.ProjectTagArgs{
Name: pulumi.String("example"),
Ref: pulumi.String("main"),
Project: example.ID(),
})
if err != nil {
return err
}
return nil
})
}
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.ProjectTag;
import com.pulumi.gitlab.ProjectTagArgs;
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) {
// Create a project for the tag to use
var example = new Project("example", ProjectArgs.builder()
.name("example")
.description("An example project")
.namespaceId(exampleGitlabGroup.id())
.build());
var exampleProjectTag = new ProjectTag("exampleProjectTag", ProjectTagArgs.builder()
.name("example")
.ref("main")
.project(example.id())
.build());
}
}
resources:
# Create a project for the tag to use
example:
type: gitlab:Project
properties:
name: example
description: An example project
namespaceId: ${exampleGitlabGroup.id}
exampleProjectTag:
type: gitlab:ProjectTag
name: example
properties:
name: example
ref: main
project: ${example.id}

Import

Gitlab project tags can be imported with a key composed of <project_id>:<tag_name>, e.g.

$ pulumi import gitlab:index/projectTag:ProjectTag example "12345:develop"

NOTE: the ref attribute won't be available for imported gitlab_project_tag resources.

Properties

Link copied to clipboard

The commit associated with the tag.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val message: Output<String>?

The message of the annotated tag.

Link copied to clipboard
val name: Output<String>

The name of a tag.

Link copied to clipboard
val project: Output<String>

The ID or URL-encoded path of the project owned by the authenticated user.

Link copied to clipboard
val protected: Output<Boolean>

Bool, true if tag has tag protection.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val ref: Output<String>

Create tag using commit SHA, another tag name, or branch name. This attribute is not available for imported resources.

Link copied to clipboard

The release associated with the tag.

Link copied to clipboard
val target: Output<String>

The unique id assigned to the commit by Gitlab.

Link copied to clipboard
val urn: Output<String>