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.
- Name
Regex string A regex string to filter results by policy name.
- Output
File string - Policy
Type 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.
- Name
Regex string A regex string to filter results by policy name.
- Output
File string - Policy
Type 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.
- name
Regex string A regex string to filter results by policy name.
- output
File string - policy
Type 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[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:
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:
- Name
Regex string - Output
File string - Policy
Type 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
[]Get
Policies Policy A list of policies. Each element contains the following attributes:
- Name
Regex string - Output
File string - Policy
Type 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
Get
Policies Policy[] A list of policies. Each element contains the following attributes:
- name
Regex string - output
File string - policy
Type 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[Get
Policies Policy] 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.
- Attachment
Count int The number of times the policy is referenced.
- Create
Date string The time when the policy was created.
- Default
Version 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.- Policy
Name string - Policy
Type string The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values:
CustomandSystem.- Update
Date string The time when the policy was updated.
- Attachment
Count int The number of times the policy is referenced.
- Create
Date string The time when the policy was created.
- Default
Version 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.- Policy
Name string - Policy
Type string The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values:
CustomandSystem.- Update
Date string The time when the policy was updated.
- attachment
Count number The number of times the policy is referenced.
- create
Date string The time when the policy was created.
- default
Version 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.- policy
Name string - policy
Type string The type of the policy. If you do not specify this parameter, the system lists all types of policies. Valid values:
CustomandSystem.- update
Date 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:
CustomandSystem.- 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
alicloudTerraform Provider.