1. Packages
  2. Unifi
  3. API Docs
  4. iam
  5. User
Unifi v0.0.3 published on Monday, Dec 5, 2022 by Pulumiverse

unifi.iam.User

Explore with Pulumi AI

unifi logo
Unifi v0.0.3 published on Monday, Dec 5, 2022 by Pulumiverse

    unifi.iam.User manages a user (or “client” in the UI) of the network, these are identified by unique MAC addresses.

    Users are created in the controller when observed on the network, so the resource defaults to allowing itself to just take over management of a MAC address, but this can be turned off.

    Example Usage

    using System.Collections.Generic;
    using Pulumi;
    using Unifi = Pulumiverse.Unifi;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Unifi.IAM.User("test", new()
        {
            Mac = "01:23:45:67:89:AB",
            Note = "my note",
            FixedIp = "10.0.0.50",
            NetworkId = unifi_network.My_vlan.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-unifi/sdk/go/unifi/iam"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := iam.NewUser(ctx, "test", &iam.UserArgs{
    			Mac:       pulumi.String("01:23:45:67:89:AB"),
    			Note:      pulumi.String("my note"),
    			FixedIp:   pulumi.String("10.0.0.50"),
    			NetworkId: pulumi.Any(unifi_network.My_vlan.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.unifi.iam.User;
    import com.pulumi.unifi.iam.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()        
                .mac("01:23:45:67:89:AB")
                .note("my note")
                .fixedIp("10.0.0.50")
                .networkId(unifi_network.my_vlan().id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumiverse_unifi as unifi
    
    test = unifi.iam.User("test",
        mac="01:23:45:67:89:AB",
        note="my note",
        fixed_ip="10.0.0.50",
        network_id=unifi_network["my_vlan"]["id"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as unifi from "@pulumiverse/unifi";
    
    const test = new unifi.iam.User("test", {
        mac: "01:23:45:67:89:AB",
        note: "my note",
        fixedIp: "10.0.0.50",
        networkId: unifi_network.my_vlan.id,
    });
    
    resources:
      test:
        type: unifi:iam:User
        properties:
          mac: 01:23:45:67:89:AB
          note: my note
          fixedIp: 10.0.0.50
          networkId: ${unifi_network.my_vlan.id}
    

    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,
             mac: Optional[str] = None,
             allow_existing: Optional[bool] = None,
             blocked: Optional[bool] = None,
             dev_id_override: Optional[int] = None,
             fixed_ip: Optional[str] = None,
             name: Optional[str] = None,
             network_id: Optional[str] = None,
             note: Optional[str] = None,
             site: Optional[str] = None,
             skip_forget_on_destroy: Optional[bool] = None,
             user_group_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: unifi:iam: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 Unifi.IAM.User("userResource", new()
    {
        Mac = "string",
        AllowExisting = false,
        Blocked = false,
        DevIdOverride = 0,
        FixedIp = "string",
        Name = "string",
        NetworkId = "string",
        Note = "string",
        Site = "string",
        SkipForgetOnDestroy = false,
        UserGroupId = "string",
    });
    
    example, err := iam.NewUser(ctx, "userResource", &iam.UserArgs{
    	Mac:                 pulumi.String("string"),
    	AllowExisting:       pulumi.Bool(false),
    	Blocked:             pulumi.Bool(false),
    	DevIdOverride:       pulumi.Int(0),
    	FixedIp:             pulumi.String("string"),
    	Name:                pulumi.String("string"),
    	NetworkId:           pulumi.String("string"),
    	Note:                pulumi.String("string"),
    	Site:                pulumi.String("string"),
    	SkipForgetOnDestroy: pulumi.Bool(false),
    	UserGroupId:         pulumi.String("string"),
    })
    
    var userResource = new User("userResource", UserArgs.builder()
        .mac("string")
        .allowExisting(false)
        .blocked(false)
        .devIdOverride(0)
        .fixedIp("string")
        .name("string")
        .networkId("string")
        .note("string")
        .site("string")
        .skipForgetOnDestroy(false)
        .userGroupId("string")
        .build());
    
    user_resource = unifi.iam.User("userResource",
        mac="string",
        allow_existing=False,
        blocked=False,
        dev_id_override=0,
        fixed_ip="string",
        name="string",
        network_id="string",
        note="string",
        site="string",
        skip_forget_on_destroy=False,
        user_group_id="string")
    
    const userResource = new unifi.iam.User("userResource", {
        mac: "string",
        allowExisting: false,
        blocked: false,
        devIdOverride: 0,
        fixedIp: "string",
        name: "string",
        networkId: "string",
        note: "string",
        site: "string",
        skipForgetOnDestroy: false,
        userGroupId: "string",
    });
    
    type: unifi:iam:User
    properties:
        allowExisting: false
        blocked: false
        devIdOverride: 0
        fixedIp: string
        mac: string
        name: string
        networkId: string
        note: string
        site: string
        skipForgetOnDestroy: false
        userGroupId: 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

    The User resource accepts the following input properties:

    Mac string
    The MAC address of the user.
    AllowExisting bool
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    Blocked bool
    Specifies whether this user should be blocked from the network.
    DevIdOverride int
    Override the device fingerprint.
    FixedIp string
    A fixed IPv4 address for this user.
    Name string
    The name of the user.
    NetworkId string
    The network ID for this user.
    Note string
    A note with additional information for the user.
    Site string
    The name of the site to associate the user with.
    SkipForgetOnDestroy bool
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    UserGroupId string
    The user group ID for the user.
    Mac string
    The MAC address of the user.
    AllowExisting bool
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    Blocked bool
    Specifies whether this user should be blocked from the network.
    DevIdOverride int
    Override the device fingerprint.
    FixedIp string
    A fixed IPv4 address for this user.
    Name string
    The name of the user.
    NetworkId string
    The network ID for this user.
    Note string
    A note with additional information for the user.
    Site string
    The name of the site to associate the user with.
    SkipForgetOnDestroy bool
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    UserGroupId string
    The user group ID for the user.
    mac String
    The MAC address of the user.
    allowExisting Boolean
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    blocked Boolean
    Specifies whether this user should be blocked from the network.
    devIdOverride Integer
    Override the device fingerprint.
    fixedIp String
    A fixed IPv4 address for this user.
    name String
    The name of the user.
    networkId String
    The network ID for this user.
    note String
    A note with additional information for the user.
    site String
    The name of the site to associate the user with.
    skipForgetOnDestroy Boolean
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    userGroupId String
    The user group ID for the user.
    mac string
    The MAC address of the user.
    allowExisting boolean
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    blocked boolean
    Specifies whether this user should be blocked from the network.
    devIdOverride number
    Override the device fingerprint.
    fixedIp string
    A fixed IPv4 address for this user.
    name string
    The name of the user.
    networkId string
    The network ID for this user.
    note string
    A note with additional information for the user.
    site string
    The name of the site to associate the user with.
    skipForgetOnDestroy boolean
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    userGroupId string
    The user group ID for the user.
    mac str
    The MAC address of the user.
    allow_existing bool
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    blocked bool
    Specifies whether this user should be blocked from the network.
    dev_id_override int
    Override the device fingerprint.
    fixed_ip str
    A fixed IPv4 address for this user.
    name str
    The name of the user.
    network_id str
    The network ID for this user.
    note str
    A note with additional information for the user.
    site str
    The name of the site to associate the user with.
    skip_forget_on_destroy bool
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    user_group_id str
    The user group ID for the user.
    mac String
    The MAC address of the user.
    allowExisting Boolean
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    blocked Boolean
    Specifies whether this user should be blocked from the network.
    devIdOverride Number
    Override the device fingerprint.
    fixedIp String
    A fixed IPv4 address for this user.
    name String
    The name of the user.
    networkId String
    The network ID for this user.
    note String
    A note with additional information for the user.
    site String
    The name of the site to associate the user with.
    skipForgetOnDestroy Boolean
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    userGroupId String
    The user group ID for the user.

    Outputs

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

    Hostname string
    The hostname of the user.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ip string
    The IP address of the user.
    Hostname string
    The hostname of the user.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ip string
    The IP address of the user.
    hostname String
    The hostname of the user.
    id String
    The provider-assigned unique ID for this managed resource.
    ip String
    The IP address of the user.
    hostname string
    The hostname of the user.
    id string
    The provider-assigned unique ID for this managed resource.
    ip string
    The IP address of the user.
    hostname str
    The hostname of the user.
    id str
    The provider-assigned unique ID for this managed resource.
    ip str
    The IP address of the user.
    hostname String
    The hostname of the user.
    id String
    The provider-assigned unique ID for this managed resource.
    ip String
    The IP address of the user.

    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,
            allow_existing: Optional[bool] = None,
            blocked: Optional[bool] = None,
            dev_id_override: Optional[int] = None,
            fixed_ip: Optional[str] = None,
            hostname: Optional[str] = None,
            ip: Optional[str] = None,
            mac: Optional[str] = None,
            name: Optional[str] = None,
            network_id: Optional[str] = None,
            note: Optional[str] = None,
            site: Optional[str] = None,
            skip_forget_on_destroy: Optional[bool] = None,
            user_group_id: 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)
    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:
    AllowExisting bool
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    Blocked bool
    Specifies whether this user should be blocked from the network.
    DevIdOverride int
    Override the device fingerprint.
    FixedIp string
    A fixed IPv4 address for this user.
    Hostname string
    The hostname of the user.
    Ip string
    The IP address of the user.
    Mac string
    The MAC address of the user.
    Name string
    The name of the user.
    NetworkId string
    The network ID for this user.
    Note string
    A note with additional information for the user.
    Site string
    The name of the site to associate the user with.
    SkipForgetOnDestroy bool
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    UserGroupId string
    The user group ID for the user.
    AllowExisting bool
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    Blocked bool
    Specifies whether this user should be blocked from the network.
    DevIdOverride int
    Override the device fingerprint.
    FixedIp string
    A fixed IPv4 address for this user.
    Hostname string
    The hostname of the user.
    Ip string
    The IP address of the user.
    Mac string
    The MAC address of the user.
    Name string
    The name of the user.
    NetworkId string
    The network ID for this user.
    Note string
    A note with additional information for the user.
    Site string
    The name of the site to associate the user with.
    SkipForgetOnDestroy bool
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    UserGroupId string
    The user group ID for the user.
    allowExisting Boolean
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    blocked Boolean
    Specifies whether this user should be blocked from the network.
    devIdOverride Integer
    Override the device fingerprint.
    fixedIp String
    A fixed IPv4 address for this user.
    hostname String
    The hostname of the user.
    ip String
    The IP address of the user.
    mac String
    The MAC address of the user.
    name String
    The name of the user.
    networkId String
    The network ID for this user.
    note String
    A note with additional information for the user.
    site String
    The name of the site to associate the user with.
    skipForgetOnDestroy Boolean
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    userGroupId String
    The user group ID for the user.
    allowExisting boolean
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    blocked boolean
    Specifies whether this user should be blocked from the network.
    devIdOverride number
    Override the device fingerprint.
    fixedIp string
    A fixed IPv4 address for this user.
    hostname string
    The hostname of the user.
    ip string
    The IP address of the user.
    mac string
    The MAC address of the user.
    name string
    The name of the user.
    networkId string
    The network ID for this user.
    note string
    A note with additional information for the user.
    site string
    The name of the site to associate the user with.
    skipForgetOnDestroy boolean
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    userGroupId string
    The user group ID for the user.
    allow_existing bool
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    blocked bool
    Specifies whether this user should be blocked from the network.
    dev_id_override int
    Override the device fingerprint.
    fixed_ip str
    A fixed IPv4 address for this user.
    hostname str
    The hostname of the user.
    ip str
    The IP address of the user.
    mac str
    The MAC address of the user.
    name str
    The name of the user.
    network_id str
    The network ID for this user.
    note str
    A note with additional information for the user.
    site str
    The name of the site to associate the user with.
    skip_forget_on_destroy bool
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    user_group_id str
    The user group ID for the user.
    allowExisting Boolean
    Specifies whether this resource should just take over control of an existing user. Defaults to true.
    blocked Boolean
    Specifies whether this user should be blocked from the network.
    devIdOverride Number
    Override the device fingerprint.
    fixedIp String
    A fixed IPv4 address for this user.
    hostname String
    The hostname of the user.
    ip String
    The IP address of the user.
    mac String
    The MAC address of the user.
    name String
    The name of the user.
    networkId String
    The network ID for this user.
    note String
    A note with additional information for the user.
    site String
    The name of the site to associate the user with.
    skipForgetOnDestroy Boolean
    Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
    userGroupId String
    The user group ID for the user.

    Package Details

    Repository
    unifi pulumiverse/pulumi-unifi
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the unifi Terraform Provider.
    unifi logo
    Unifi v0.0.3 published on Monday, Dec 5, 2022 by Pulumiverse