get Policy Attachments
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)
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 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, &resourcemanager.GetPolicyAttachmentsArgs{}, nil)
if err != nil {
return err
}
ctx.Export("firstAttachmentId", example.Attachments[0].Id)
return nil
})
}
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}
Return
A collection of values returned by getPolicyAttachments.
Parameters
A collection of arguments for invoking getPolicyAttachments.
Return
A collection of values returned by getPolicyAttachments.
Parameters
The language that is used to return the description of the system policy. Valid values:en
: English, zh-CN
: Chinese, ja
: Japanese.
File name where to save data source results (after running pulumi preview
).
The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
The type of the policy. Valid values: Custom
and System
.
The name of the object to which the policy is attached.
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.
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.
See also
Return
A collection of values returned by getPolicyAttachments.
Parameters
Builder for com.pulumi.alicloud.resourcemanager.kotlin.inputs.GetPolicyAttachmentsPlainArgs.