GetRoles
This data source provides a list of RAM Roles in an Alibaba Cloud account according to the specified filters.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var rolesDs = Output.Create(AliCloud.Ram.GetRoles.InvokeAsync(new AliCloud.Ram.GetRolesArgs
{
NameRegex = ".*test.*",
OutputFile = "roles.txt",
PolicyName = "AliyunACSDefaultAccess",
PolicyType = "Custom",
}));
this.FirstRoleId = rolesDs.Apply(rolesDs => rolesDs.Roles[0].Id);
}
[Output("firstRoleId")]
public Output<string> FirstRoleId { get; set; }
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
roles_ds = alicloud.ram.get_roles(name_regex=".*test.*",
output_file="roles.txt",
policy_name="AliyunACSDefaultAccess",
policy_type="Custom")
pulumi.export("firstRoleId", roles_ds.roles[0]["id"])import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const rolesDs = pulumi.output(alicloud.ram.getRoles({
nameRegex: ".*test.*",
outputFile: "roles.txt",
policyName: "AliyunACSDefaultAccess",
policyType: "Custom",
}, { async: true }));
export const firstRoleId = rolesDs.roles[0].id;Using GetRoles
function getRoles(args: GetRolesArgs, opts?: InvokeOptions): Promise<GetRolesResult>function get_roles(ids=None, name_regex=None, output_file=None, policy_name=None, policy_type=None, opts=None)func GetRoles(ctx *Context, args *GetRolesArgs, opts ...InvokeOption) (*GetRolesResult, error)public static class GetRoles {
public static Task<GetRolesResult> InvokeAsync(GetRolesArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Ids List<string>
- A list of ram role IDs.
- Name
Regex string A regex string to filter results by the role name.
- Output
File string - Policy
Name string Filter results by a specific policy name. If you set this parameter without setting
policy_type, the later will be automatically set toSystem. The resulting roles will be attached to the specified policy.- Policy
Type string Filter results by a specific policy type. Valid values are
CustomandSystem. If you set this parameter, you must setpolicy_nameas well.
- Ids []string
- A list of ram role IDs.
- Name
Regex string A regex string to filter results by the role name.
- Output
File string - Policy
Name string Filter results by a specific policy name. If you set this parameter without setting
policy_type, the later will be automatically set toSystem. The resulting roles will be attached to the specified policy.- Policy
Type string Filter results by a specific policy type. Valid values are
CustomandSystem. If you set this parameter, you must setpolicy_nameas well.
- ids string[]
- A list of ram role IDs.
- name
Regex string A regex string to filter results by the role name.
- output
File string - policy
Name string Filter results by a specific policy name. If you set this parameter without setting
policy_type, the later will be automatically set toSystem. The resulting roles will be attached to the specified policy.- policy
Type string Filter results by a specific policy type. Valid values are
CustomandSystem. If you set this parameter, you must setpolicy_nameas well.
- ids List[str]
- A list of ram role IDs.
- name_
regex str A regex string to filter results by the role name.
- output_
file str - policy_
name str Filter results by a specific policy name. If you set this parameter without setting
policy_type, the later will be automatically set toSystem. The resulting roles will be attached to the specified policy.- policy_
type str Filter results by a specific policy type. Valid values are
CustomandSystem. If you set this parameter, you must setpolicy_nameas well.
GetRoles Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
A list of ram role IDs.
- Names List<string>
A list of ram role names.
- Roles
List<Pulumi.
Ali Cloud. Ram. Outputs. Get Roles Role> A list of roles. Each element contains the following attributes:
- Name
Regex string - Output
File string - Policy
Name string - Policy
Type string
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
A list of ram role IDs.
- Names []string
A list of ram role names.
- Roles
[]Get
Roles Role A list of roles. Each element contains the following attributes:
- Name
Regex string - Output
File string - Policy
Name string - Policy
Type string
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
A list of ram role IDs.
- names string[]
A list of ram role names.
- roles
Get
Roles Role[] A list of roles. Each element contains the following attributes:
- name
Regex string - output
File string - policy
Name string - policy
Type string
- id str
The provider-assigned unique ID for this managed resource.
- ids List[str]
A list of ram role IDs.
- names List[str]
A list of ram role names.
- roles
List[Get
Roles Role] A list of roles. Each element contains the following attributes:
- name_
regex str - output_
file str - policy_
name str - policy_
type str
Supporting Types
GetRolesRole
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Arn string
Resource descriptor of the role.
- Assume
Role stringPolicy Document Authorization strategy of the role. This parameter is deprecated and replaced by
document.- Create
Date string Creation date of the role.
- Description string
Description of the role.
- Document string
Authorization strategy of the role.
- Id string
Id of the role.
- Name string
Name of the role.
- Update
Date string Update date of the role.
- Arn string
Resource descriptor of the role.
- Assume
Role stringPolicy Document Authorization strategy of the role. This parameter is deprecated and replaced by
document.- Create
Date string Creation date of the role.
- Description string
Description of the role.
- Document string
Authorization strategy of the role.
- Id string
Id of the role.
- Name string
Name of the role.
- Update
Date string Update date of the role.
- arn string
Resource descriptor of the role.
- assume
Role stringPolicy Document Authorization strategy of the role. This parameter is deprecated and replaced by
document.- create
Date string Creation date of the role.
- description string
Description of the role.
- document string
Authorization strategy of the role.
- id string
Id of the role.
- name string
Name of the role.
- update
Date string Update date of the role.
- arn str
Resource descriptor of the role.
- assume_
role_ strpolicy_ document Authorization strategy of the role. This parameter is deprecated and replaced by
document.- create_
date str Creation date of the role.
- description str
Description of the role.
- document str
Authorization strategy of the role.
- id str
Id of the role.
- name str
Name of the role.
- update_
date str Update date of the role.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.