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
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)
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.
- 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 string - A fixed IPv4 address for this user.
- Name string
- The name of the user.
- Network
Id 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.
- Skip
Forget boolOn Destroy - Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to
false
. - User
Group stringId - The user group ID for the user.
- Mac string
- 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 string - A fixed IPv4 address for this user.
- Name string
- The name of the user.
- Network
Id 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.
- Skip
Forget boolOn Destroy - Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to
false
. - User
Group stringId - The user group ID for the user.
- mac String
- The MAC address of the user.
- allow
Existing 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.
- dev
Id IntegerOverride - Override the device fingerprint.
- fixed
Ip String - A fixed IPv4 address for this user.
- name String
- The name of the user.
- network
Id 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.
- skip
Forget BooleanOn Destroy - Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to
false
. - user
Group StringId - The user group ID for the user.
- mac string
- The MAC address of the user.
- allow
Existing 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.
- dev
Id numberOverride - Override the device fingerprint.
- fixed
Ip string - A fixed IPv4 address for this user.
- name string
- The name of the user.
- network
Id 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.
- skip
Forget booleanOn Destroy - Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to
false
. - user
Group 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.
- 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.
- allow
Existing 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.
- dev
Id NumberOverride - Override the device fingerprint.
- fixed
Ip String - A fixed IPv4 address for this user.
- name String
- The name of the user.
- network
Id 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.
- skip
Forget BooleanOn Destroy - Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to
false
. - user
Group 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,
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.
- 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 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.
- Network
Id 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.
- Skip
Forget boolOn Destroy - Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to
false
. - User
Group 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 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.
- Network
Id 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.
- Skip
Forget boolOn Destroy - Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to
false
. - User
Group stringId - The user group ID for the user.
- allow
Existing 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.
- dev
Id IntegerOverride - Override the device fingerprint.
- fixed
Ip 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.
- network
Id 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.
- skip
Forget BooleanOn Destroy - Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to
false
. - user
Group StringId - The user group ID for the user.
- allow
Existing 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.
- dev
Id numberOverride - Override the device fingerprint.
- fixed
Ip 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.
- network
Id 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.
- skip
Forget booleanOn Destroy - Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to
false
. - user
Group 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.
- 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.
- allow
Existing 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.
- dev
Id NumberOverride - Override the device fingerprint.
- fixed
Ip 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.
- network
Id 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.
- skip
Forget BooleanOn Destroy - Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to
false
. - user
Group 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
unifi
Terraform Provider.