GetPolicies

This data source provides the Resource Manager Policies of the current Alibaba Cloud user.

NOTE: Available in 1.86.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.ResourceManager.GetPolicies.InvokeAsync(new AliCloud.ResourceManager.GetPoliciesArgs
        {
            DescriptionRegex = "tftest_policy",
            NameRegex = "tftest",
            PolicyType = "Custom",
        }));
        this.FirstPolicyId = example.Apply(example => example.Policies[0].Id);
    }

    [Output("firstPolicyId")]
    public Output<string> FirstPolicyId { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

example = alicloud.resourcemanager.get_policies(description_regex="tftest_policy",
    name_regex="tftest",
    policy_type="Custom")
pulumi.export("firstPolicyId", example.policies[0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = pulumi.output(alicloud.resourcemanager.getPolicies({
    descriptionRegex: "tftest_policy",
    nameRegex: "tftest",
    policyType: "Custom",
}, { async: true }));

export const firstPolicyId = example.policies[0].id;

Using GetPolicies

function getPolicies(args: GetPoliciesArgs, opts?: InvokeOptions): Promise<GetPoliciesResult>
function  get_policies(ids=None, name_regex=None, output_file=None, policy_type=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:

Ids List<string>

A list of Resource Manager Policy IDs.

NameRegex string

A regex string to filter results by policy name.

OutputFile string
PolicyType string

The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: Custom and System.

Ids []string

A list of Resource Manager Policy IDs.

NameRegex string

A regex string to filter results by policy name.

OutputFile string
PolicyType string

The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: Custom and System.

ids string[]

A list of Resource Manager Policy IDs.

nameRegex string

A regex string to filter results by policy name.

outputFile string
policyType string

The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: Custom and System.

ids List[str]

A list of Resource Manager Policy IDs.

name_regex str

A regex string to filter results by policy name.

output_file str
policy_type str

The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: Custom and System.

GetPolicies Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of policy IDs.

Names List<string>

A list of policy names.

Policies List<Pulumi.AliCloud.ResourceManager.Outputs.GetPoliciesPolicy>

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

NameRegex string
OutputFile string
PolicyType string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of policy IDs.

Names []string

A list of policy names.

Policies []GetPoliciesPolicy

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

NameRegex string
OutputFile string
PolicyType string
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of policy IDs.

names string[]

A list of policy names.

policies GetPoliciesPolicy[]

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

nameRegex string
outputFile string
policyType string
id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of policy IDs.

names List[str]

A list of policy names.

policies List[GetPoliciesPolicy]

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

name_regex str
output_file str
policy_type 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

The number of times the policy is referenced.

CreateDate string

The time when the policy was created.

DefaultVersion string

The default version of the policy.

Description string

The description of the policy.

Id string

The ID of the policy. * policy_name- The name of the policy. * policy_type- The type of the policy.

PolicyName string
PolicyType string

The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: Custom and System.

UpdateDate string

The time when the policy was updated.

AttachmentCount int

The number of times the policy is referenced.

CreateDate string

The time when the policy was created.

DefaultVersion string

The default version of the policy.

Description string

The description of the policy.

Id string

The ID of the policy. * policy_name- The name of the policy. * policy_type- The type of the policy.

PolicyName string
PolicyType string

The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: Custom and System.

UpdateDate string

The time when the policy was updated.

attachmentCount number

The number of times the policy is referenced.

createDate string

The time when the policy was created.

defaultVersion string

The default version of the policy.

description string

The description of the policy.

id string

The ID of the policy. * policy_name- The name of the policy. * policy_type- The type of the policy.

policyName string
policyType string

The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: Custom and System.

updateDate string

The time when the policy was updated.

attachment_count float

The number of times the policy is referenced.

create_date str

The time when the policy was created.

default_version str

The default version of the policy.

description str

The description of the policy.

id str

The ID of the policy. * policy_name- The name of the policy. * policy_type- The type of the policy.

policy_name str
policy_type str

The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: Custom and System.

update_date str

The time when the policy was updated.

Package Details

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