GetPolicies
This data source provides a list of RAM policies in an Alibaba Cloud account according to the specified filters.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var policiesDs = Output.Create(AliCloud.Ram.GetPolicies.InvokeAsync(new AliCloud.Ram.GetPoliciesArgs
{
GroupName = "group1",
OutputFile = "policies.txt",
Type = "System",
UserName = "user1",
}));
this.FirstPolicyName = policiesDs.Apply(policiesDs => policiesDs.Policies[0].Name);
}
[Output("firstPolicyName")]
public Output<string> FirstPolicyName { get; set; }
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
policies_ds = alicloud.ram.get_policies(group_name="group1",
output_file="policies.txt",
type="System",
user_name="user1")
pulumi.export("firstPolicyName", policies_ds.policies[0]["name"])import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const policiesDs = pulumi.output(alicloud.ram.getPolicies({
groupName: "group1",
outputFile: "policies.txt",
type: "System",
userName: "user1",
}, { async: true }));
export const firstPolicyName = policiesDs.policies[0].name;Using GetPolicies
function getPolicies(args: GetPoliciesArgs, opts?: InvokeOptions): Promise<GetPoliciesResult>function get_policies(group_name=None, name_regex=None, output_file=None, role_name=None, type=None, user_name=None, opts=None)func GetPolicies(ctx *Context, args *GetPoliciesArgs, opts ...InvokeOption) (*GetPoliciesResult, error)public static class GetPolicies {
public static Task<GetPoliciesResult> InvokeAsync(GetPoliciesArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Group
Name string Filter results by a specific group name. Returned policies are attached to the specified group.
- Name
Regex string A regex string to filter resulting policies by name.
- Output
File string - Role
Name string Filter results by a specific role name. Returned policies are attached to the specified role.
- Type string
Filter results by a specific policy type. Valid values are
CustomandSystem.- User
Name string Filter results by a specific user name. Returned policies are attached to the specified user.
- Group
Name string Filter results by a specific group name. Returned policies are attached to the specified group.
- Name
Regex string A regex string to filter resulting policies by name.
- Output
File string - Role
Name string Filter results by a specific role name. Returned policies are attached to the specified role.
- Type string
Filter results by a specific policy type. Valid values are
CustomandSystem.- User
Name string Filter results by a specific user name. Returned policies are attached to the specified user.
- group
Name string Filter results by a specific group name. Returned policies are attached to the specified group.
- name
Regex string A regex string to filter resulting policies by name.
- output
File string - role
Name string Filter results by a specific role name. Returned policies are attached to the specified role.
- type string
Filter results by a specific policy type. Valid values are
CustomandSystem.- user
Name string Filter results by a specific user name. Returned policies are attached to the specified user.
- group_
name str Filter results by a specific group name. Returned policies are attached to the specified group.
- name_
regex str A regex string to filter resulting policies by name.
- output_
file str - role_
name str Filter results by a specific role name. Returned policies are attached to the specified role.
- type str
Filter results by a specific policy type. Valid values are
CustomandSystem.- user_
name str Filter results by a specific user name. Returned policies are attached to the specified user.
GetPolicies Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Names List<string>
A list of ram group names.
- Policies
List<Pulumi.
Ali Cloud. Ram. Outputs. Get Policies Policy> A list of policies. Each element contains the following attributes:
- Group
Name string - Name
Regex string - Output
File string - Role
Name string - Type string
Type of the policy.
- User
Name string
- Id string
The provider-assigned unique ID for this managed resource.
- Names []string
A list of ram group names.
- Policies
[]Get
Policies Policy A list of policies. Each element contains the following attributes:
- Group
Name string - Name
Regex string - Output
File string - Role
Name string - Type string
Type of the policy.
- User
Name string
- id string
The provider-assigned unique ID for this managed resource.
- names string[]
A list of ram group names.
- policies
Get
Policies Policy[] A list of policies. Each element contains the following attributes:
- group
Name string - name
Regex string - output
File string - role
Name string - type string
Type of the policy.
- user
Name string
- id str
The provider-assigned unique ID for this managed resource.
- names List[str]
A list of ram group names.
- policies
List[Get
Policies Policy] A list of policies. Each element contains the following attributes:
- group_
name str - name_
regex str - output_
file str - role_
name str - type str
Type of the policy.
- user_
name str
Supporting Types
GetPoliciesPolicy
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Attachment
Count int Attachment count of the policy.
- Create
Date string Creation date of the policy.
- Default
Version string Default version of the policy.
- Description string
Description of the policy.
- Document string
Policy document of the policy.
- Name string
Name of the policy.
- Type string
Filter results by a specific policy type. Valid values are
CustomandSystem.- Update
Date string Update date of the policy.
- Attachment
Count int Attachment count of the policy.
- Create
Date string Creation date of the policy.
- Default
Version string Default version of the policy.
- Description string
Description of the policy.
- Document string
Policy document of the policy.
- Name string
Name of the policy.
- Type string
Filter results by a specific policy type. Valid values are
CustomandSystem.- Update
Date string Update date of the policy.
- attachment
Count number Attachment count of the policy.
- create
Date string Creation date of the policy.
- default
Version string Default version of the policy.
- description string
Description of the policy.
- document string
Policy document of the policy.
- name string
Name of the policy.
- type string
Filter results by a specific policy type. Valid values are
CustomandSystem.- update
Date string Update date of the policy.
- attachment_
count float Attachment count of the policy.
- create_
date str Creation date of the policy.
- default_
version str Default version of the policy.
- description str
Description of the policy.
- document str
Policy document of the policy.
- name str
Name of the policy.
- type str
Filter results by a specific policy type. Valid values are
CustomandSystem.- update_
date str Update date of the policy.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.