Alibaba Cloud v3.87.0 published on Saturday, Oct 18, 2025 by Pulumi
alicloud.resourcemanager.getControlPolicies
This data source provides the Resource Manager Control Policies of the current Alibaba Cloud user.
NOTE: Available in v1.120.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.resourcemanager.getControlPolicies({
ids: ["example_value"],
nameRegex: "the_resource_name",
});
export const firstResourceManagerControlPolicyId = example.then(example => example.policies?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.resourcemanager.get_control_policies(ids=["example_value"],
name_regex="the_resource_name")
pulumi.export("firstResourceManagerControlPolicyId", example.policies[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := resourcemanager.GetControlPolicies(ctx, &resourcemanager.GetControlPoliciesArgs{
Ids: []string{
"example_value",
},
NameRegex: pulumi.StringRef("the_resource_name"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstResourceManagerControlPolicyId", example.Policies[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = AliCloud.ResourceManager.GetControlPolicies.Invoke(new()
{
Ids = new[]
{
"example_value",
},
NameRegex = "the_resource_name",
});
return new Dictionary<string, object?>
{
["firstResourceManagerControlPolicyId"] = example.Apply(getControlPoliciesResult => getControlPoliciesResult.Policies[0]?.Id),
};
});
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.GetControlPoliciesArgs;
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.getControlPolicies(GetControlPoliciesArgs.builder()
.ids("example_value")
.nameRegex("the_resource_name")
.build());
ctx.export("firstResourceManagerControlPolicyId", example.policies()[0].id());
}
}
variables:
example:
fn::invoke:
function: alicloud:resourcemanager:getControlPolicies
arguments:
ids:
- example_value
nameRegex: the_resource_name
outputs:
firstResourceManagerControlPolicyId: ${example.policies[0].id}
Using getControlPolicies
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 getControlPolicies(args: GetControlPoliciesArgs, opts?: InvokeOptions): Promise<GetControlPoliciesResult>
function getControlPoliciesOutput(args: GetControlPoliciesOutputArgs, opts?: InvokeOptions): Output<GetControlPoliciesResult>
def get_control_policies(enable_details: Optional[bool] = None,
ids: Optional[Sequence[str]] = None,
language: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
policy_type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetControlPoliciesResult
def get_control_policies_output(enable_details: Optional[pulumi.Input[bool]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
language: Optional[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[GetControlPoliciesResult]
func GetControlPolicies(ctx *Context, args *GetControlPoliciesArgs, opts ...InvokeOption) (*GetControlPoliciesResult, error)
func GetControlPoliciesOutput(ctx *Context, args *GetControlPoliciesOutputArgs, opts ...InvokeOption) GetControlPoliciesResultOutput
> Note: This function is named GetControlPolicies
in the Go SDK.
public static class GetControlPolicies
{
public static Task<GetControlPoliciesResult> InvokeAsync(GetControlPoliciesArgs args, InvokeOptions? opts = null)
public static Output<GetControlPoliciesResult> Invoke(GetControlPoliciesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetControlPoliciesResult> getControlPolicies(GetControlPoliciesArgs args, InvokeOptions options)
public static Output<GetControlPoliciesResult> getControlPolicies(GetControlPoliciesArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:resourcemanager/getControlPolicies:getControlPolicies
arguments:
# arguments dictionary
The following arguments are supported:
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids List<string>
- A list of Control Policy IDs.
- Language string
- The language. Valid value
zh-CN
,en
, andja
. Default valuezh-CN
. - Name
Regex string - A regex string to filter results by Control Policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Policy
Type string - The policy type of control policy. Valid values
System
andCustom
.
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids []string
- A list of Control Policy IDs.
- Language string
- The language. Valid value
zh-CN
,en
, andja
. Default valuezh-CN
. - Name
Regex string - A regex string to filter results by Control Policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Policy
Type string - The policy type of control policy. Valid values
System
andCustom
.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of Control Policy IDs.
- language String
- The language. Valid value
zh-CN
,en
, andja
. Default valuezh-CN
. - name
Regex String - A regex string to filter results by Control Policy name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - policy
Type String - The policy type of control policy. Valid values
System
andCustom
.
- enable
Details boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids string[]
- A list of Control Policy IDs.
- language string
- The language. Valid value
zh-CN
,en
, andja
. Default valuezh-CN
. - name
Regex string - A regex string to filter results by Control Policy name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - policy
Type string - The policy type of control policy. Valid values
System
andCustom
.
- enable_
details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - ids Sequence[str]
- A list of Control Policy IDs.
- language str
- The language. Valid value
zh-CN
,en
, andja
. Default valuezh-CN
. - name_
regex str - A regex string to filter results by Control Policy name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - policy_
type str - The policy type of control policy. Valid values
System
andCustom
.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of Control Policy IDs.
- language String
- The language. Valid value
zh-CN
,en
, andja
. Default valuezh-CN
. - name
Regex String - A regex string to filter results by Control Policy name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - policy
Type String - The policy type of control policy. Valid values
System
andCustom
.
getControlPolicies Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Policies
List<Pulumi.
Ali Cloud. Resource Manager. Outputs. Get Control Policies Policy> - Enable
Details bool - Language string
- Name
Regex string - Output
File string - Policy
Type string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Policies
[]Get
Control Policies Policy - Enable
Details bool - Language string
- Name
Regex string - Output
File string - Policy
Type string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- policies
List<Get
Control Policies Policy> - enable
Details Boolean - language String
- name
Regex String - output
File String - policy
Type String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- policies
Get
Control Policies Policy[] - enable
Details boolean - language string
- name
Regex string - output
File string - policy
Type string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- policies
Sequence[Get
Control Policies Policy] - enable_
details bool - language str
- name_
regex str - output_
file str - policy_
type str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- policies List<Property Map>
- enable
Details Boolean - language String
- name
Regex String - output
File String - policy
Type String
Supporting Types
GetControlPoliciesPolicy
- Attachment
Count int - The count of policy attachment.
- Control
Policy stringName - The name of policy.
- Description string
- The description of policy.
- Effect
Scope string - The effect scope.
- Id string
- The ID of the Control Policy.
- Policy
Document string - The policy document.
- Policy
Id string - The ID of policy.
- Policy
Type string - The type of policy.
- Attachment
Count int - The count of policy attachment.
- Control
Policy stringName - The name of policy.
- Description string
- The description of policy.
- Effect
Scope string - The effect scope.
- Id string
- The ID of the Control Policy.
- Policy
Document string - The policy document.
- Policy
Id string - The ID of policy.
- Policy
Type string - The type of policy.
- attachment
Count Integer - The count of policy attachment.
- control
Policy StringName - The name of policy.
- description String
- The description of policy.
- effect
Scope String - The effect scope.
- id String
- The ID of the Control Policy.
- policy
Document String - The policy document.
- policy
Id String - The ID of policy.
- policy
Type String - The type of policy.
- attachment
Count number - The count of policy attachment.
- control
Policy stringName - The name of policy.
- description string
- The description of policy.
- effect
Scope string - The effect scope.
- id string
- The ID of the Control Policy.
- policy
Document string - The policy document.
- policy
Id string - The ID of policy.
- policy
Type string - The type of policy.
- attachment_
count int - The count of policy attachment.
- control_
policy_ strname - The name of policy.
- description str
- The description of policy.
- effect_
scope str - The effect scope.
- id str
- The ID of the Control Policy.
- policy_
document str - The policy document.
- policy_
id str - The ID of policy.
- policy_
type str - The type of policy.
- attachment
Count Number - The count of policy attachment.
- control
Policy StringName - The name of policy.
- description String
- The description of policy.
- effect
Scope String - The effect scope.
- id String
- The ID of the Control Policy.
- policy
Document String - The policy document.
- policy
Id String - The ID of policy.
- policy
Type String - The type of policy.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.