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);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:
- Assume
Role stringPolicy Document The content of the permissions strategy that plays a role.
- Role
Name 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.
- Max
Session intDuration Role maximum session time. Valid values: [3600-43200]. Default to
3600.
- Assume
Role stringPolicy Document The content of the permissions strategy that plays a role.
- Role
Name 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.
- Max
Session intDuration Role maximum session time. Valid values: [3600-43200]. Default to
3600.
- assume
Role stringPolicy Document The content of the permissions strategy that plays a role.
- role
Name 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.
- max
Session numberDuration Role maximum session time. Valid values: [3600-43200]. Default to
3600.
- assume_
role_ strpolicy_ document 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_ floatduration 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.
- Create
Date string Role creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Role
Id string - Update
Date string Role update time.
- Arn string
The resource descriptor of the role.
- Create
Date string Role creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Role
Id string - Update
Date string Role update time.
- arn string
The resource descriptor of the role.
- create
Date string Role creation time.
- id string
- The provider-assigned unique ID for this managed resource.
- role
Id string - update
Date 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): Rolestatic 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);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.
- Assume
Role stringPolicy Document The content of the permissions strategy that plays a role.
- Create
Date string Role creation time.
- Description string
The description of the Resource Manager role.
- Max
Session intDuration Role maximum session time. Valid values: [3600-43200]. Default to
3600.- Role
Id string - Role
Name string Role Name. The length is 1 ~ 64 characters, which can include English letters, numbers, dots “.” and dashes “-”.
- Update
Date string Role update time.
- Arn string
The resource descriptor of the role.
- Assume
Role stringPolicy Document The content of the permissions strategy that plays a role.
- Create
Date string Role creation time.
- Description string
The description of the Resource Manager role.
- Max
Session intDuration Role maximum session time. Valid values: [3600-43200]. Default to
3600.- Role
Id string - Role
Name string Role Name. The length is 1 ~ 64 characters, which can include English letters, numbers, dots “.” and dashes “-”.
- Update
Date string Role update time.
- arn string
The resource descriptor of the role.
- assume
Role stringPolicy Document The content of the permissions strategy that plays a role.
- create
Date string Role creation time.
- description string
The description of the Resource Manager role.
- max
Session numberDuration Role maximum session time. Valid values: [3600-43200]. Default to
3600.- role
Id string - role
Name string Role Name. The length is 1 ~ 64 characters, which can include English letters, numbers, dots “.” and dashes “-”.
- update
Date string Role update time.
- arn str
The resource descriptor of the role.
- assume_
role_ strpolicy_ document 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_ floatduration 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
alicloudTerraform Provider.