proxmoxve.Acl
Explore with Pulumi AI
Manages ACLs on the Proxmox cluster.
ACLs are used to control access to resources in the Proxmox cluster. Each ACL consists of a path, a user, group or token, a role, and a flag to allow propagation of permissions.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
const operationsAutomation = new proxmoxve.permission.User("operationsAutomation", {
comment: "Managed by Terraform",
password: "a-strong-password",
userId: "operations-automation@pve",
});
const operationsMonitoring = new proxmoxve.permission.Role("operationsMonitoring", {
roleId: "operations-monitoring",
privileges: ["VM.Monitor"],
});
const operationsAutomationMonitoring = new proxmoxve.Acl("operationsAutomationMonitoring", {
userId: operationsAutomation.userId,
roleId: operationsMonitoring.roleId,
path: "/vms/1234",
propagate: true,
});
import pulumi
import pulumi_proxmoxve as proxmoxve
operations_automation = proxmoxve.permission.User("operationsAutomation",
comment="Managed by Terraform",
password="a-strong-password",
user_id="operations-automation@pve")
operations_monitoring = proxmoxve.permission.Role("operationsMonitoring",
role_id="operations-monitoring",
privileges=["VM.Monitor"])
operations_automation_monitoring = proxmoxve.Acl("operationsAutomationMonitoring",
user_id=operations_automation.user_id,
role_id=operations_monitoring.role_id,
path="/vms/1234",
propagate=True)
package main
import (
"github.com/muhlba91/pulumi-proxmoxve/sdk/v6/go/proxmoxve"
"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 {
operationsAutomation, err := Permission.NewUser(ctx, "operationsAutomation", &Permission.UserArgs{
Comment: pulumi.String("Managed by Terraform"),
Password: pulumi.String("a-strong-password"),
UserId: pulumi.String("operations-automation@pve"),
})
if err != nil {
return err
}
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 = proxmoxve.NewAcl(ctx, "operationsAutomationMonitoring", &proxmoxve.AclArgs{
UserId: operationsAutomation.UserId,
RoleId: operationsMonitoring.RoleId,
Path: pulumi.String("/vms/1234"),
Propagate: pulumi.Bool(true),
})
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 operationsAutomation = new ProxmoxVE.Permission.User("operationsAutomation", new()
{
Comment = "Managed by Terraform",
Password = "a-strong-password",
UserId = "operations-automation@pve",
});
var operationsMonitoring = new ProxmoxVE.Permission.Role("operationsMonitoring", new()
{
RoleId = "operations-monitoring",
Privileges = new[]
{
"VM.Monitor",
},
});
var operationsAutomationMonitoring = new ProxmoxVE.Acl("operationsAutomationMonitoring", new()
{
UserId = operationsAutomation.UserId,
RoleId = operationsMonitoring.RoleId,
Path = "/vms/1234",
Propagate = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.proxmoxve.Permission.User;
import com.pulumi.proxmoxve.Permission.UserArgs;
import com.pulumi.proxmoxve.Permission.Role;
import com.pulumi.proxmoxve.Permission.RoleArgs;
import com.pulumi.proxmoxve.Acl;
import com.pulumi.proxmoxve.AclArgs;
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 operationsAutomation = new User("operationsAutomation", UserArgs.builder()
.comment("Managed by Terraform")
.password("a-strong-password")
.userId("operations-automation@pve")
.build());
var operationsMonitoring = new Role("operationsMonitoring", RoleArgs.builder()
.roleId("operations-monitoring")
.privileges("VM.Monitor")
.build());
var operationsAutomationMonitoring = new Acl("operationsAutomationMonitoring", AclArgs.builder()
.userId(operationsAutomation.userId())
.roleId(operationsMonitoring.roleId())
.path("/vms/1234")
.propagate(true)
.build());
}
}
resources:
operationsAutomation:
type: proxmoxve:Permission:User
properties:
comment: Managed by Terraform
password: a-strong-password
userId: operations-automation@pve
operationsMonitoring:
type: proxmoxve:Permission:Role
properties:
roleId: operations-monitoring
privileges:
- VM.Monitor
operationsAutomationMonitoring:
type: proxmoxve:Acl
properties:
userId: ${operationsAutomation.userId}
roleId: ${operationsMonitoring.roleId}
path: /vms/1234
propagate: true
Create Acl Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Acl(name: string, args: AclArgs, opts?: CustomResourceOptions);
@overload
def Acl(resource_name: str,
args: AclArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Acl(resource_name: str,
opts: Optional[ResourceOptions] = None,
path: Optional[str] = None,
role_id: Optional[str] = None,
group_id: Optional[str] = None,
propagate: Optional[bool] = None,
token_id: Optional[str] = None,
user_id: Optional[str] = None)
func NewAcl(ctx *Context, name string, args AclArgs, opts ...ResourceOption) (*Acl, error)
public Acl(string name, AclArgs args, CustomResourceOptions? opts = null)
type: proxmoxve:Acl
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 AclArgs
- 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 AclArgs
- 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 AclArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AclArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AclArgs
- 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 aclResource = new ProxmoxVE.Acl("aclResource", new()
{
Path = "string",
RoleId = "string",
GroupId = "string",
Propagate = false,
TokenId = "string",
UserId = "string",
});
example, err := proxmoxve.NewAcl(ctx, "aclResource", &proxmoxve.AclArgs{
Path: pulumi.String("string"),
RoleId: pulumi.String("string"),
GroupId: pulumi.String("string"),
Propagate: pulumi.Bool(false),
TokenId: pulumi.String("string"),
UserId: pulumi.String("string"),
})
var aclResource = new Acl("aclResource", AclArgs.builder()
.path("string")
.roleId("string")
.groupId("string")
.propagate(false)
.tokenId("string")
.userId("string")
.build());
acl_resource = proxmoxve.Acl("aclResource",
path="string",
role_id="string",
group_id="string",
propagate=False,
token_id="string",
user_id="string")
const aclResource = new proxmoxve.Acl("aclResource", {
path: "string",
roleId: "string",
groupId: "string",
propagate: false,
tokenId: "string",
userId: "string",
});
type: proxmoxve:Acl
properties:
groupId: string
path: string
propagate: false
roleId: string
tokenId: string
userId: string
Acl 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 Acl resource accepts the following input properties:
- Path string
- Access control path
- Role
Id string - The role to apply
- Group
Id string - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - Propagate bool
- Allow to propagate (inherit) permissions.
- Token
Id string - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - User
Id string - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
- Path string
- Access control path
- Role
Id string - The role to apply
- Group
Id string - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - Propagate bool
- Allow to propagate (inherit) permissions.
- Token
Id string - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - User
Id string - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
- path String
- Access control path
- role
Id String - The role to apply
- group
Id String - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - propagate Boolean
- Allow to propagate (inherit) permissions.
- token
Id String - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - user
Id String - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
- path string
- Access control path
- role
Id string - The role to apply
- group
Id string - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - propagate boolean
- Allow to propagate (inherit) permissions.
- token
Id string - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - user
Id string - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
- path str
- Access control path
- role_
id str - The role to apply
- group_
id str - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - propagate bool
- Allow to propagate (inherit) permissions.
- token_
id str - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - user_
id str - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
- path String
- Access control path
- role
Id String - The role to apply
- group
Id String - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - propagate Boolean
- Allow to propagate (inherit) permissions.
- token
Id String - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - user
Id String - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
Outputs
All input properties are implicitly available as output properties. Additionally, the Acl 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 Acl Resource
Get an existing Acl 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?: AclState, opts?: CustomResourceOptions): Acl
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
group_id: Optional[str] = None,
path: Optional[str] = None,
propagate: Optional[bool] = None,
role_id: Optional[str] = None,
token_id: Optional[str] = None,
user_id: Optional[str] = None) -> Acl
func GetAcl(ctx *Context, name string, id IDInput, state *AclState, opts ...ResourceOption) (*Acl, error)
public static Acl Get(string name, Input<string> id, AclState? state, CustomResourceOptions? opts = null)
public static Acl get(String name, Output<String> id, AclState 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.
- Group
Id string - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - Path string
- Access control path
- Propagate bool
- Allow to propagate (inherit) permissions.
- Role
Id string - The role to apply
- Token
Id string - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - User
Id string - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
- Group
Id string - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - Path string
- Access control path
- Propagate bool
- Allow to propagate (inherit) permissions.
- Role
Id string - The role to apply
- Token
Id string - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - User
Id string - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
- group
Id String - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - path String
- Access control path
- propagate Boolean
- Allow to propagate (inherit) permissions.
- role
Id String - The role to apply
- token
Id String - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - user
Id String - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
- group
Id string - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - path string
- Access control path
- propagate boolean
- Allow to propagate (inherit) permissions.
- role
Id string - The role to apply
- token
Id string - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - user
Id string - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
- group_
id str - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - path str
- Access control path
- propagate bool
- Allow to propagate (inherit) permissions.
- role_
id str - The role to apply
- token_
id str - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - user_
id str - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
- group
Id String - The group the ACL should apply to (mutually exclusive with
token_id
anduser_id
) - path String
- Access control path
- propagate Boolean
- Allow to propagate (inherit) permissions.
- role
Id String - The role to apply
- token
Id String - The token the ACL should apply to (mutually exclusive with
group_id
anduser_id
) - user
Id String - The user the ACL should apply to (mutually exclusive with
group_id
andtoken_id
)
Import
#!/usr/bin/env sh
ACL can be imported using its unique identifier, e.g.: {path}?{group|user@realm|user@realm!token}?{role}
$ pulumi import proxmoxve:index/acl:Acl operations_automation_monitoring /?monitor@pve?operations-monitoring
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.