proxmoxve.Permission.User
Explore with Pulumi AI
Manages a user.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
const operationsMonitoring = new proxmoxve.permission.Role("operationsMonitoring", {
roleId: "operations-monitoring",
privileges: ["VM.Monitor"],
});
const operationsAutomation = new proxmoxve.permission.User("operationsAutomation", {
acls: [{
path: "/vms/1234",
propagate: true,
roleId: operationsMonitoring.roleId,
}],
comment: "Managed by Terraform",
password: "a-strong-password",
userId: "operations-automation@pve",
});
import pulumi
import pulumi_proxmoxve as proxmoxve
operations_monitoring = proxmoxve.permission.Role("operationsMonitoring",
role_id="operations-monitoring",
privileges=["VM.Monitor"])
operations_automation = proxmoxve.permission.User("operationsAutomation",
acls=[{
"path": "/vms/1234",
"propagate": True,
"role_id": operations_monitoring.role_id,
}],
comment="Managed by Terraform",
password="a-strong-password",
user_id="operations-automation@pve")
package main
import (
"github.com/muhlba91/pulumi-proxmoxve/sdk/v6/go/proxmoxve/Permission"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
operationsMonitoring, err := Permission.NewRole(ctx, "operationsMonitoring", &Permission.RoleArgs{
RoleId: pulumi.String("operations-monitoring"),
Privileges: pulumi.StringArray{
pulumi.String("VM.Monitor"),
},
})
if err != nil {
return err
}
_, err = Permission.NewUser(ctx, "operationsAutomation", &Permission.UserArgs{
Acls: permission.UserAclArray{
&permission.UserAclArgs{
Path: pulumi.String("/vms/1234"),
Propagate: pulumi.Bool(true),
RoleId: operationsMonitoring.RoleId,
},
},
Comment: pulumi.String("Managed by Terraform"),
Password: pulumi.String("a-strong-password"),
UserId: pulumi.String("operations-automation@pve"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ProxmoxVE = Pulumi.ProxmoxVE;
return await Deployment.RunAsync(() =>
{
var operationsMonitoring = new ProxmoxVE.Permission.Role("operationsMonitoring", new()
{
RoleId = "operations-monitoring",
Privileges = new[]
{
"VM.Monitor",
},
});
var operationsAutomation = new ProxmoxVE.Permission.User("operationsAutomation", new()
{
Acls = new[]
{
new ProxmoxVE.Permission.Inputs.UserAclArgs
{
Path = "/vms/1234",
Propagate = true,
RoleId = operationsMonitoring.RoleId,
},
},
Comment = "Managed by Terraform",
Password = "a-strong-password",
UserId = "operations-automation@pve",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.proxmoxve.Permission.Role;
import com.pulumi.proxmoxve.Permission.RoleArgs;
import com.pulumi.proxmoxve.Permission.User;
import com.pulumi.proxmoxve.Permission.UserArgs;
import com.pulumi.proxmoxve.Permission.inputs.UserAclArgs;
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 operationsMonitoring = new Role("operationsMonitoring", RoleArgs.builder()
.roleId("operations-monitoring")
.privileges("VM.Monitor")
.build());
var operationsAutomation = new User("operationsAutomation", UserArgs.builder()
.acls(UserAclArgs.builder()
.path("/vms/1234")
.propagate(true)
.roleId(operationsMonitoring.roleId())
.build())
.comment("Managed by Terraform")
.password("a-strong-password")
.userId("operations-automation@pve")
.build());
}
}
resources:
operationsAutomation:
type: proxmoxve:Permission:User
properties:
acls:
- path: /vms/1234
propagate: true
roleId: ${operationsMonitoring.roleId}
comment: Managed by Terraform
password: a-strong-password
userId: operations-automation@pve
operationsMonitoring:
type: proxmoxve:Permission:Role
properties:
roleId: operations-monitoring
privileges:
- VM.Monitor
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,
user_id: Optional[str] = None,
acls: Optional[Sequence[_permission.UserAclArgs]] = None,
comment: Optional[str] = None,
email: Optional[str] = None,
enabled: Optional[bool] = None,
expiration_date: Optional[str] = None,
first_name: Optional[str] = None,
groups: Optional[Sequence[str]] = None,
keys: Optional[str] = None,
last_name: Optional[str] = None,
password: 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: proxmoxve:Permission: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 ProxmoxVE.Permission.User("userResource", new()
{
UserId = "string",
Acls = new[]
{
new ProxmoxVE.Permission.Inputs.UserAclArgs
{
Path = "string",
RoleId = "string",
Propagate = false,
},
},
Comment = "string",
Email = "string",
Enabled = false,
ExpirationDate = "string",
FirstName = "string",
Groups = new[]
{
"string",
},
Keys = "string",
LastName = "string",
Password = "string",
});
example, err := Permission.NewUser(ctx, "userResource", &Permission.UserArgs{
UserId: pulumi.String("string"),
Acls: permission.UserAclArray{
&permission.UserAclArgs{
Path: pulumi.String("string"),
RoleId: pulumi.String("string"),
Propagate: pulumi.Bool(false),
},
},
Comment: pulumi.String("string"),
Email: pulumi.String("string"),
Enabled: pulumi.Bool(false),
ExpirationDate: pulumi.String("string"),
FirstName: pulumi.String("string"),
Groups: pulumi.StringArray{
pulumi.String("string"),
},
Keys: pulumi.String("string"),
LastName: pulumi.String("string"),
Password: pulumi.String("string"),
})
var userResource = new User("userResource", UserArgs.builder()
.userId("string")
.acls(UserAclArgs.builder()
.path("string")
.roleId("string")
.propagate(false)
.build())
.comment("string")
.email("string")
.enabled(false)
.expirationDate("string")
.firstName("string")
.groups("string")
.keys("string")
.lastName("string")
.password("string")
.build());
user_resource = proxmoxve.permission.User("userResource",
user_id="string",
acls=[proxmoxve.permission.UserAclArgs(
path="string",
role_id="string",
propagate=False,
)],
comment="string",
email="string",
enabled=False,
expiration_date="string",
first_name="string",
groups=["string"],
keys="string",
last_name="string",
password="string")
const userResource = new proxmoxve.permission.User("userResource", {
userId: "string",
acls: [{
path: "string",
roleId: "string",
propagate: false,
}],
comment: "string",
email: "string",
enabled: false,
expirationDate: "string",
firstName: "string",
groups: ["string"],
keys: "string",
lastName: "string",
password: "string",
});
type: proxmoxve:Permission:User
properties:
acls:
- path: string
propagate: false
roleId: string
comment: string
email: string
enabled: false
expirationDate: string
firstName: string
groups:
- string
keys: string
lastName: string
password: string
userId: 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:
- User
Id string - The user identifier.
- Acls
List<Pulumi.
Proxmox VE. Permission. Inputs. User Acl> - The access control list (multiple blocks supported).
- Comment string
- The user comment.
- Email string
- The user's email address.
- Enabled bool
- Whether the user account is enabled.
- Expiration
Date string - The user account's expiration date (RFC 3339).
- First
Name string - The user's first name.
- Groups List<string>
- The user's groups.
- Keys string
- The user's keys.
- Last
Name string - The user's last name.
- Password string
- The user's password. Required for PVE or PAM realms.
- User
Id string - The user identifier.
- Acls
[]User
Acl Args - The access control list (multiple blocks supported).
- Comment string
- The user comment.
- Email string
- The user's email address.
- Enabled bool
- Whether the user account is enabled.
- Expiration
Date string - The user account's expiration date (RFC 3339).
- First
Name string - The user's first name.
- Groups []string
- The user's groups.
- Keys string
- The user's keys.
- Last
Name string - The user's last name.
- Password string
- The user's password. Required for PVE or PAM realms.
- user
Id String - The user identifier.
- acls
List<User
Acl> - The access control list (multiple blocks supported).
- comment String
- The user comment.
- email String
- The user's email address.
- enabled Boolean
- Whether the user account is enabled.
- expiration
Date String - The user account's expiration date (RFC 3339).
- first
Name String - The user's first name.
- groups List<String>
- The user's groups.
- keys String
- The user's keys.
- last
Name String - The user's last name.
- password String
- The user's password. Required for PVE or PAM realms.
- user
Id string - The user identifier.
- acls
User
Acl[] - The access control list (multiple blocks supported).
- comment string
- The user comment.
- email string
- The user's email address.
- enabled boolean
- Whether the user account is enabled.
- expiration
Date string - The user account's expiration date (RFC 3339).
- first
Name string - The user's first name.
- groups string[]
- The user's groups.
- keys string
- The user's keys.
- last
Name string - The user's last name.
- password string
- The user's password. Required for PVE or PAM realms.
- user_
id str - The user identifier.
- acls
Sequence[permission.
User Acl Args] - The access control list (multiple blocks supported).
- comment str
- The user comment.
- email str
- The user's email address.
- enabled bool
- Whether the user account is enabled.
- expiration_
date str - The user account's expiration date (RFC 3339).
- first_
name str - The user's first name.
- groups Sequence[str]
- The user's groups.
- keys str
- The user's keys.
- last_
name str - The user's last name.
- password str
- The user's password. Required for PVE or PAM realms.
- user
Id String - The user identifier.
- acls List<Property Map>
- The access control list (multiple blocks supported).
- comment String
- The user comment.
- email String
- The user's email address.
- enabled Boolean
- Whether the user account is enabled.
- expiration
Date String - The user account's expiration date (RFC 3339).
- first
Name String - The user's first name.
- groups List<String>
- The user's groups.
- keys String
- The user's keys.
- last
Name String - The user's last name.
- password String
- The user's password. Required for PVE or PAM realms.
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,
acls: Optional[Sequence[_permission.UserAclArgs]] = None,
comment: Optional[str] = None,
email: Optional[str] = None,
enabled: Optional[bool] = None,
expiration_date: Optional[str] = None,
first_name: Optional[str] = None,
groups: Optional[Sequence[str]] = None,
keys: Optional[str] = None,
last_name: Optional[str] = None,
password: Optional[str] = None,
user_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.
- Acls
List<Pulumi.
Proxmox VE. Permission. Inputs. User Acl> - The access control list (multiple blocks supported).
- Comment string
- The user comment.
- Email string
- The user's email address.
- Enabled bool
- Whether the user account is enabled.
- Expiration
Date string - The user account's expiration date (RFC 3339).
- First
Name string - The user's first name.
- Groups List<string>
- The user's groups.
- Keys string
- The user's keys.
- Last
Name string - The user's last name.
- Password string
- The user's password. Required for PVE or PAM realms.
- User
Id string - The user identifier.
- Acls
[]User
Acl Args - The access control list (multiple blocks supported).
- Comment string
- The user comment.
- Email string
- The user's email address.
- Enabled bool
- Whether the user account is enabled.
- Expiration
Date string - The user account's expiration date (RFC 3339).
- First
Name string - The user's first name.
- Groups []string
- The user's groups.
- Keys string
- The user's keys.
- Last
Name string - The user's last name.
- Password string
- The user's password. Required for PVE or PAM realms.
- User
Id string - The user identifier.
- acls
List<User
Acl> - The access control list (multiple blocks supported).
- comment String
- The user comment.
- email String
- The user's email address.
- enabled Boolean
- Whether the user account is enabled.
- expiration
Date String - The user account's expiration date (RFC 3339).
- first
Name String - The user's first name.
- groups List<String>
- The user's groups.
- keys String
- The user's keys.
- last
Name String - The user's last name.
- password String
- The user's password. Required for PVE or PAM realms.
- user
Id String - The user identifier.
- acls
User
Acl[] - The access control list (multiple blocks supported).
- comment string
- The user comment.
- email string
- The user's email address.
- enabled boolean
- Whether the user account is enabled.
- expiration
Date string - The user account's expiration date (RFC 3339).
- first
Name string - The user's first name.
- groups string[]
- The user's groups.
- keys string
- The user's keys.
- last
Name string - The user's last name.
- password string
- The user's password. Required for PVE or PAM realms.
- user
Id string - The user identifier.
- acls
Sequence[permission.
User Acl Args] - The access control list (multiple blocks supported).
- comment str
- The user comment.
- email str
- The user's email address.
- enabled bool
- Whether the user account is enabled.
- expiration_
date str - The user account's expiration date (RFC 3339).
- first_
name str - The user's first name.
- groups Sequence[str]
- The user's groups.
- keys str
- The user's keys.
- last_
name str - The user's last name.
- password str
- The user's password. Required for PVE or PAM realms.
- user_
id str - The user identifier.
- acls List<Property Map>
- The access control list (multiple blocks supported).
- comment String
- The user comment.
- email String
- The user's email address.
- enabled Boolean
- Whether the user account is enabled.
- expiration
Date String - The user account's expiration date (RFC 3339).
- first
Name String - The user's first name.
- groups List<String>
- The user's groups.
- keys String
- The user's keys.
- last
Name String - The user's last name.
- password String
- The user's password. Required for PVE or PAM realms.
- user
Id String - The user identifier.
Supporting Types
UserAcl, UserAclArgs
Import
Instances can be imported using the user_id
, e.g.,
bash
$ pulumi import proxmoxve:Permission/user:User operations_automation operations-automation@pve
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- proxmoxve muhlba91/pulumi-proxmoxve
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
proxmox
Terraform Provider.