unifi.iam.User
Explore with Pulumi AI
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
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",
    name: "some client",
    note: "my note",
    fixedIp: "10.0.0.50",
    networkId: myVlan.id,
});
import pulumi
import pulumiverse_unifi as unifi
test = unifi.iam.User("test",
    mac="01:23:45:67:89:AB",
    name="some client",
    note="my note",
    fixed_ip="10.0.0.50",
    network_id=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"),
			Name:      pulumi.String("some client"),
			Note:      pulumi.String("my note"),
			FixedIp:   pulumi.String("10.0.0.50"),
			NetworkId: pulumi.Any(myVlan.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
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",
        Name = "some client",
        Note = "my note",
        FixedIp = "10.0.0.50",
        NetworkId = myVlan.Id,
    });
});
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")
            .name("some client")
            .note("my note")
            .fixedIp("10.0.0.50")
            .networkId(myVlan.id())
            .build());
    }
}
resources:
  test:
    type: unifi:iam:User
    properties:
      mac: 01:23:45:67:89:AB
      name: some client
      note: my note
      fixedIp: 10.0.0.50
      networkId: ${myVlan.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,
         local_dns_record: 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)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",
    LocalDnsRecord = "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"),
	LocalDnsRecord:      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")
    .localDnsRecord("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",
    local_dns_record="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",
    localDnsRecord: "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
    localDnsRecord: 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
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:
- 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.
- DevId intOverride 
- Override the device fingerprint.
- FixedIp string
- A fixed IPv4 address for this user.
- LocalDns stringRecord 
- Specifies the local DNS record 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.
- SkipForget boolOn Destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- UserGroup stringId 
- 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.
- DevId intOverride 
- Override the device fingerprint.
- FixedIp string
- A fixed IPv4 address for this user.
- LocalDns stringRecord 
- Specifies the local DNS record 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.
- SkipForget boolOn Destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- UserGroup stringId 
- 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.
- devId IntegerOverride 
- Override the device fingerprint.
- fixedIp String
- A fixed IPv4 address for this user.
- localDns StringRecord 
- Specifies the local DNS record 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.
- skipForget BooleanOn Destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- userGroup StringId 
- 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.
- devId numberOverride 
- Override the device fingerprint.
- fixedIp string
- A fixed IPv4 address for this user.
- localDns stringRecord 
- Specifies the local DNS record 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.
- skipForget booleanOn Destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- userGroup stringId 
- 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_ intoverride 
- Override the device fingerprint.
- fixed_ip str
- A fixed IPv4 address for this user.
- local_dns_ strrecord 
- Specifies the local DNS record 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_ boolon_ destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- user_group_ strid 
- 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.
- devId NumberOverride 
- Override the device fingerprint.
- fixedIp String
- A fixed IPv4 address for this user.
- localDns StringRecord 
- Specifies the local DNS record 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.
- skipForget BooleanOn Destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- userGroup StringId 
- 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:
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,
        local_dns_record: 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) -> Userfunc 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: unifi:iam: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.
- 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.
- DevId intOverride 
- 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.
- LocalDns stringRecord 
- Specifies the local DNS record for this 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.
- SkipForget boolOn Destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- UserGroup stringId 
- 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.
- DevId intOverride 
- 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.
- LocalDns stringRecord 
- Specifies the local DNS record for this 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.
- SkipForget boolOn Destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- UserGroup stringId 
- 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.
- devId IntegerOverride 
- 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.
- localDns StringRecord 
- Specifies the local DNS record for this 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.
- skipForget BooleanOn Destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- userGroup StringId 
- 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.
- devId numberOverride 
- 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.
- localDns stringRecord 
- Specifies the local DNS record for this 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.
- skipForget booleanOn Destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- userGroup stringId 
- 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_ intoverride 
- 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.
- local_dns_ strrecord 
- Specifies the local DNS record for this 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_ boolon_ destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- user_group_ strid 
- 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.
- devId NumberOverride 
- 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.
- localDns StringRecord 
- Specifies the local DNS record for this 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.
- skipForget BooleanOn Destroy 
- Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to false.
- userGroup StringId 
- 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 unifiTerraform Provider.