Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.27.0 published on Monday, Aug 8, 2022 by Pulumi

getPolicies

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

NOTE: Available in 1.86.0+.

Example Usage

Coming soon!

Coming soon!

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
import com.pulumi.alicloud.ram.inputs.GetPoliciesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = ResourcemanagerFunctions.getPolicies(GetPoliciesArgs.builder()
            .descriptionRegex("tftest_policy")
            .nameRegex("tftest")
            .policyType("Custom")
            .build());

        ctx.export("firstPolicyId", example.applyValue(getPoliciesResult -> getPoliciesResult.policies()[0].id()));
    }
}

Coming soon!

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",
}));

export const firstPolicyId = example.policies[0].id;
variables:
  example:
    Fn::Invoke:
      Function: alicloud:resourcemanager:getPolicies
      Arguments:
        descriptionRegex: tftest_policy
        nameRegex: tftest
        policyType: Custom
outputs:
  firstPolicyId: ${example.policies[0].id}

Using getPolicies

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getPolicies(args: GetPoliciesArgs, opts?: InvokeOptions): Promise<GetPoliciesResult>
function getPoliciesOutput(args: GetPoliciesOutputArgs, opts?: InvokeOptions): Output<GetPoliciesResult>
def get_policies(ids: Optional[Sequence[str]] = None,
                 name_regex: Optional[str] = None,
                 output_file: Optional[str] = None,
                 policy_type: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetPoliciesResult
def get_policies_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 name_regex: Optional[pulumi.Input[str]] = None,
                 output_file: Optional[pulumi.Input[str]] = None,
                 policy_type: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetPoliciesResult]
func GetPolicies(ctx *Context, args *GetPoliciesArgs, opts ...InvokeOption) (*GetPoliciesResult, error)
func GetPoliciesOutput(ctx *Context, args *GetPoliciesOutputArgs, opts ...InvokeOption) GetPoliciesResultOutput

> Note: This function is named GetPolicies in the Go SDK.

public static class GetPolicies 
{
    public static Task<GetPoliciesResult> InvokeAsync(GetPoliciesArgs args, InvokeOptions? opts = null)
    public static Output<GetPoliciesResult> Invoke(GetPoliciesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPoliciesResult> getPolicies(GetPoliciesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:resourcemanager/getPolicies:getPolicies
  Arguments:
    # Arguments dictionary

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 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 Sequence[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.

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.

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 List<String>

A list of policy IDs.

names List<String>

A list of policy names.

policies List<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 Sequence[str]

A list of policy IDs.

names Sequence[str]

A list of policy names.

policies Sequence[GetPoliciesPolicy]

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

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

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

nameRegex String
outputFile String
policyType String

Supporting Types

GetPoliciesPolicy

AttachmentCount int

The number of times the policy is referenced.

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.

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 Integer

The number of times the policy is referenced.

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.

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 int

The number of times the policy is referenced.

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.

attachmentCount Number

The number of times the policy is referenced.

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.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.