1. Packages
  2. GitLab
  3. API Docs
  4. TagProtection
GitLab v6.11.0 published on Friday, Apr 19, 2024 by Pulumi

gitlab.TagProtection

Explore with Pulumi AI

gitlab logo
GitLab v6.11.0 published on Friday, Apr 19, 2024 by Pulumi

    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",
    });
    
    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")
    
    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
    	})
    }
    
    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",
        });
    
    });
    
    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());
    
        }
    }
    
    resources:
      tagProtect:
        type: gitlab:TagProtection
        properties:
          allowedToCreates:
            - userId: 42
            - groupId: 43
          createAccessLevel: developer
          project: '12345'
          tag: TagProtected
    

    Create TagProtection Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new TagProtection(name: string, args: TagProtectionArgs, opts?: CustomResourceOptions);
    @overload
    def TagProtection(resource_name: str,
                      args: TagProtectionArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def TagProtection(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      create_access_level: Optional[str] = None,
                      project: Optional[str] = None,
                      tag: Optional[str] = None,
                      allowed_to_creates: Optional[Sequence[TagProtectionAllowedToCreateArgs]] = None)
    func NewTagProtection(ctx *Context, name string, args TagProtectionArgs, opts ...ResourceOption) (*TagProtection, error)
    public TagProtection(string name, TagProtectionArgs args, CustomResourceOptions? opts = null)
    public TagProtection(String name, TagProtectionArgs args)
    public TagProtection(String name, TagProtectionArgs args, CustomResourceOptions options)
    
    type: gitlab:TagProtection
    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 TagProtectionArgs
    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 TagProtectionArgs
    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 TagProtectionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TagProtectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TagProtectionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var tagProtectionResource = new GitLab.TagProtection("tagProtectionResource", new()
    {
        CreateAccessLevel = "string",
        Project = "string",
        Tag = "string",
        AllowedToCreates = new[]
        {
            new GitLab.Inputs.TagProtectionAllowedToCreateArgs
            {
                AccessLevel = "string",
                AccessLevelDescription = "string",
                GroupId = 0,
                UserId = 0,
            },
        },
    });
    
    example, err := gitlab.NewTagProtection(ctx, "tagProtectionResource", &gitlab.TagProtectionArgs{
    	CreateAccessLevel: pulumi.String("string"),
    	Project:           pulumi.String("string"),
    	Tag:               pulumi.String("string"),
    	AllowedToCreates: gitlab.TagProtectionAllowedToCreateArray{
    		&gitlab.TagProtectionAllowedToCreateArgs{
    			AccessLevel:            pulumi.String("string"),
    			AccessLevelDescription: pulumi.String("string"),
    			GroupId:                pulumi.Int(0),
    			UserId:                 pulumi.Int(0),
    		},
    	},
    })
    
    var tagProtectionResource = new TagProtection("tagProtectionResource", TagProtectionArgs.builder()        
        .createAccessLevel("string")
        .project("string")
        .tag("string")
        .allowedToCreates(TagProtectionAllowedToCreateArgs.builder()
            .accessLevel("string")
            .accessLevelDescription("string")
            .groupId(0)
            .userId(0)
            .build())
        .build());
    
    tag_protection_resource = gitlab.TagProtection("tagProtectionResource",
        create_access_level="string",
        project="string",
        tag="string",
        allowed_to_creates=[gitlab.TagProtectionAllowedToCreateArgs(
            access_level="string",
            access_level_description="string",
            group_id=0,
            user_id=0,
        )])
    
    const tagProtectionResource = new gitlab.TagProtection("tagProtectionResource", {
        createAccessLevel: "string",
        project: "string",
        tag: "string",
        allowedToCreates: [{
            accessLevel: "string",
            accessLevelDescription: "string",
            groupId: 0,
            userId: 0,
        }],
    });
    
    type: gitlab:TagProtection
    properties:
        allowedToCreates:
            - accessLevel: string
              accessLevelDescription: string
              groupId: 0
              userId: 0
        createAccessLevel: string
        project: string
        tag: string
    

    TagProtection Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The TagProtection resource accepts the following input properties:

    CreateAccessLevel string
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    Project string
    The id of the project.
    Tag string
    Name of the tag or wildcard.
    AllowedToCreates List<Pulumi.GitLab.Inputs.TagProtectionAllowedToCreate>
    User or group which are allowed to create.
    CreateAccessLevel string
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    Project string
    The id of the project.
    Tag string
    Name of the tag or wildcard.
    AllowedToCreates []TagProtectionAllowedToCreateArgs
    User or group which are allowed to create.
    createAccessLevel String
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    project String
    The id of the project.
    tag String
    Name of the tag or wildcard.
    allowedToCreates List<TagProtectionAllowedToCreate>
    User or group which are allowed to create.
    createAccessLevel string
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    project string
    The id of the project.
    tag string
    Name of the tag or wildcard.
    allowedToCreates TagProtectionAllowedToCreate[]
    User or group which are allowed to create.
    create_access_level str
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    project str
    The id of the project.
    tag str
    Name of the tag or wildcard.
    allowed_to_creates Sequence[TagProtectionAllowedToCreateArgs]
    User or group which are allowed to create.
    createAccessLevel String
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    project String
    The id of the project.
    tag String
    Name of the tag or wildcard.
    allowedToCreates List<Property Map>
    User or group which are allowed to create.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TagProtection resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing TagProtection Resource

    Get an existing TagProtection 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?: TagProtectionState, opts?: CustomResourceOptions): TagProtection
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            allowed_to_creates: Optional[Sequence[TagProtectionAllowedToCreateArgs]] = None,
            create_access_level: Optional[str] = None,
            project: Optional[str] = None,
            tag: Optional[str] = None) -> TagProtection
    func GetTagProtection(ctx *Context, name string, id IDInput, state *TagProtectionState, opts ...ResourceOption) (*TagProtection, error)
    public static TagProtection Get(string name, Input<string> id, TagProtectionState? state, CustomResourceOptions? opts = null)
    public static TagProtection get(String name, Output<String> id, TagProtectionState 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.
    The following state arguments are supported:
    AllowedToCreates List<Pulumi.GitLab.Inputs.TagProtectionAllowedToCreate>
    User or group which are allowed to create.
    CreateAccessLevel string
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    Project string
    The id of the project.
    Tag string
    Name of the tag or wildcard.
    AllowedToCreates []TagProtectionAllowedToCreateArgs
    User or group which are allowed to create.
    CreateAccessLevel string
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    Project string
    The id of the project.
    Tag string
    Name of the tag or wildcard.
    allowedToCreates List<TagProtectionAllowedToCreate>
    User or group which are allowed to create.
    createAccessLevel String
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    project String
    The id of the project.
    tag String
    Name of the tag or wildcard.
    allowedToCreates TagProtectionAllowedToCreate[]
    User or group which are allowed to create.
    createAccessLevel string
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    project string
    The id of the project.
    tag string
    Name of the tag or wildcard.
    allowed_to_creates Sequence[TagProtectionAllowedToCreateArgs]
    User or group which are allowed to create.
    create_access_level str
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    project str
    The id of the project.
    tag str
    Name of the tag or wildcard.
    allowedToCreates List<Property Map>
    User or group which are allowed to create.
    createAccessLevel String
    Access levels which are allowed to create. Valid values are: no one, developer, maintainer.
    project String
    The id of the project.
    tag String
    Name of the tag or wildcard.

    Supporting Types

    TagProtectionAllowedToCreate, TagProtectionAllowedToCreateArgs

    AccessLevel string
    Level of access.
    AccessLevelDescription string
    Readable description of level of access.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    AccessLevel string
    Level of access.
    AccessLevelDescription string
    Readable description of level of access.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    accessLevel String
    Level of access.
    accessLevelDescription String
    Readable description of level of access.
    groupId Integer
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    userId Integer
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    accessLevel string
    Level of access.
    accessLevelDescription string
    Readable description of level of access.
    groupId number
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    userId number
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    access_level str
    Level of access.
    access_level_description str
    Readable description of level of access.
    group_id int
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    user_id int
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.
    accessLevel String
    Level of access.
    accessLevelDescription String
    Readable description of level of access.
    groupId Number
    The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with user_id.
    userId Number
    The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with group_id.

    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
    

    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.
    gitlab logo
    GitLab v6.11.0 published on Friday, Apr 19, 2024 by Pulumi