proxmoxve.Permission.Role
Explore with Pulumi AI
Manages a role.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
const operationsMonitoring = new proxmoxve.permission.Role("operationsMonitoring", {
privileges: ["VM.Monitor"],
roleId: "operations-monitoring",
});
import pulumi
import pulumi_proxmoxve as proxmoxve
operations_monitoring = proxmoxve.permission.Role("operationsMonitoring",
privileges=["VM.Monitor"],
role_id="operations-monitoring")
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 {
_, err := Permission.NewRole(ctx, "operationsMonitoring", &Permission.RoleArgs{
Privileges: pulumi.StringArray{
pulumi.String("VM.Monitor"),
},
RoleId: pulumi.String("operations-monitoring"),
})
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()
{
Privileges = new[]
{
"VM.Monitor",
},
RoleId = "operations-monitoring",
});
});
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 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()
.privileges("VM.Monitor")
.roleId("operations-monitoring")
.build());
}
}
resources:
operationsMonitoring:
type: proxmoxve:Permission:Role
properties:
privileges:
- VM.Monitor
roleId: operations-monitoring
Create Role Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Role(name: string, args: RoleArgs, opts?: CustomResourceOptions);
@overload
def Role(resource_name: str,
args: RoleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Role(resource_name: str,
opts: Optional[ResourceOptions] = None,
privileges: Optional[Sequence[str]] = None,
role_id: Optional[str] = None)
func NewRole(ctx *Context, name string, args RoleArgs, opts ...ResourceOption) (*Role, error)
public Role(string name, RoleArgs args, CustomResourceOptions? opts = null)
type: proxmoxve:Permission:Role
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 RoleArgs
- 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 RoleArgs
- 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 RoleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RoleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RoleArgs
- 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 roleResource = new ProxmoxVE.Permission.Role("roleResource", new()
{
Privileges = new[]
{
"string",
},
RoleId = "string",
});
example, err := Permission.NewRole(ctx, "roleResource", &Permission.RoleArgs{
Privileges: pulumi.StringArray{
pulumi.String("string"),
},
RoleId: pulumi.String("string"),
})
var roleResource = new Role("roleResource", RoleArgs.builder()
.privileges("string")
.roleId("string")
.build());
role_resource = proxmoxve.permission.Role("roleResource",
privileges=["string"],
role_id="string")
const roleResource = new proxmoxve.permission.Role("roleResource", {
privileges: ["string"],
roleId: "string",
});
type: proxmoxve:Permission:Role
properties:
privileges:
- string
roleId: string
Role 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 Role resource accepts the following input properties:
- Privileges List<string>
- The role privileges.
- Role
Id string - The role identifier.
- Privileges []string
- The role privileges.
- Role
Id string - The role identifier.
- privileges List<String>
- The role privileges.
- role
Id String - The role identifier.
- privileges string[]
- The role privileges.
- role
Id string - The role identifier.
- privileges Sequence[str]
- The role privileges.
- role_
id str - The role identifier.
- privileges List<String>
- The role privileges.
- role
Id String - The role identifier.
Outputs
All input properties are implicitly available as output properties. Additionally, the Role 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 Role Resource
Get an existing Role 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?: RoleState, opts?: CustomResourceOptions): Role
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
privileges: Optional[Sequence[str]] = None,
role_id: Optional[str] = None) -> Role
func GetRole(ctx *Context, name string, id IDInput, state *RoleState, opts ...ResourceOption) (*Role, error)
public static Role Get(string name, Input<string> id, RoleState? state, CustomResourceOptions? opts = null)
public static Role get(String name, Output<String> id, RoleState 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.
- Privileges List<string>
- The role privileges.
- Role
Id string - The role identifier.
- Privileges []string
- The role privileges.
- Role
Id string - The role identifier.
- privileges List<String>
- The role privileges.
- role
Id String - The role identifier.
- privileges string[]
- The role privileges.
- role
Id string - The role identifier.
- privileges Sequence[str]
- The role privileges.
- role_
id str - The role identifier.
- privileges List<String>
- The role privileges.
- role
Id String - The role identifier.
Import
Instances can be imported using the role_id
, e.g.,
bash
$ pulumi import proxmoxve:Permission/role:Role operations_monitoring 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.