1. Packages
  2. Gitlab Provider
  3. API Docs
  4. UserCustomAttribute
GitLab v8.4.1 published on Tuesday, Sep 24, 2024 by Pulumi

gitlab.UserCustomAttribute

Explore with Pulumi AI

gitlab logo
GitLab v8.4.1 published on Tuesday, Sep 24, 2024 by Pulumi

    The gitlab.UserCustomAttribute resource allows to manage custom attributes for a user.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const attr = new gitlab.UserCustomAttribute("attr", {
        user: 42,
        key: "location",
        value: "Greenland",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    attr = gitlab.UserCustomAttribute("attr",
        user=42,
        key="location",
        value="Greenland")
    
    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.NewUserCustomAttribute(ctx, "attr", &gitlab.UserCustomAttributeArgs{
    			User:  pulumi.Int(42),
    			Key:   pulumi.String("location"),
    			Value: pulumi.String("Greenland"),
    		})
    		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 attr = new GitLab.UserCustomAttribute("attr", new()
        {
            User = 42,
            Key = "location",
            Value = "Greenland",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.UserCustomAttribute;
    import com.pulumi.gitlab.UserCustomAttributeArgs;
    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 attr = new UserCustomAttribute("attr", UserCustomAttributeArgs.builder()
                .user("42")
                .key("location")
                .value("Greenland")
                .build());
    
        }
    }
    
    resources:
      attr:
        type: gitlab:UserCustomAttribute
        properties:
          user: '42'
          key: location
          value: Greenland
    

    Create UserCustomAttribute Resource

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

    Constructor syntax

    new UserCustomAttribute(name: string, args: UserCustomAttributeArgs, opts?: CustomResourceOptions);
    @overload
    def UserCustomAttribute(resource_name: str,
                            args: UserCustomAttributeArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserCustomAttribute(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            key: Optional[str] = None,
                            user: Optional[int] = None,
                            value: Optional[str] = None)
    func NewUserCustomAttribute(ctx *Context, name string, args UserCustomAttributeArgs, opts ...ResourceOption) (*UserCustomAttribute, error)
    public UserCustomAttribute(string name, UserCustomAttributeArgs args, CustomResourceOptions? opts = null)
    public UserCustomAttribute(String name, UserCustomAttributeArgs args)
    public UserCustomAttribute(String name, UserCustomAttributeArgs args, CustomResourceOptions options)
    
    type: gitlab:UserCustomAttribute
    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 UserCustomAttributeArgs
    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 UserCustomAttributeArgs
    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 UserCustomAttributeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserCustomAttributeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserCustomAttributeArgs
    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 userCustomAttributeResource = new GitLab.UserCustomAttribute("userCustomAttributeResource", new()
    {
        Key = "string",
        User = 0,
        Value = "string",
    });
    
    example, err := gitlab.NewUserCustomAttribute(ctx, "userCustomAttributeResource", &gitlab.UserCustomAttributeArgs{
    	Key:   pulumi.String("string"),
    	User:  pulumi.Int(0),
    	Value: pulumi.String("string"),
    })
    
    var userCustomAttributeResource = new UserCustomAttribute("userCustomAttributeResource", UserCustomAttributeArgs.builder()
        .key("string")
        .user(0)
        .value("string")
        .build());
    
    user_custom_attribute_resource = gitlab.UserCustomAttribute("userCustomAttributeResource",
        key="string",
        user=0,
        value="string")
    
    const userCustomAttributeResource = new gitlab.UserCustomAttribute("userCustomAttributeResource", {
        key: "string",
        user: 0,
        value: "string",
    });
    
    type: gitlab:UserCustomAttribute
    properties:
        key: string
        user: 0
        value: string
    

    UserCustomAttribute 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 UserCustomAttribute resource accepts the following input properties:

    Key string
    Key for the Custom Attribute.
    User int
    The id of the user.
    Value string
    Value for the Custom Attribute.
    Key string
    Key for the Custom Attribute.
    User int
    The id of the user.
    Value string
    Value for the Custom Attribute.
    key String
    Key for the Custom Attribute.
    user Integer
    The id of the user.
    value String
    Value for the Custom Attribute.
    key string
    Key for the Custom Attribute.
    user number
    The id of the user.
    value string
    Value for the Custom Attribute.
    key str
    Key for the Custom Attribute.
    user int
    The id of the user.
    value str
    Value for the Custom Attribute.
    key String
    Key for the Custom Attribute.
    user Number
    The id of the user.
    value String
    Value for the Custom Attribute.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the UserCustomAttribute 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 UserCustomAttribute Resource

    Get an existing UserCustomAttribute 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?: UserCustomAttributeState, opts?: CustomResourceOptions): UserCustomAttribute
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key: Optional[str] = None,
            user: Optional[int] = None,
            value: Optional[str] = None) -> UserCustomAttribute
    func GetUserCustomAttribute(ctx *Context, name string, id IDInput, state *UserCustomAttributeState, opts ...ResourceOption) (*UserCustomAttribute, error)
    public static UserCustomAttribute Get(string name, Input<string> id, UserCustomAttributeState? state, CustomResourceOptions? opts = null)
    public static UserCustomAttribute get(String name, Output<String> id, UserCustomAttributeState 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:
    Key string
    Key for the Custom Attribute.
    User int
    The id of the user.
    Value string
    Value for the Custom Attribute.
    Key string
    Key for the Custom Attribute.
    User int
    The id of the user.
    Value string
    Value for the Custom Attribute.
    key String
    Key for the Custom Attribute.
    user Integer
    The id of the user.
    value String
    Value for the Custom Attribute.
    key string
    Key for the Custom Attribute.
    user number
    The id of the user.
    value string
    Value for the Custom Attribute.
    key str
    Key for the Custom Attribute.
    user int
    The id of the user.
    value str
    Value for the Custom Attribute.
    key String
    Key for the Custom Attribute.
    user Number
    The id of the user.
    value String
    Value for the Custom Attribute.

    Import

    You can import a user custom attribute using an id made up of {user-id}:{key}, e.g.

    $ pulumi import gitlab:index/userCustomAttribute:UserCustomAttribute attr 42:location
    

    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 v8.4.1 published on Tuesday, Sep 24, 2024 by Pulumi