Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getPolicyAttachments

This data source provides the Resource Manager Policy Attachments of the current Alibaba Cloud user.

NOTE: Available in 1.93.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.ResourceManager.GetPolicyAttachments.InvokeAsync());
        this.FirstAttachmentId = example.Apply(example => example.Attachments?[0]?.Id);
    }

    [Output("firstAttachmentId")]
    public Output<string> FirstAttachmentId { get; set; }
}
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
	})
}
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()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.resourcemanager.get_policy_attachments()
pulumi.export("firstAttachmentId", example.attachments[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = pulumi.output(alicloud.resourcemanager.getPolicyAttachments());

export const firstAttachmentId = example.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.

OutputFile string
PolicyName string

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

PolicyType string

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

PrincipalName string

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

PrincipalType 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.

ResourceGroupId string

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.

OutputFile string
PolicyName string

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

PolicyType string

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

PrincipalName string

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

PrincipalType 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.

ResourceGroupId string

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.

outputFile String
policyName String

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

policyType String

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

principalName String

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

principalType 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.

resourceGroupId String

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.

outputFile string
policyName string

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

policyType string

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

principalName string

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

principalType 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.

resourceGroupId string

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
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 and System.

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_id str

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.

outputFile String
policyName String

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

policyType String

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

principalName String

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

principalType 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.

resourceGroupId String

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.AliCloud.ResourceManager.Outputs.GetPolicyAttachmentsAttachment>

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
OutputFile string
PolicyName string
PolicyType string
PrincipalName string
PrincipalType string
ResourceGroupId string

The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.

Attachments []GetPolicyAttachmentsAttachment

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
OutputFile string
PolicyName string
PolicyType string
PrincipalName string
PrincipalType string
ResourceGroupId string

The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.

attachments List<GetPolicyAttachmentsAttachment>

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
outputFile String
policyName String
policyType String
principalName String
principalType String
resourceGroupId String

The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.

attachments GetPolicyAttachmentsAttachment[]

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
outputFile string
policyName string
policyType string
principalName string
principalType string
resourceGroupId string

The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.

attachments Sequence[GetPolicyAttachmentsAttachment]

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
policy_type str
principal_name str
principal_type str
resource_group_id str

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
outputFile String
policyName String
policyType String
principalName String
principalType String
resourceGroupId String

The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.

Supporting Types

GetPolicyAttachmentsAttachment

AttachDate 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- The name of the policy.
  • policy_type- The type of the policy.
  • principal_name- The name of the object to which the policy is attached.
  • principal_type- The type of the object to which the policy is attached.
PolicyName string

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

PolicyType string

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

PrincipalName string

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

PrincipalType 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.

ResourceGroupId string

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.

AttachDate 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- The name of the policy.
  • policy_type- The type of the policy.
  • principal_name- The name of the object to which the policy is attached.
  • principal_type- The type of the object to which the policy is attached.
PolicyName string

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

PolicyType string

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

PrincipalName string

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

PrincipalType 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.

ResourceGroupId string

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.

attachDate 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- The name of the policy.
  • policy_type- The type of the policy.
  • principal_name- The name of the object to which the policy is attached.
  • principal_type- The type of the object to which the policy is attached.
policyName String

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

policyType String

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

principalName String

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

principalType 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.

resourceGroupId String

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.

attachDate 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- The name of the policy.
  • policy_type- The type of the policy.
  • principal_name- The name of the object to which the policy is attached.
  • principal_type- The type of the object to which the policy is attached.
policyName string

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

policyType string

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

principalName string

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

principalType 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.

resourceGroupId string

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- The name of the policy.
  • policy_type- The type of the policy.
  • principal_name- The name of the object to which the policy is attached.
  • principal_type- The type of the object to which the policy is attached.
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 and System.

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_id str

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.

attachDate 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- The name of the policy.
  • policy_type- The type of the policy.
  • principal_name- The name of the object to which the policy is attached.
  • principal_type- The type of the object to which the policy is attached.
policyName String

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

policyType String

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

principalName String

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

principalType 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.

resourceGroupId String

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
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.