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:

GroupName string

Filter results by a specific group name. Returned policies are attached to the specified group.

NameRegex string

A regex string to filter resulting policies by name.

OutputFile string
RoleName 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 Custom and System.

UserName string

Filter results by a specific user name. Returned policies are attached to the specified user.

GroupName string

Filter results by a specific group name. Returned policies are attached to the specified group.

NameRegex string

A regex string to filter resulting policies by name.

OutputFile string
RoleName 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 Custom and System.

UserName string

Filter results by a specific user name. Returned policies are attached to the specified user.

groupName string

Filter results by a specific group name. Returned policies are attached to the specified group.

nameRegex string

A regex string to filter resulting policies by name.

outputFile string
roleName 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 Custom and System.

userName 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 Custom and System.

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.AliCloud.Ram.Outputs.GetPoliciesPolicy>

A list of policies. Each element contains the following attributes:

GroupName string
NameRegex string
OutputFile string
RoleName string
Type string

Type of the policy.

UserName string
Id string

The provider-assigned unique ID for this managed resource.

Names []string

A list of ram group names.

Policies []GetPoliciesPolicy

A list of policies. Each element contains the following attributes:

GroupName string
NameRegex string
OutputFile string
RoleName string
Type string

Type of the policy.

UserName string
id string

The provider-assigned unique ID for this managed resource.

names string[]

A list of ram group names.

policies GetPoliciesPolicy[]

A list of policies. Each element contains the following attributes:

groupName string
nameRegex string
outputFile string
roleName string
type string

Type of the policy.

userName string
id str

The provider-assigned unique ID for this managed resource.

names List[str]

A list of ram group names.

policies List[GetPoliciesPolicy]

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.

AttachmentCount int

Attachment count of the policy.

CreateDate string

Creation date of the policy.

DefaultVersion 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 Custom and System.

UpdateDate string

Update date of the policy.

AttachmentCount int

Attachment count of the policy.

CreateDate string

Creation date of the policy.

DefaultVersion 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 Custom and System.

UpdateDate string

Update date of the policy.

attachmentCount number

Attachment count of the policy.

createDate string

Creation date of the policy.

defaultVersion 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 Custom and System.

updateDate 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 Custom and System.

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 alicloud Terraform Provider.