1. Packages
  2. Nutanix
  3. API Docs
  4. Role
Nutanix v0.5.0 published on Monday, Nov 4, 2024 by Piers Karsenbarg

nutanix.Role

Explore with Pulumi AI

nutanix logo
Nutanix v0.5.0 published on Monday, Nov 4, 2024 by Piers Karsenbarg

    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)
    public Role(String name, RoleArgs args)
    public Role(String name, RoleArgs args, CustomResourceOptions options)
    
    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:

    PermissionReferenceLists List<PiersKarsenbarg.Nutanix.Inputs.RolePermissionReferenceList>
    • (Required) List of permission references.
    Categories List<PiersKarsenbarg.Nutanix.Inputs.RoleCategory>
    • (Optional) Categories for the role.
    Description string
    • (Optional) The description of the role.
    Name string
    • (Optional) Name of the role.
    OwnerReference PiersKarsenbarg.Nutanix.Inputs.RoleOwnerReference
    • (Optional) The reference to a user.
    ProjectReference PiersKarsenbarg.Nutanix.Inputs.RoleProjectReference
    • (Optional) The reference to a project.
    PermissionReferenceLists []RolePermissionReferenceListArgs
    • (Required) List of permission references.
    Categories []RoleCategoryArgs
    • (Optional) Categories for the role.
    Description string
    • (Optional) The description of the role.
    Name string
    • (Optional) Name of the role.
    OwnerReference RoleOwnerReferenceArgs
    • (Optional) The reference to a user.
    ProjectReference RoleProjectReferenceArgs
    • (Optional) The reference to a project.
    permissionReferenceLists List<RolePermissionReferenceList>
    • (Required) List of permission references.
    categories List<RoleCategory>
    • (Optional) Categories for the role.
    description String
    • (Optional) The description of the role.
    name String
    • (Optional) Name of the role.
    ownerReference RoleOwnerReference
    • (Optional) The reference to a user.
    projectReference RoleProjectReference
    • (Optional) The reference to a project.
    permissionReferenceLists RolePermissionReferenceList[]
    • (Required) List of permission references.
    categories RoleCategory[]
    • (Optional) Categories for the role.
    description string
    • (Optional) The description of the role.
    name string
    • (Optional) Name of the role.
    ownerReference RoleOwnerReference
    • (Optional) The reference to a user.
    projectReference RoleProjectReference
    • (Optional) The reference to a project.
    permission_reference_lists Sequence[RolePermissionReferenceListArgs]
    • (Required) List of permission references.
    categories Sequence[RoleCategoryArgs]
    • (Optional) Categories for the role.
    description str
    • (Optional) The description of the role.
    name str
    • (Optional) Name of the role.
    owner_reference RoleOwnerReferenceArgs
    • (Optional) The reference to a user.
    project_reference RoleProjectReferenceArgs
    • (Optional) The reference to a project.
    permissionReferenceLists List<Property Map>
    • (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.
    ownerReference Property Map
    • (Optional) The reference to a user.
    projectReference 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:

    ApiVersion 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.
    ApiVersion 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.
    apiVersion 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.
    apiVersion 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.
    apiVersion 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.
    The following state arguments are supported:
    ApiVersion string
    The version of the API.
    Categories List<PiersKarsenbarg.Nutanix.Inputs.RoleCategory>
    • (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.
    OwnerReference PiersKarsenbarg.Nutanix.Inputs.RoleOwnerReference
    • (Optional) The reference to a user.
    PermissionReferenceLists List<PiersKarsenbarg.Nutanix.Inputs.RolePermissionReferenceList>
    • (Required) List of permission references.
    ProjectReference PiersKarsenbarg.Nutanix.Inputs.RoleProjectReference
    • (Optional) The reference to a project.
    State string
    • The state of the role.
    ApiVersion string
    The version of the API.
    Categories []RoleCategoryArgs
    • (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.
    OwnerReference RoleOwnerReferenceArgs
    • (Optional) The reference to a user.
    PermissionReferenceLists []RolePermissionReferenceListArgs
    • (Required) List of permission references.
    ProjectReference RoleProjectReferenceArgs
    • (Optional) The reference to a project.
    State string
    • The state of the role.
    apiVersion String
    The version of the API.
    categories List<RoleCategory>
    • (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.
    ownerReference RoleOwnerReference
    • (Optional) The reference to a user.
    permissionReferenceLists List<RolePermissionReferenceList>
    • (Required) List of permission references.
    projectReference RoleProjectReference
    • (Optional) The reference to a project.
    state String
    • The state of the role.
    apiVersion string
    The version of the API.
    categories RoleCategory[]
    • (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.
    ownerReference RoleOwnerReference
    • (Optional) The reference to a user.
    permissionReferenceLists RolePermissionReferenceList[]
    • (Required) List of permission references.
    projectReference RoleProjectReference
    • (Optional) The reference to a project.
    state string
    • The state of the role.
    api_version str
    The version of the API.
    categories Sequence[RoleCategoryArgs]
    • (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 RoleOwnerReferenceArgs
    • (Optional) The reference to a user.
    permission_reference_lists Sequence[RolePermissionReferenceListArgs]
    • (Required) List of permission references.
    project_reference RoleProjectReferenceArgs
    • (Optional) The reference to a project.
    state str
    • The state of the role.
    apiVersion 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.
    ownerReference Property Map
    • (Optional) The reference to a user.
    permissionReferenceLists List<Property Map>
    • (Required) List of permission references.
    projectReference Property Map
    • (Optional) The reference to a project.
    state String
    • The state of the role.

    Supporting Types

    RoleCategory, RoleCategoryArgs

    Name string
    • (Optional) Name of the role.
    Value string
    • value of the key.
    Name string
    • (Optional) Name of the role.
    Value string
    • value of the key.
    name String
    • (Optional) Name of the role.
    value String
    • value of the key.
    name string
    • (Optional) Name of the role.
    value string
    • value of the key.
    name str
    • (Optional) Name of the role.
    value str
    • value of the key.
    name String
    • (Optional) Name of the role.
    value String
    • value of the key.

    RoleOwnerReference, RoleOwnerReferenceArgs

    Kind string
    • The kind name (Default value: project)(Required).
    Name string
    • (Optional) Name of the role.
    Uuid string
    • the UUID(Required).
    Kind string
    • The kind name (Default value: project)(Required).
    Name string
    • (Optional) Name of the role.
    Uuid string
    • the UUID(Required).
    kind String
    • The kind name (Default value: project)(Required).
    name String
    • (Optional) Name of the role.
    uuid String
    • the UUID(Required).
    kind string
    • The kind name (Default value: project)(Required).
    name string
    • (Optional) Name of the role.
    uuid string
    • the UUID(Required).
    kind str
    • The kind name (Default value: project)(Required).
    name str
    • (Optional) Name of the role.
    uuid str
    • the UUID(Required).
    kind String
    • The kind name (Default value: project)(Required).
    name String
    • (Optional) Name of the role.
    uuid String
    • the UUID(Required).

    RolePermissionReferenceList, RolePermissionReferenceListArgs

    Uuid string
    • the UUID(Required).
    Kind string
    • The kind name (Default value: project)(Required).
    Name string
    • (Optional) Name of the role.
    Uuid string
    • the UUID(Required).
    Kind string
    • The kind name (Default value: project)(Required).
    Name string
    • (Optional) Name of the role.
    uuid String
    • the UUID(Required).
    kind String
    • The kind name (Default value: project)(Required).
    name String
    • (Optional) Name of the role.
    uuid string
    • the UUID(Required).
    kind string
    • The kind name (Default value: project)(Required).
    name string
    • (Optional) Name of the role.
    uuid str
    • the UUID(Required).
    kind str
    • The kind name (Default value: project)(Required).
    name str
    • (Optional) Name of the role.
    uuid String
    • the UUID(Required).
    kind String
    • The kind name (Default value: project)(Required).
    name String
    • (Optional) Name of the role.

    RoleProjectReference, RoleProjectReferenceArgs

    Kind string
    • The kind name (Default value: project)(Required).
    Name string
    • (Optional) Name of the role.
    Uuid string
    • the UUID(Required).
    Kind string
    • The kind name (Default value: project)(Required).
    Name string
    • (Optional) Name of the role.
    Uuid string
    • the UUID(Required).
    kind String
    • The kind name (Default value: project)(Required).
    name String
    • (Optional) Name of the role.
    uuid String
    • the UUID(Required).
    kind string
    • The kind name (Default value: project)(Required).
    name string
    • (Optional) Name of the role.
    uuid string
    • the UUID(Required).
    kind str
    • The kind name (Default value: project)(Required).
    name str
    • (Optional) Name of the role.
    uuid str
    • the UUID(Required).
    kind String
    • The kind name (Default value: project)(Required).
    name String
    • (Optional) Name of the role.
    uuid String
    • the UUID(Required).

    Package Details

    Repository
    nutanix pierskarsenbarg/pulumi-nutanix
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nutanix Terraform Provider.
    nutanix logo
    Nutanix v0.5.0 published on Monday, Nov 4, 2024 by Piers Karsenbarg