Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi
alicloud.resourcemanager.getPolicyAttachments
Explore with Pulumi AI
This data source provides the Resource Manager Policy Attachments of the current Alibaba Cloud user.
NOTE: Available in 1.93.0+.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.resourcemanager.getPolicyAttachments({});
export const firstAttachmentId = example.then(example => example.attachments?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.resourcemanager.get_policy_attachments()
pulumi.export("firstAttachmentId", example.attachments[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.GetPolicyAttachments(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("firstAttachmentId", example.Attachments[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.GetPolicyAttachments.Invoke();
return new Dictionary<string, object?>
{
["firstAttachmentId"] = example.Apply(getPolicyAttachmentsResult => getPolicyAttachmentsResult.Attachments[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.GetPolicyAttachmentsArgs;
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.getPolicyAttachments();
ctx.export("firstAttachmentId", example.applyValue(getPolicyAttachmentsResult -> getPolicyAttachmentsResult.attachments()[0].id()));
}
}
variables:
example:
fn::invoke:
Function: alicloud:resourcemanager:getPolicyAttachments
Arguments: {}
outputs:
firstAttachmentId: ${example.attachments[0].id}
Using getPolicyAttachments
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 getPolicyAttachments(args: GetPolicyAttachmentsArgs, opts?: InvokeOptions): Promise<GetPolicyAttachmentsResult>
function getPolicyAttachmentsOutput(args: GetPolicyAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetPolicyAttachmentsResult>
def get_policy_attachments(language: Optional[str] = None,
output_file: Optional[str] = None,
policy_name: Optional[str] = None,
policy_type: Optional[str] = None,
principal_name: Optional[str] = None,
principal_type: Optional[str] = None,
resource_group_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPolicyAttachmentsResult
def get_policy_attachments_output(language: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
policy_name: Optional[pulumi.Input[str]] = None,
policy_type: Optional[pulumi.Input[str]] = None,
principal_name: Optional[pulumi.Input[str]] = None,
principal_type: Optional[pulumi.Input[str]] = None,
resource_group_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPolicyAttachmentsResult]
func GetPolicyAttachments(ctx *Context, args *GetPolicyAttachmentsArgs, opts ...InvokeOption) (*GetPolicyAttachmentsResult, error)
func GetPolicyAttachmentsOutput(ctx *Context, args *GetPolicyAttachmentsOutputArgs, opts ...InvokeOption) GetPolicyAttachmentsResultOutput
> Note: This function is named GetPolicyAttachments
in the Go SDK.
public static class GetPolicyAttachments
{
public static Task<GetPolicyAttachmentsResult> InvokeAsync(GetPolicyAttachmentsArgs args, InvokeOptions? opts = null)
public static Output<GetPolicyAttachmentsResult> Invoke(GetPolicyAttachmentsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPolicyAttachmentsResult> getPolicyAttachments(GetPolicyAttachmentsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:resourcemanager/getPolicyAttachments:getPolicyAttachments
arguments:
# arguments dictionary
The following arguments are supported:
- Language string
- The language that is used to return the description of the system policy. Valid values:
en
: English,zh-CN
: Chinese,ja
: Japanese. - Output
File string - File name where to save data source results (after running
pulumi preview
). - Policy
Name string - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- Policy
Type string - The type of the policy. Valid values:
Custom
andSystem
. - Principal
Name string - The name of the object to which the policy is attached.
- Principal
Type string - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - Resource
Group stringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
- Language string
- The language that is used to return the description of the system policy. Valid values:
en
: English,zh-CN
: Chinese,ja
: Japanese. - Output
File string - File name where to save data source results (after running
pulumi preview
). - Policy
Name string - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- Policy
Type string - The type of the policy. Valid values:
Custom
andSystem
. - Principal
Name string - The name of the object to which the policy is attached.
- Principal
Type string - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - Resource
Group stringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
- language String
- The language that is used to return the description of the system policy. Valid values:
en
: English,zh-CN
: Chinese,ja
: Japanese. - output
File String - File name where to save data source results (after running
pulumi preview
). - policy
Name String - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- policy
Type String - The type of the policy. Valid values:
Custom
andSystem
. - principal
Name String - The name of the object to which the policy is attached.
- principal
Type String - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - resource
Group StringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
- language string
- The language that is used to return the description of the system policy. Valid values:
en
: English,zh-CN
: Chinese,ja
: Japanese. - output
File string - File name where to save data source results (after running
pulumi preview
). - policy
Name string - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- policy
Type string - The type of the policy. Valid values:
Custom
andSystem
. - principal
Name string - The name of the object to which the policy is attached.
- principal
Type string - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - resource
Group stringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
- language str
- The language that is used to return the description of the system policy. Valid values:
en
: English,zh-CN
: Chinese,ja
: Japanese. - output_
file str - File name where to save data source results (after running
pulumi preview
). - policy_
name str - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- policy_
type str - The type of the policy. Valid values:
Custom
andSystem
. - principal_
name str - The name of the object to which the policy is attached.
- principal_
type str - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - resource_
group_ strid - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
- language String
- The language that is used to return the description of the system policy. Valid values:
en
: English,zh-CN
: Chinese,ja
: Japanese. - output
File String - File name where to save data source results (after running
pulumi preview
). - policy
Name String - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- policy
Type String - The type of the policy. Valid values:
Custom
andSystem
. - principal
Name String - The name of the object to which the policy is attached.
- principal
Type String - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - resource
Group StringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
getPolicyAttachments Result
The following output properties are available:
- Attachments
List<Pulumi.
Ali Cloud. Resource Manager. Outputs. Get Policy Attachments Attachment> - A list of Resource Manager Policy Attachment. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of Resource Manager Policy Attachment IDs.
- Language string
- Output
File string - Policy
Name string - The name of the policy.
- Policy
Type string - The type of the policy.
- Principal
Name string - The name of the object to which the policy is attached.
- Principal
Type string - The type of the object to which the policy is attached.
- Resource
Group stringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
- Attachments
[]Get
Policy Attachments Attachment - A list of Resource Manager Policy Attachment. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of Resource Manager Policy Attachment IDs.
- Language string
- Output
File string - Policy
Name string - The name of the policy.
- Policy
Type string - The type of the policy.
- Principal
Name string - The name of the object to which the policy is attached.
- Principal
Type string - The type of the object to which the policy is attached.
- Resource
Group stringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
- attachments
List<Get
Policy Attachments Attachment> - A list of Resource Manager Policy Attachment. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Resource Manager Policy Attachment IDs.
- language String
- output
File String - policy
Name String - The name of the policy.
- policy
Type String - The type of the policy.
- principal
Name String - The name of the object to which the policy is attached.
- principal
Type String - The type of the object to which the policy is attached.
- resource
Group StringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
- attachments
Get
Policy Attachments Attachment[] - A list of Resource Manager Policy Attachment. Each element contains the following attributes:
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of Resource Manager Policy Attachment IDs.
- language string
- output
File string - policy
Name string - The name of the policy.
- policy
Type string - The type of the policy.
- principal
Name string - The name of the object to which the policy is attached.
- principal
Type string - The type of the object to which the policy is attached.
- resource
Group stringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
- attachments
Sequence[Get
Policy Attachments Attachment] - A list of Resource Manager Policy Attachment. Each element contains the following attributes:
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of Resource Manager Policy Attachment IDs.
- language str
- output_
file str - policy_
name str - The name of the policy.
- policy_
type str - The type of the policy.
- principal_
name str - The name of the object to which the policy is attached.
- principal_
type str - The type of the object to which the policy is attached.
- resource_
group_ strid - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
- attachments List<Property Map>
- A list of Resource Manager Policy Attachment. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of Resource Manager Policy Attachment IDs.
- language String
- output
File String - policy
Name String - The name of the policy.
- policy
Type String - The type of the policy.
- principal
Name String - The name of the object to which the policy is attached.
- principal
Type String - The type of the object to which the policy is attached.
- resource
Group StringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
Supporting Types
GetPolicyAttachmentsAttachment
- Attach
Date string - The time when the policy was attached.
- Description string
- The description of the policy.
- Id string
- The ID of the Resource Manager Policy Attachment.
- Policy
Name string - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- Policy
Type string - The type of the policy. Valid values:
Custom
andSystem
. - Principal
Name string - The name of the object to which the policy is attached.
- Principal
Type string - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - Resource
Group stringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
- Attach
Date string - The time when the policy was attached.
- Description string
- The description of the policy.
- Id string
- The ID of the Resource Manager Policy Attachment.
- Policy
Name string - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- Policy
Type string - The type of the policy. Valid values:
Custom
andSystem
. - Principal
Name string - The name of the object to which the policy is attached.
- Principal
Type string - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - Resource
Group stringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
- attach
Date String - The time when the policy was attached.
- description String
- The description of the policy.
- id String
- The ID of the Resource Manager Policy Attachment.
- policy
Name String - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- policy
Type String - The type of the policy. Valid values:
Custom
andSystem
. - principal
Name String - The name of the object to which the policy is attached.
- principal
Type String - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - resource
Group StringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
- attach
Date string - The time when the policy was attached.
- description string
- The description of the policy.
- id string
- The ID of the Resource Manager Policy Attachment.
- policy
Name string - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- policy
Type string - The type of the policy. Valid values:
Custom
andSystem
. - principal
Name string - The name of the object to which the policy is attached.
- principal
Type string - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - resource
Group stringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
- attach_
date str - The time when the policy was attached.
- description str
- The description of the policy.
- id str
- The ID of the Resource Manager Policy Attachment.
- policy_
name str - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- policy_
type str - The type of the policy. Valid values:
Custom
andSystem
. - principal_
name str - The name of the object to which the policy is attached.
- principal_
type str - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - resource_
group_ strid - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
- attach
Date String - The time when the policy was attached.
- description String
- The description of the policy.
- id String
- The ID of the Resource Manager Policy Attachment.
- policy
Name String - The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- policy
Type String - The type of the policy. Valid values:
Custom
andSystem
. - principal
Name String - The name of the object to which the policy is attached.
- principal
Type String - The type of the object to which the policy is attached. If you do not specify this parameter, the system lists all types of objects. Valid values:
IMSUser
: RAM user,IMSGroup
: RAM user group,ServiceRole
: RAM role. - resource
Group StringId - The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs. If you do not specify this parameter, the system lists all policy attachment records under the current account.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.