gitlab.ProjectTag
Explore with Pulumi AI
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)
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 {
// 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
})
}
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 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}
Create ProjectTag Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectTag(name: string, args: ProjectTagArgs, opts?: CustomResourceOptions);
@overload
def ProjectTag(resource_name: str,
args: ProjectTagArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectTag(resource_name: str,
opts: Optional[ResourceOptions] = None,
project: Optional[str] = None,
ref: Optional[str] = None,
message: Optional[str] = None,
name: Optional[str] = None)
func NewProjectTag(ctx *Context, name string, args ProjectTagArgs, opts ...ResourceOption) (*ProjectTag, error)
public ProjectTag(string name, ProjectTagArgs args, CustomResourceOptions? opts = null)
public ProjectTag(String name, ProjectTagArgs args)
public ProjectTag(String name, ProjectTagArgs args, CustomResourceOptions options)
type: gitlab:ProjectTag
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 ProjectTagArgs
- 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 ProjectTagArgs
- 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 ProjectTagArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectTagArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectTagArgs
- 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 projectTagResource = new GitLab.ProjectTag("projectTagResource", new()
{
Project = "string",
Ref = "string",
Message = "string",
Name = "string",
});
example, err := gitlab.NewProjectTag(ctx, "projectTagResource", &gitlab.ProjectTagArgs{
Project: pulumi.String("string"),
Ref: pulumi.String("string"),
Message: pulumi.String("string"),
Name: pulumi.String("string"),
})
var projectTagResource = new ProjectTag("projectTagResource", ProjectTagArgs.builder()
.project("string")
.ref("string")
.message("string")
.name("string")
.build());
project_tag_resource = gitlab.ProjectTag("projectTagResource",
project="string",
ref="string",
message="string",
name="string")
const projectTagResource = new gitlab.ProjectTag("projectTagResource", {
project: "string",
ref: "string",
message: "string",
name: "string",
});
type: gitlab:ProjectTag
properties:
message: string
name: string
project: string
ref: string
ProjectTag 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 ProjectTag resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectTag resource produces the following output properties:
- Commits
List<Pulumi.
Git Lab. Outputs. Project Tag Commit> - The commit associated with the tag.
- Id string
- The provider-assigned unique ID for this managed resource.
- Protected bool
- Bool, true if tag has tag protection.
- Releases
List<Pulumi.
Git Lab. Outputs. Project Tag Release> - The release associated with the tag.
- Target string
- The unique id assigned to the commit by Gitlab.
- Commits
[]Project
Tag Commit - The commit associated with the tag.
- Id string
- The provider-assigned unique ID for this managed resource.
- Protected bool
- Bool, true if tag has tag protection.
- Releases
[]Project
Tag Release - The release associated with the tag.
- Target string
- The unique id assigned to the commit by Gitlab.
- commits
List<Project
Tag Commit> - The commit associated with the tag.
- id String
- The provider-assigned unique ID for this managed resource.
- protected_ Boolean
- Bool, true if tag has tag protection.
- releases
List<Project
Tag Release> - The release associated with the tag.
- target String
- The unique id assigned to the commit by Gitlab.
- commits
Project
Tag Commit[] - The commit associated with the tag.
- id string
- The provider-assigned unique ID for this managed resource.
- protected boolean
- Bool, true if tag has tag protection.
- releases
Project
Tag Release[] - The release associated with the tag.
- target string
- The unique id assigned to the commit by Gitlab.
- commits
Sequence[Project
Tag Commit] - The commit associated with the tag.
- id str
- The provider-assigned unique ID for this managed resource.
- protected bool
- Bool, true if tag has tag protection.
- releases
Sequence[Project
Tag Release] - The release associated with the tag.
- target str
- The unique id assigned to the commit by Gitlab.
- commits List<Property Map>
- The commit associated with the tag.
- id String
- The provider-assigned unique ID for this managed resource.
- protected Boolean
- Bool, true if tag has tag protection.
- releases List<Property Map>
- The release associated with the tag.
- target String
- The unique id assigned to the commit by Gitlab.
Look up Existing ProjectTag Resource
Get an existing ProjectTag 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?: ProjectTagState, opts?: CustomResourceOptions): ProjectTag
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
commits: Optional[Sequence[ProjectTagCommitArgs]] = None,
message: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
protected: Optional[bool] = None,
ref: Optional[str] = None,
releases: Optional[Sequence[ProjectTagReleaseArgs]] = None,
target: Optional[str] = None) -> ProjectTag
func GetProjectTag(ctx *Context, name string, id IDInput, state *ProjectTagState, opts ...ResourceOption) (*ProjectTag, error)
public static ProjectTag Get(string name, Input<string> id, ProjectTagState? state, CustomResourceOptions? opts = null)
public static ProjectTag get(String name, Output<String> id, ProjectTagState 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.
- Commits
List<Pulumi.
Git Lab. Inputs. Project Tag Commit> - The commit associated with the tag.
- Message string
- The message of the annotated tag.
- Name string
- The name of a tag.
- Project string
- The ID or URL-encoded path of the project owned by the authenticated user.
- Protected bool
- Bool, true if tag has tag protection.
- Ref string
- Create tag using commit SHA, another tag name, or branch name. This attribute is not available for imported resources.
- Releases
List<Pulumi.
Git Lab. Inputs. Project Tag Release> - The release associated with the tag.
- Target string
- The unique id assigned to the commit by Gitlab.
- Commits
[]Project
Tag Commit Args - The commit associated with the tag.
- Message string
- The message of the annotated tag.
- Name string
- The name of a tag.
- Project string
- The ID or URL-encoded path of the project owned by the authenticated user.
- Protected bool
- Bool, true if tag has tag protection.
- Ref string
- Create tag using commit SHA, another tag name, or branch name. This attribute is not available for imported resources.
- Releases
[]Project
Tag Release Args - The release associated with the tag.
- Target string
- The unique id assigned to the commit by Gitlab.
- commits
List<Project
Tag Commit> - The commit associated with the tag.
- message String
- The message of the annotated tag.
- name String
- The name of a tag.
- project String
- The ID or URL-encoded path of the project owned by the authenticated user.
- protected_ Boolean
- Bool, true if tag has tag protection.
- ref String
- Create tag using commit SHA, another tag name, or branch name. This attribute is not available for imported resources.
- releases
List<Project
Tag Release> - The release associated with the tag.
- target String
- The unique id assigned to the commit by Gitlab.
- commits
Project
Tag Commit[] - The commit associated with the tag.
- message string
- The message of the annotated tag.
- name string
- The name of a tag.
- project string
- The ID or URL-encoded path of the project owned by the authenticated user.
- protected boolean
- Bool, true if tag has tag protection.
- ref string
- Create tag using commit SHA, another tag name, or branch name. This attribute is not available for imported resources.
- releases
Project
Tag Release[] - The release associated with the tag.
- target string
- The unique id assigned to the commit by Gitlab.
- commits
Sequence[Project
Tag Commit Args] - The commit associated with the tag.
- message str
- The message of the annotated tag.
- name str
- The name of a tag.
- project str
- The ID or URL-encoded path of the project owned by the authenticated user.
- protected bool
- Bool, true if tag has tag protection.
- ref str
- Create tag using commit SHA, another tag name, or branch name. This attribute is not available for imported resources.
- releases
Sequence[Project
Tag Release Args] - The release associated with the tag.
- target str
- The unique id assigned to the commit by Gitlab.
- commits List<Property Map>
- The commit associated with the tag.
- message String
- The message of the annotated tag.
- name String
- The name of a tag.
- project String
- The ID or URL-encoded path of the project owned by the authenticated user.
- protected Boolean
- Bool, true if tag has tag protection.
- ref String
- Create tag using commit SHA, another tag name, or branch name. This attribute is not available for imported resources.
- releases List<Property Map>
- The release associated with the tag.
- target String
- The unique id assigned to the commit by Gitlab.
Supporting Types
ProjectTagCommit, ProjectTagCommitArgs
- string
- The email of the author.
- string
- The name of the author.
- string
- The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
- Committed
Date string - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
- Committer
Email string - The email of the user that committed.
- Committer
Name string - The name of the user that committed.
- Id string
- The unique id assigned to the commit by Gitlab.
- Message string
- The commit message
- Parent
Ids List<string> - The id of the parents of the commit
- Short
Id string - The short id assigned to the commit by Gitlab.
- Title string
- The title of the commit
- string
- The email of the author.
- string
- The name of the author.
- string
- The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
- Committed
Date string - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
- Committer
Email string - The email of the user that committed.
- Committer
Name string - The name of the user that committed.
- Id string
- The unique id assigned to the commit by Gitlab.
- Message string
- The commit message
- Parent
Ids []string - The id of the parents of the commit
- Short
Id string - The short id assigned to the commit by Gitlab.
- Title string
- The title of the commit
- String
- The email of the author.
- String
- The name of the author.
- String
- The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
- committed
Date String - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
- committer
Email String - The email of the user that committed.
- committer
Name String - The name of the user that committed.
- id String
- The unique id assigned to the commit by Gitlab.
- message String
- The commit message
- parent
Ids List<String> - The id of the parents of the commit
- short
Id String - The short id assigned to the commit by Gitlab.
- title String
- The title of the commit
- string
- The email of the author.
- string
- The name of the author.
- string
- The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
- committed
Date string - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
- committer
Email string - The email of the user that committed.
- committer
Name string - The name of the user that committed.
- id string
- The unique id assigned to the commit by Gitlab.
- message string
- The commit message
- parent
Ids string[] - The id of the parents of the commit
- short
Id string - The short id assigned to the commit by Gitlab.
- title string
- The title of the commit
- str
- The email of the author.
- str
- The name of the author.
- str
- The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
- committed_
date str - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
- committer_
email str - The email of the user that committed.
- committer_
name str - The name of the user that committed.
- id str
- The unique id assigned to the commit by Gitlab.
- message str
- The commit message
- parent_
ids Sequence[str] - The id of the parents of the commit
- short_
id str - The short id assigned to the commit by Gitlab.
- title str
- The title of the commit
- String
- The email of the author.
- String
- The name of the author.
- String
- The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
- committed
Date String - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
- committer
Email String - The email of the user that committed.
- committer
Name String - The name of the user that committed.
- id String
- The unique id assigned to the commit by Gitlab.
- message String
- The commit message
- parent
Ids List<String> - The id of the parents of the commit
- short
Id String - The short id assigned to the commit by Gitlab.
- title String
- The title of the commit
ProjectTagRelease, ProjectTagReleaseArgs
- Description string
- The description of release.
- Tag
Name string - The name of the tag.
- Description string
- The description of release.
- Tag
Name string - The name of the tag.
- description String
- The description of release.
- tag
Name String - The name of the tag.
- description string
- The description of release.
- tag
Name string - The name of the tag.
- description str
- The description of release.
- tag_
name str - The name of the tag.
- description String
- The description of release.
- tag
Name String - The name of the tag.
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.
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.