nutanix.Role
Explore with Pulumi AI
Provides a resource to create a role based on the input parameters.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as nutanix from "@pierskarsenbarg/nutanix";
const test = new nutanix.Role("test", {
description: "DESCRIPTION",
permissionReferenceLists: [
{
kind: "permission",
uuid: "ID OF PERMISSION",
},
{
kind: "permission",
uuid: "ID OF PERMISSION",
},
{
kind: "permission",
uuid: "ID OF PERMISSION",
},
],
});
import pulumi
import pulumi_nutanix as nutanix
test = nutanix.Role("test",
description="DESCRIPTION",
permission_reference_lists=[
{
"kind": "permission",
"uuid": "ID OF PERMISSION",
},
{
"kind": "permission",
"uuid": "ID OF PERMISSION",
},
{
"kind": "permission",
"uuid": "ID OF PERMISSION",
},
])
package main
import (
"github.com/pierskarsenbarg/pulumi-nutanix/sdk/go/nutanix"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := nutanix.NewRole(ctx, "test", &nutanix.RoleArgs{
Description: pulumi.String("DESCRIPTION"),
PermissionReferenceLists: nutanix.RolePermissionReferenceListArray{
&nutanix.RolePermissionReferenceListArgs{
Kind: pulumi.String("permission"),
Uuid: pulumi.String("ID OF PERMISSION"),
},
&nutanix.RolePermissionReferenceListArgs{
Kind: pulumi.String("permission"),
Uuid: pulumi.String("ID OF PERMISSION"),
},
&nutanix.RolePermissionReferenceListArgs{
Kind: pulumi.String("permission"),
Uuid: pulumi.String("ID OF PERMISSION"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nutanix = PiersKarsenbarg.Nutanix;
return await Deployment.RunAsync(() =>
{
var test = new Nutanix.Role("test", new()
{
Description = "DESCRIPTION",
PermissionReferenceLists = new[]
{
new Nutanix.Inputs.RolePermissionReferenceListArgs
{
Kind = "permission",
Uuid = "ID OF PERMISSION",
},
new Nutanix.Inputs.RolePermissionReferenceListArgs
{
Kind = "permission",
Uuid = "ID OF PERMISSION",
},
new Nutanix.Inputs.RolePermissionReferenceListArgs
{
Kind = "permission",
Uuid = "ID OF PERMISSION",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nutanix.Role;
import com.pulumi.nutanix.RoleArgs;
import com.pulumi.nutanix.inputs.RolePermissionReferenceListArgs;
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 Role("test", RoleArgs.builder()
.description("DESCRIPTION")
.permissionReferenceLists(
RolePermissionReferenceListArgs.builder()
.kind("permission")
.uuid("ID OF PERMISSION")
.build(),
RolePermissionReferenceListArgs.builder()
.kind("permission")
.uuid("ID OF PERMISSION")
.build(),
RolePermissionReferenceListArgs.builder()
.kind("permission")
.uuid("ID OF PERMISSION")
.build())
.build());
}
}
resources:
test:
type: nutanix:Role
properties:
description: DESCRIPTION
permissionReferenceLists:
- kind: permission
uuid: ID OF PERMISSION
- kind: permission
uuid: ID OF PERMISSION
- kind: permission
uuid: ID OF PERMISSION
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,
permission_reference_lists: Optional[Sequence[RolePermissionReferenceListArgs]] = None,
categories: Optional[Sequence[RoleCategoryArgs]] = None,
description: Optional[str] = None,
name: Optional[str] = None,
owner_reference: Optional[RoleOwnerReferenceArgs] = None,
project_reference: Optional[RoleProjectReferenceArgs] = None)
func NewRole(ctx *Context, name string, args RoleArgs, opts ...ResourceOption) (*Role, error)
public Role(string name, RoleArgs args, CustomResourceOptions? opts = null)
type: nutanix: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 Nutanix.Role("roleResource", new()
{
PermissionReferenceLists = new[]
{
new Nutanix.Inputs.RolePermissionReferenceListArgs
{
Uuid = "string",
Kind = "string",
Name = "string",
},
},
Categories = new[]
{
new Nutanix.Inputs.RoleCategoryArgs
{
Name = "string",
Value = "string",
},
},
Description = "string",
Name = "string",
OwnerReference = new Nutanix.Inputs.RoleOwnerReferenceArgs
{
Kind = "string",
Name = "string",
Uuid = "string",
},
ProjectReference = new Nutanix.Inputs.RoleProjectReferenceArgs
{
Kind = "string",
Name = "string",
Uuid = "string",
},
});
example, err := nutanix.NewRole(ctx, "roleResource", &nutanix.RoleArgs{
PermissionReferenceLists: nutanix.RolePermissionReferenceListArray{
&nutanix.RolePermissionReferenceListArgs{
Uuid: pulumi.String("string"),
Kind: pulumi.String("string"),
Name: pulumi.String("string"),
},
},
Categories: nutanix.RoleCategoryArray{
&nutanix.RoleCategoryArgs{
Name: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
Description: pulumi.String("string"),
Name: pulumi.String("string"),
OwnerReference: &nutanix.RoleOwnerReferenceArgs{
Kind: pulumi.String("string"),
Name: pulumi.String("string"),
Uuid: pulumi.String("string"),
},
ProjectReference: &nutanix.RoleProjectReferenceArgs{
Kind: pulumi.String("string"),
Name: pulumi.String("string"),
Uuid: pulumi.String("string"),
},
})
var roleResource = new Role("roleResource", RoleArgs.builder()
.permissionReferenceLists(RolePermissionReferenceListArgs.builder()
.uuid("string")
.kind("string")
.name("string")
.build())
.categories(RoleCategoryArgs.builder()
.name("string")
.value("string")
.build())
.description("string")
.name("string")
.ownerReference(RoleOwnerReferenceArgs.builder()
.kind("string")
.name("string")
.uuid("string")
.build())
.projectReference(RoleProjectReferenceArgs.builder()
.kind("string")
.name("string")
.uuid("string")
.build())
.build());
role_resource = nutanix.Role("roleResource",
permission_reference_lists=[{
"uuid": "string",
"kind": "string",
"name": "string",
}],
categories=[{
"name": "string",
"value": "string",
}],
description="string",
name="string",
owner_reference={
"kind": "string",
"name": "string",
"uuid": "string",
},
project_reference={
"kind": "string",
"name": "string",
"uuid": "string",
})
const roleResource = new nutanix.Role("roleResource", {
permissionReferenceLists: [{
uuid: "string",
kind: "string",
name: "string",
}],
categories: [{
name: "string",
value: "string",
}],
description: "string",
name: "string",
ownerReference: {
kind: "string",
name: "string",
uuid: "string",
},
projectReference: {
kind: "string",
name: "string",
uuid: "string",
},
});
type: nutanix:Role
properties:
categories:
- name: string
value: string
description: string
name: string
ownerReference:
kind: string
name: string
uuid: string
permissionReferenceLists:
- kind: string
name: string
uuid: string
projectReference:
kind: string
name: string
uuid: 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:
- Permission
Reference List<PiersLists Karsenbarg. Nutanix. Inputs. Role Permission Reference List> - (Required) List of permission references.
- Categories
List<Piers
Karsenbarg. Nutanix. Inputs. Role Category> - (Optional) Categories for the role.
- Description string
- (Optional) The description of the role.
- Name string
- (Optional) Name of the role.
- Owner
Reference PiersKarsenbarg. Nutanix. Inputs. Role Owner Reference - (Optional) The reference to a user.
- Project
Reference PiersKarsenbarg. Nutanix. Inputs. Role Project Reference - (Optional) The reference to a project.
- Permission
Reference []RoleLists Permission Reference List Args - (Required) List of permission references.
- Categories
[]Role
Category Args - (Optional) Categories for the role.
- Description string
- (Optional) The description of the role.
- Name string
- (Optional) Name of the role.
- Owner
Reference RoleOwner Reference Args - (Optional) The reference to a user.
- Project
Reference RoleProject Reference Args - (Optional) The reference to a project.
- permission
Reference List<RoleLists Permission Reference List> - (Required) List of permission references.
- categories
List<Role
Category> - (Optional) Categories for the role.
- description String
- (Optional) The description of the role.
- name String
- (Optional) Name of the role.
- owner
Reference RoleOwner Reference - (Optional) The reference to a user.
- project
Reference RoleProject Reference - (Optional) The reference to a project.
- permission
Reference RoleLists Permission Reference List[] - (Required) List of permission references.
- categories
Role
Category[] - (Optional) Categories for the role.
- description string
- (Optional) The description of the role.
- name string
- (Optional) Name of the role.
- owner
Reference RoleOwner Reference - (Optional) The reference to a user.
- project
Reference RoleProject Reference - (Optional) The reference to a project.
- permission_
reference_ Sequence[Rolelists Permission Reference List Args] - (Required) List of permission references.
- categories
Sequence[Role
Category Args] - (Optional) Categories for the role.
- description str
- (Optional) The description of the role.
- name str
- (Optional) Name of the role.
- owner_
reference RoleOwner Reference Args - (Optional) The reference to a user.
- project_
reference RoleProject Reference Args - (Optional) The reference to a project.
- permission
Reference List<Property Map>Lists - (Required) List of permission references.
- categories List<Property Map>
- (Optional) Categories for the role.
- description String
- (Optional) The description of the role.
- name String
- (Optional) Name of the role.
- owner
Reference Property Map - (Optional) The reference to a user.
- project
Reference Property Map - (Optional) The reference to a project.
Outputs
All input properties are implicitly available as output properties. Additionally, the Role resource produces the following output properties:
- Api
Version string - The version of the API.
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata Dictionary<string, string>
- The role kind metadata.
- State string
- The state of the role.
- Api
Version string - The version of the API.
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata map[string]string
- The role kind metadata.
- State string
- The state of the role.
- api
Version String - The version of the API.
- id String
- The provider-assigned unique ID for this managed resource.
- metadata Map<String,String>
- The role kind metadata.
- state String
- The state of the role.
- api
Version string - The version of the API.
- id string
- The provider-assigned unique ID for this managed resource.
- metadata {[key: string]: string}
- The role kind metadata.
- state string
- The state of the role.
- api_
version str - The version of the API.
- id str
- The provider-assigned unique ID for this managed resource.
- metadata Mapping[str, str]
- The role kind metadata.
- state str
- The state of the role.
- api
Version String - The version of the API.
- id String
- The provider-assigned unique ID for this managed resource.
- metadata Map<String>
- The role kind metadata.
- state String
- The state of the role.
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,
api_version: Optional[str] = None,
categories: Optional[Sequence[RoleCategoryArgs]] = None,
description: Optional[str] = None,
metadata: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
owner_reference: Optional[RoleOwnerReferenceArgs] = None,
permission_reference_lists: Optional[Sequence[RolePermissionReferenceListArgs]] = None,
project_reference: Optional[RoleProjectReferenceArgs] = None,
state: 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.
- Api
Version string - The version of the API.
- Categories
List<Piers
Karsenbarg. Nutanix. Inputs. Role Category> - (Optional) Categories for the role.
- Description string
- (Optional) The description of the role.
- Metadata Dictionary<string, string>
- The role kind metadata.
- Name string
- (Optional) Name of the role.
- Owner
Reference PiersKarsenbarg. Nutanix. Inputs. Role Owner Reference - (Optional) The reference to a user.
- Permission
Reference List<PiersLists Karsenbarg. Nutanix. Inputs. Role Permission Reference List> - (Required) List of permission references.
- Project
Reference PiersKarsenbarg. Nutanix. Inputs. Role Project Reference - (Optional) The reference to a project.
- State string
- The state of the role.
- Api
Version string - The version of the API.
- Categories
[]Role
Category Args - (Optional) Categories for the role.
- Description string
- (Optional) The description of the role.
- Metadata map[string]string
- The role kind metadata.
- Name string
- (Optional) Name of the role.
- Owner
Reference RoleOwner Reference Args - (Optional) The reference to a user.
- Permission
Reference []RoleLists Permission Reference List Args - (Required) List of permission references.
- Project
Reference RoleProject Reference Args - (Optional) The reference to a project.
- State string
- The state of the role.
- api
Version String - The version of the API.
- categories
List<Role
Category> - (Optional) Categories for the role.
- description String
- (Optional) The description of the role.
- metadata Map<String,String>
- The role kind metadata.
- name String
- (Optional) Name of the role.
- owner
Reference RoleOwner Reference - (Optional) The reference to a user.
- permission
Reference List<RoleLists Permission Reference List> - (Required) List of permission references.
- project
Reference RoleProject Reference - (Optional) The reference to a project.
- state String
- The state of the role.
- api
Version string - The version of the API.
- categories
Role
Category[] - (Optional) Categories for the role.
- description string
- (Optional) The description of the role.
- metadata {[key: string]: string}
- The role kind metadata.
- name string
- (Optional) Name of the role.
- owner
Reference RoleOwner Reference - (Optional) The reference to a user.
- permission
Reference RoleLists Permission Reference List[] - (Required) List of permission references.
- project
Reference RoleProject Reference - (Optional) The reference to a project.
- state string
- The state of the role.
- api_
version str - The version of the API.
- categories
Sequence[Role
Category Args] - (Optional) Categories for the role.
- description str
- (Optional) The description of the role.
- metadata Mapping[str, str]
- The role kind metadata.
- name str
- (Optional) Name of the role.
- owner_
reference RoleOwner Reference Args - (Optional) The reference to a user.
- permission_
reference_ Sequence[Rolelists Permission Reference List Args] - (Required) List of permission references.
- project_
reference RoleProject Reference Args - (Optional) The reference to a project.
- state str
- The state of the role.
- api
Version String - The version of the API.
- categories List<Property Map>
- (Optional) Categories for the role.
- description String
- (Optional) The description of the role.
- metadata Map<String>
- The role kind metadata.
- name String
- (Optional) Name of the role.
- owner
Reference Property Map - (Optional) The reference to a user.
- permission
Reference List<Property Map>Lists - (Required) List of permission references.
- project
Reference Property Map - (Optional) The reference to a project.
- state String
- The state of the role.
Supporting Types
RoleCategory, RoleCategoryArgs
RoleOwnerReference, RoleOwnerReferenceArgs
RolePermissionReferenceList, RolePermissionReferenceListArgs
RoleProjectReference, RoleProjectReferenceArgs
Package Details
- Repository
- nutanix pierskarsenbarg/pulumi-nutanix
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
nutanix
Terraform Provider.