Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi
alicloud.resourcemanager.getPolicies
Explore with Pulumi AI
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!
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.resourcemanager.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()
            .nameRegex("tftest")
            .descriptionRegex("tftest_policy")
            .policyType("Custom")
            .build());
        ctx.export("firstPolicyId", example.applyValue(getPoliciesResult -> getPoliciesResult.policies()[0].id()));
    }
}
variables:
  example:
    fn::invoke:
      function: alicloud:resourcemanager:getPolicies
      arguments:
        nameRegex: tftest
        descriptionRegex: tftest_policy
        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)
public static Output<GetPoliciesResult> getPolicies(GetPoliciesArgs args, InvokeOptions options)
fn::invoke:
  function: alicloud:resourcemanager/getPolicies:getPolicies
  arguments:
    # arguments dictionaryThe 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
- File name where to save data source results (after running pulumi preview).
- PolicyType string
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
- Ids []string
- A list of Resource Manager Policy IDs.
- NameRegex string
- A regex string to filter results by policy name.
- OutputFile string
- File name where to save data source results (after running pulumi preview).
- PolicyType string
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
- ids List<String>
- A list of Resource Manager Policy IDs.
- nameRegex String
- A regex string to filter results by policy name.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- policyType String
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
- ids string[]
- A list of Resource Manager Policy IDs.
- nameRegex string
- A regex string to filter results by policy name.
- outputFile string
- File name where to save data source results (after running pulumi preview).
- policyType string
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
- 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
- File name where to save data source results (after running pulumi preview).
- policy_type str
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
- ids List<String>
- A list of Resource Manager Policy IDs.
- nameRegex String
- A regex string to filter results by policy name.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- policyType String
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
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.Ali Cloud. Resource Manager. Outputs. Get Policies Policy> 
- A list of policies. Each element contains the following attributes:
- NameRegex string
- OutputFile string
- PolicyType string
- The type of the policy.
- 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
[]GetPolicies Policy 
- A list of policies. Each element contains the following attributes:
- NameRegex string
- OutputFile string
- PolicyType string
- The type of the policy.
- 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<GetPolicies Policy> 
- A list of policies. Each element contains the following attributes:
- nameRegex String
- outputFile String
- policyType String
- The type of the policy.
- 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
GetPolicies Policy[] 
- A list of policies. Each element contains the following attributes:
- nameRegex string
- outputFile string
- policyType string
- The type of the policy.
- 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[GetPolicies Policy] 
- A list of policies. Each element contains the following attributes:
- name_regex str
- output_file str
- policy_type str
- The type of the policy.
- 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
- The type of the policy.
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.
- PolicyName string
- The name of the policy.
- PolicyType string
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
- 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.
- PolicyName string
- The name of the policy.
- PolicyType string
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
- 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.
- policyName String
- The name of the policy.
- policyType String
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
- 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.
- policyName string
- The name of the policy.
- policyType string
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
- 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 str
- The name of the policy.
- policy_type str
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
- 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.
- policyName String
- The name of the policy.
- policyType String
- The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values: CustomandSystem.
- updateDate String
- The time when the policy was updated.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the alicloudTerraform Provider.