Tag Protection
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const tagProtect = new gitlab.TagProtection("tagProtect", {
allowedToCreates: [
{
userId: 42,
},
{
groupId: 43,
},
],
createAccessLevel: "developer",
project: "12345",
tag: "TagProtected",
});
Content copied to clipboard
import pulumi
import pulumi_gitlab as gitlab
tag_protect = gitlab.TagProtection("tagProtect",
allowed_to_creates=[
gitlab.TagProtectionAllowedToCreateArgs(
user_id=42,
),
gitlab.TagProtectionAllowedToCreateArgs(
group_id=43,
),
],
create_access_level="developer",
project="12345",
tag="TagProtected")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var tagProtect = new GitLab.TagProtection("tagProtect", new()
{
AllowedToCreates = new[]
{
new GitLab.Inputs.TagProtectionAllowedToCreateArgs
{
UserId = 42,
},
new GitLab.Inputs.TagProtectionAllowedToCreateArgs
{
GroupId = 43,
},
},
CreateAccessLevel = "developer",
Project = "12345",
Tag = "TagProtected",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.NewTagProtection(ctx, "tagProtect", &gitlab.TagProtectionArgs{
AllowedToCreates: gitlab.TagProtectionAllowedToCreateArray{
&gitlab.TagProtectionAllowedToCreateArgs{
UserId: pulumi.Int(42),
},
&gitlab.TagProtectionAllowedToCreateArgs{
GroupId: pulumi.Int(43),
},
},
CreateAccessLevel: pulumi.String("developer"),
Project: pulumi.String("12345"),
Tag: pulumi.String("TagProtected"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.TagProtection;
import com.pulumi.gitlab.TagProtectionArgs;
import com.pulumi.gitlab.inputs.TagProtectionAllowedToCreateArgs;
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 tagProtect = new TagProtection("tagProtect", TagProtectionArgs.builder()
.allowedToCreates(
TagProtectionAllowedToCreateArgs.builder()
.userId(42)
.build(),
TagProtectionAllowedToCreateArgs.builder()
.groupId(43)
.build())
.createAccessLevel("developer")
.project("12345")
.tag("TagProtected")
.build());
}
}
Content copied to clipboard
resources:
tagProtect:
type: gitlab:TagProtection
properties:
allowedToCreates:
- userId: 42
- groupId: 43
createAccessLevel: developer
project: '12345'
tag: TagProtected
Content copied to clipboard
Import
Tag protections can be imported using an id made up of project_id:tag_name
, e.g.
$ pulumi import gitlab:index/tagProtection:TagProtection example 123456789:v1.0.0
Content copied to clipboard