getPolicyAttachments

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&#46;Apply(getPolicyAttachmentsResult => getPolicyAttachmentsResult&#46;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

argument

A collection of arguments for invoking getPolicyAttachments.


suspend fun getPolicyAttachments(language: String? = null, outputFile: String? = null, policyName: String? = null, policyType: String? = null, principalName: String? = null, principalType: String? = null, resourceGroupId: String? = null): GetPolicyAttachmentsResult

Return

A collection of values returned by getPolicyAttachments.

Parameters

language

The language that is used to return the description of the system policy. Valid values:en: English, zh-CN: Chinese, ja: Japanese.

outputFile

File name where to save data source results (after running pulumi preview).

policyName

The name of the policy. The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).

policyType

The type of the policy. Valid values: Custom and System.

principalName

The name of the object to which the policy is attached.

principalType

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.

resourceGroupId

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

argument

Builder for com.pulumi.alicloud.resourcemanager.kotlin.inputs.GetPolicyAttachmentsPlainArgs.

See also