gitlab.TagProtection
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const tagProtect = new gitlab.TagProtection("TagProtect", {
project: "12345",
tag: "TagProtected",
createAccessLevel: "developer",
allowedToCreates: [
{
userId: 42,
},
{
groupId: 43,
},
],
});
import pulumi
import pulumi_gitlab as gitlab
tag_protect = gitlab.TagProtection("TagProtect",
project="12345",
tag="TagProtected",
create_access_level="developer",
allowed_to_creates=[
gitlab.TagProtectionAllowedToCreateArgs(
user_id=42,
),
gitlab.TagProtectionAllowedToCreateArgs(
group_id=43,
),
])
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.NewTagProtection(ctx, "TagProtect", &gitlab.TagProtectionArgs{
Project: pulumi.String("12345"),
Tag: pulumi.String("TagProtected"),
CreateAccessLevel: pulumi.String("developer"),
AllowedToCreates: gitlab.TagProtectionAllowedToCreateArray{
&gitlab.TagProtectionAllowedToCreateArgs{
UserId: pulumi.Int(42),
},
&gitlab.TagProtectionAllowedToCreateArgs{
GroupId: pulumi.Int(43),
},
},
})
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()
{
Project = "12345",
Tag = "TagProtected",
CreateAccessLevel = "developer",
AllowedToCreates = new[]
{
new GitLab.Inputs.TagProtectionAllowedToCreateArgs
{
UserId = 42,
},
new GitLab.Inputs.TagProtectionAllowedToCreateArgs
{
GroupId = 43,
},
},
});
});
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()
.project("12345")
.tag("TagProtected")
.createAccessLevel("developer")
.allowedToCreates(
TagProtectionAllowedToCreateArgs.builder()
.userId(42)
.build(),
TagProtectionAllowedToCreateArgs.builder()
.groupId(43)
.build())
.build());
}
}
resources:
tagProtect:
type: gitlab:TagProtection
name: TagProtect
properties:
project: '12345'
tag: TagProtected
createAccessLevel: developer
allowedToCreates:
- userId: 42
- groupId: 43
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.
Constructor 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:
- Create
Access stringLevel - 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 List<Pulumi.Creates Git Lab. Inputs. Tag Protection Allowed To Create> - User or group which are allowed to create.
- Create
Access stringLevel - 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 []TagCreates Protection Allowed To Create Args - User or group which are allowed to create.
- create
Access StringLevel - 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 List<TagCreates Protection Allowed To Create> - User or group which are allowed to create.
- create
Access stringLevel - 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 TagCreates Protection Allowed To Create[] - User or group which are allowed to create.
- create_
access_ strlevel - 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_ Sequence[Tagcreates Protection Allowed To Create Args] - User or group which are allowed to create.
- create
Access StringLevel - 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 List<Property Map>Creates - 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.
- Allowed
To List<Pulumi.Creates Git Lab. Inputs. Tag Protection Allowed To Create> - User or group which are allowed to create.
- Create
Access stringLevel - 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 []TagCreates Protection Allowed To Create Args - User or group which are allowed to create.
- Create
Access stringLevel - 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 List<TagCreates Protection Allowed To Create> - User or group which are allowed to create.
- create
Access StringLevel - 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 TagCreates Protection Allowed To Create[] - User or group which are allowed to create.
- create
Access stringLevel - 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_ Sequence[Tagcreates Protection Allowed To Create Args] - User or group which are allowed to create.
- create_
access_ strlevel - 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 List<Property Map>Creates - User or group which are allowed to create.
- create
Access StringLevel - 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
- Access
Level string - Level of access.
- Access
Level stringDescription - 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
.
- Access
Level string - Level of access.
- Access
Level stringDescription - 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
.
- access
Level String - Level of access.
- access
Level StringDescription - Readable description of level of access.
- group
Id Integer - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
user_id
. - user
Id Integer - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
group_id
.
- access
Level string - Level of access.
- access
Level stringDescription - Readable description of level of access.
- group
Id number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
user_id
. - user
Id 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_ strdescription - 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
.
- access
Level String - Level of access.
- access
Level StringDescription - Readable description of level of access.
- group
Id Number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
user_id
. - user
Id 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.