1. Packages
  2. Netbox Provider
  3. API Docs
  4. User
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

netbox.User

Explore with Pulumi AI

netbox logo
netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger

    This resource is used to manage users.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as netbox from "@pulumi/netbox";
    
    const test = new netbox.User("test", {
        active: true,
        password: "Abcdefghijkl1",
        staff: true,
        username: "johndoe",
    });
    
    import pulumi
    import pulumi_netbox as netbox
    
    test = netbox.User("test",
        active=True,
        password="Abcdefghijkl1",
        staff=True,
        username="johndoe")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/netbox/v3/netbox"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := netbox.NewUser(ctx, "test", &netbox.UserArgs{
    			Active:   pulumi.Bool(true),
    			Password: pulumi.String("Abcdefghijkl1"),
    			Staff:    pulumi.Bool(true),
    			Username: pulumi.String("johndoe"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Netbox = Pulumi.Netbox;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Netbox.User("test", new()
        {
            Active = true,
            Password = "Abcdefghijkl1",
            Staff = true,
            Username = "johndoe",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.netbox.User;
    import com.pulumi.netbox.UserArgs;
    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 test = new User("test", UserArgs.builder()
                .active(true)
                .password("Abcdefghijkl1")
                .staff(true)
                .username("johndoe")
                .build());
    
        }
    }
    
    resources:
      test:
        type: netbox:User
        properties:
          active: true
          password: Abcdefghijkl1
          staff: true
          username: johndoe
    

    Create User Resource

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

    Constructor syntax

    new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
    @overload
    def User(resource_name: str,
             args: UserArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def User(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             password: Optional[str] = None,
             username: Optional[str] = None,
             active: Optional[bool] = None,
             group_ids: Optional[Sequence[float]] = None,
             staff: Optional[bool] = None,
             user_id: Optional[str] = None)
    func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
    public User(string name, UserArgs args, CustomResourceOptions? opts = null)
    public User(String name, UserArgs args)
    public User(String name, UserArgs args, CustomResourceOptions options)
    
    type: netbox:User
    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 UserArgs
    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 UserArgs
    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 UserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserArgs
    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 userResource = new Netbox.User("userResource", new()
    {
        Password = "string",
        Username = "string",
        Active = false,
        GroupIds = new[]
        {
            0,
        },
        Staff = false,
        UserId = "string",
    });
    
    example, err := netbox.NewUser(ctx, "userResource", &netbox.UserArgs{
    Password: pulumi.String("string"),
    Username: pulumi.String("string"),
    Active: pulumi.Bool(false),
    GroupIds: pulumi.Float64Array{
    pulumi.Float64(0),
    },
    Staff: pulumi.Bool(false),
    UserId: pulumi.String("string"),
    })
    
    var userResource = new User("userResource", UserArgs.builder()
        .password("string")
        .username("string")
        .active(false)
        .groupIds(0)
        .staff(false)
        .userId("string")
        .build());
    
    user_resource = netbox.User("userResource",
        password="string",
        username="string",
        active=False,
        group_ids=[0],
        staff=False,
        user_id="string")
    
    const userResource = new netbox.User("userResource", {
        password: "string",
        username: "string",
        active: false,
        groupIds: [0],
        staff: false,
        userId: "string",
    });
    
    type: netbox:User
    properties:
        active: false
        groupIds:
            - 0
        password: string
        staff: false
        userId: string
        username: string
    

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

    Password string
    Username string
    Active bool
    Defaults to true.
    GroupIds List<double>
    Staff bool
    Defaults to false.
    UserId string
    The ID of this resource.
    Password string
    Username string
    Active bool
    Defaults to true.
    GroupIds []float64
    Staff bool
    Defaults to false.
    UserId string
    The ID of this resource.
    password String
    username String
    active Boolean
    Defaults to true.
    groupIds List<Double>
    staff Boolean
    Defaults to false.
    userId String
    The ID of this resource.
    password string
    username string
    active boolean
    Defaults to true.
    groupIds number[]
    staff boolean
    Defaults to false.
    userId string
    The ID of this resource.
    password str
    username str
    active bool
    Defaults to true.
    group_ids Sequence[float]
    staff bool
    Defaults to false.
    user_id str
    The ID of this resource.
    password String
    username String
    active Boolean
    Defaults to true.
    groupIds List<Number>
    staff Boolean
    Defaults to false.
    userId String
    The ID of this resource.

    Outputs

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

    Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            active: Optional[bool] = None,
            group_ids: Optional[Sequence[float]] = None,
            password: Optional[str] = None,
            staff: Optional[bool] = None,
            user_id: Optional[str] = None,
            username: Optional[str] = None) -> User
    func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
    public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
    public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
    resources:  _:    type: netbox:User    get:      id: ${id}
    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:
    Active bool
    Defaults to true.
    GroupIds List<double>
    Password string
    Staff bool
    Defaults to false.
    UserId string
    The ID of this resource.
    Username string
    Active bool
    Defaults to true.
    GroupIds []float64
    Password string
    Staff bool
    Defaults to false.
    UserId string
    The ID of this resource.
    Username string
    active Boolean
    Defaults to true.
    groupIds List<Double>
    password String
    staff Boolean
    Defaults to false.
    userId String
    The ID of this resource.
    username String
    active boolean
    Defaults to true.
    groupIds number[]
    password string
    staff boolean
    Defaults to false.
    userId string
    The ID of this resource.
    username string
    active bool
    Defaults to true.
    group_ids Sequence[float]
    password str
    staff bool
    Defaults to false.
    user_id str
    The ID of this resource.
    username str
    active Boolean
    Defaults to true.
    groupIds List<Number>
    password String
    staff Boolean
    Defaults to false.
    userId String
    The ID of this resource.
    username String

    Package Details

    Repository
    netbox e-breuninger/terraform-provider-netbox
    License
    Notes
    This Pulumi package is based on the netbox Terraform Provider.
    netbox logo
    netbox 3.10.0 published on Monday, Apr 14, 2025 by e-breuninger