Role

Provides a Resource Manager role resource. Members are resource containers in the resource directory, which can physically isolate resources to form an independent resource grouping unit. You can create members in the resource folder to manage them in a unified manner. For information about Resource Manager role and how to use it, see What is Resource Manager role.

NOTE: Available in v1.82.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        // Add a Resource Manager role.
        var example = new AliCloud.ResourceManager.Role("example", new AliCloud.ResourceManager.RoleArgs
        {
            AssumeRolePolicyDocument = @"     {
          ""Statement"": [
               {
                    ""Action"": ""sts:AssumeRole"",
                    ""Effect"": ""Allow"",
                    ""Principal"": {
                        ""RAM"":""acs:ram::103755469187****:root""
                    }
                }
          ],
          ""Version"": ""1""
     }
  
",
            RoleName = "testrd",
        });
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

# Add a Resource Manager role.
example = alicloud.resourcemanager.Role("example",
    assume_role_policy_document="""     {
          "Statement": [
               {
                    "Action": "sts:AssumeRole",
                    "Effect": "Allow",
                    "Principal": {
                        "RAM":"acs:ram::103755469187****:root"
                    }
                }
          ],
          "Version": "1"
     }
     
""",
    role_name="testrd")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

// Add a Resource Manager role.
const example = new alicloud.resourcemanager.Role("example", {
    assumeRolePolicyDocument: `     {
          "Statement": [
               {
                    "Action": "sts:AssumeRole",
                    "Effect": "Allow",
                    "Principal": {
                        "RAM":"acs:ram::103755469187****:root"
                    }
                }
          ],
          "Version": "1"
     }
     `,
    roleName: "testrd",
});

Create a Role Resource

new Role(name: string, args: RoleArgs, opts?: CustomResourceOptions);
def Role(resource_name, opts=None, assume_role_policy_document=None, description=None, max_session_duration=None, role_name=None, __props__=None);
func NewRole(ctx *Context, name string, args RoleArgs, opts ...ResourceOption) (*Role, error)
public Role(string name, RoleArgs args, CustomResourceOptions? opts = null)
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.
opts ResourceOptions
A bag of options that control this 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.

Role Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Role resource accepts the following input properties:

AssumeRolePolicyDocument string

The content of the permissions strategy that plays a role.

RoleName string

Role Name. The length is 1 ~ 64 characters, which can include English letters, numbers, dots “.” and dashes “-”.

Description string

The description of the Resource Manager role.

MaxSessionDuration int

Role maximum session time. Valid values: [3600-43200]. Default to 3600.

AssumeRolePolicyDocument string

The content of the permissions strategy that plays a role.

RoleName string

Role Name. The length is 1 ~ 64 characters, which can include English letters, numbers, dots “.” and dashes “-”.

Description string

The description of the Resource Manager role.

MaxSessionDuration int

Role maximum session time. Valid values: [3600-43200]. Default to 3600.

assumeRolePolicyDocument string

The content of the permissions strategy that plays a role.

roleName string

Role Name. The length is 1 ~ 64 characters, which can include English letters, numbers, dots “.” and dashes “-”.

description string

The description of the Resource Manager role.

maxSessionDuration number

Role maximum session time. Valid values: [3600-43200]. Default to 3600.

assume_role_policy_document str

The content of the permissions strategy that plays a role.

role_name str

Role Name. The length is 1 ~ 64 characters, which can include English letters, numbers, dots “.” and dashes “-”.

description str

The description of the Resource Manager role.

max_session_duration float

Role maximum session time. Valid values: [3600-43200]. Default to 3600.

Outputs

All input properties are implicitly available as output properties. Additionally, the Role resource produces the following output properties:

Arn string

The resource descriptor of the role.

CreateDate string

Role creation time.

Id string
The provider-assigned unique ID for this managed resource.
RoleId string
UpdateDate string

Role update time.

Arn string

The resource descriptor of the role.

CreateDate string

Role creation time.

Id string
The provider-assigned unique ID for this managed resource.
RoleId string
UpdateDate string

Role update time.

arn string

The resource descriptor of the role.

createDate string

Role creation time.

id string
The provider-assigned unique ID for this managed resource.
roleId string
updateDate string

Role update time.

arn str

The resource descriptor of the role.

create_date str

Role creation time.

id str
The provider-assigned unique ID for this managed resource.
role_id str
update_date str

Role update time.

Look up an 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
static get(resource_name, id, opts=None, arn=None, assume_role_policy_document=None, create_date=None, description=None, max_session_duration=None, role_id=None, role_name=None, update_date=None, __props__=None);
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)
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.

The following state arguments are supported:

Arn string

The resource descriptor of the role.

AssumeRolePolicyDocument string

The content of the permissions strategy that plays a role.

CreateDate string

Role creation time.

Description string

The description of the Resource Manager role.

MaxSessionDuration int

Role maximum session time. Valid values: [3600-43200]. Default to 3600.

RoleId string
RoleName string

Role Name. The length is 1 ~ 64 characters, which can include English letters, numbers, dots “.” and dashes “-”.

UpdateDate string

Role update time.

Arn string

The resource descriptor of the role.

AssumeRolePolicyDocument string

The content of the permissions strategy that plays a role.

CreateDate string

Role creation time.

Description string

The description of the Resource Manager role.

MaxSessionDuration int

Role maximum session time. Valid values: [3600-43200]. Default to 3600.

RoleId string
RoleName string

Role Name. The length is 1 ~ 64 characters, which can include English letters, numbers, dots “.” and dashes “-”.

UpdateDate string

Role update time.

arn string

The resource descriptor of the role.

assumeRolePolicyDocument string

The content of the permissions strategy that plays a role.

createDate string

Role creation time.

description string

The description of the Resource Manager role.

maxSessionDuration number

Role maximum session time. Valid values: [3600-43200]. Default to 3600.

roleId string
roleName string

Role Name. The length is 1 ~ 64 characters, which can include English letters, numbers, dots “.” and dashes “-”.

updateDate string

Role update time.

arn str

The resource descriptor of the role.

assume_role_policy_document str

The content of the permissions strategy that plays a role.

create_date str

Role creation time.

description str

The description of the Resource Manager role.

max_session_duration float

Role maximum session time. Valid values: [3600-43200]. Default to 3600.

role_id str
role_name str

Role Name. The length is 1 ~ 64 characters, which can include English letters, numbers, dots “.” and dashes “-”.

update_date str

Role update time.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.