Show / Hide Table of Contents

Class Definition

Manages a custom Role Definition, used to assign Roles to Users/Principals. See 'Understand role definitions' in the Azure documentation for more details.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
public MyStack()
{
    var primary = Output.Create(Azure.Core.GetSubscription.InvokeAsync());
    var example = new Azure.Authorization.RoleDefinition("example", new Azure.Authorization.RoleDefinitionArgs
    {
        Scope = primary.Apply(primary => primary.Id),
        Description = "This is a custom role created",
        Permissions = 
        {
            new Azure.Authorization.Inputs.RoleDefinitionPermissionArgs
            {
                Actions = 
                {
                    "*",
                },
                NotActions = {},
            },
        },
        AssignableScopes = 
        {
            primary.Apply(primary => primary.Id),
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Definition
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Azure.Role
Assembly: Pulumi.Azure.dll
Syntax
[Obsolete("azure.role.Definition has been deprecated in favor of azure.authorization.RoleDefinition")]
public class Definition : CustomResource

Constructors

View Source

Definition(String, DefinitionArgs, CustomResourceOptions)

Create a Definition resource with the given unique name, arguments, and options.

Declaration
public Definition(string name, DefinitionArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

DefinitionArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

AssignableScopes

One or more assignable scopes for this Role Definition, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333, /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup, or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup/providers/Microsoft.Compute/virtualMachines/myVM.

Declaration
public Output<ImmutableArray<string>> AssignableScopes { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

Description

A description of the Role Definition.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

The name of the Role Definition. Changing this forces a new resource to be created.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Permissions

A permissions block as defined below.

Declaration
public Output<ImmutableArray<DefinitionPermission>> Permissions { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<DefinitionPermission>>
View Source

RoleDefinitionId

A unique UUID/GUID which identifies this role - one will be generated if not specified. Changing this forces a new resource to be created.

Declaration
public Output<string> RoleDefinitionId { get; }
Property Value
Type Description
Output<System.String>
View Source

Scope

The scope at which the Role Definition applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333, /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup, or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup/providers/Microsoft.Compute/virtualMachines/myVM. It is recommended to use the first entry of the assignable_scopes. Changing this forces a new resource to be created.

Declaration
public Output<string> Scope { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, DefinitionState, CustomResourceOptions)

Get an existing Definition resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Definition Get(string name, Input<string> id, DefinitionState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

DefinitionState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Definition
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.