1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. resourcemanager
  5. getControlPolicyAttachments
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.resourcemanager.getControlPolicyAttachments

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

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

    NOTE: Available in v1.120.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.resourcemanager.getControlPolicyAttachments({
        targetId: "example_value",
    });
    export const firstResourceManagerControlPolicyAttachmentId = example.then(example => example.attachments?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.resourcemanager.get_control_policy_attachments(target_id="example_value")
    pulumi.export("firstResourceManagerControlPolicyAttachmentId", 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.GetControlPolicyAttachments(ctx, &resourcemanager.GetControlPolicyAttachmentsArgs{
    			TargetId: "example_value",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstResourceManagerControlPolicyAttachmentId", 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.GetControlPolicyAttachments.Invoke(new()
        {
            TargetId = "example_value",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstResourceManagerControlPolicyAttachmentId"] = example.Apply(getControlPolicyAttachmentsResult => getControlPolicyAttachmentsResult.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.GetControlPolicyAttachmentsArgs;
    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.getControlPolicyAttachments(GetControlPolicyAttachmentsArgs.builder()
                .targetId("example_value")
                .build());
    
            ctx.export("firstResourceManagerControlPolicyAttachmentId", example.applyValue(getControlPolicyAttachmentsResult -> getControlPolicyAttachmentsResult.attachments()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:resourcemanager:getControlPolicyAttachments
          Arguments:
            targetId: example_value
    outputs:
      firstResourceManagerControlPolicyAttachmentId: ${example.attachments[0].id}
    

    Using getControlPolicyAttachments

    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 getControlPolicyAttachments(args: GetControlPolicyAttachmentsArgs, opts?: InvokeOptions): Promise<GetControlPolicyAttachmentsResult>
    function getControlPolicyAttachmentsOutput(args: GetControlPolicyAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetControlPolicyAttachmentsResult>
    def get_control_policy_attachments(language: Optional[str] = None,
                                       output_file: Optional[str] = None,
                                       policy_type: Optional[str] = None,
                                       target_id: Optional[str] = None,
                                       opts: Optional[InvokeOptions] = None) -> GetControlPolicyAttachmentsResult
    def get_control_policy_attachments_output(language: Optional[pulumi.Input[str]] = None,
                                       output_file: Optional[pulumi.Input[str]] = None,
                                       policy_type: Optional[pulumi.Input[str]] = None,
                                       target_id: Optional[pulumi.Input[str]] = None,
                                       opts: Optional[InvokeOptions] = None) -> Output[GetControlPolicyAttachmentsResult]
    func GetControlPolicyAttachments(ctx *Context, args *GetControlPolicyAttachmentsArgs, opts ...InvokeOption) (*GetControlPolicyAttachmentsResult, error)
    func GetControlPolicyAttachmentsOutput(ctx *Context, args *GetControlPolicyAttachmentsOutputArgs, opts ...InvokeOption) GetControlPolicyAttachmentsResultOutput

    > Note: This function is named GetControlPolicyAttachments in the Go SDK.

    public static class GetControlPolicyAttachments 
    {
        public static Task<GetControlPolicyAttachmentsResult> InvokeAsync(GetControlPolicyAttachmentsArgs args, InvokeOptions? opts = null)
        public static Output<GetControlPolicyAttachmentsResult> Invoke(GetControlPolicyAttachmentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetControlPolicyAttachmentsResult> getControlPolicyAttachments(GetControlPolicyAttachmentsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:resourcemanager/getControlPolicyAttachments:getControlPolicyAttachments
      arguments:
        # arguments dictionary

    The following arguments are supported:

    TargetId string
    The Id of target.
    Language string
    The language. Valid value zh-CN, en, and ja. Default value zh-CN
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PolicyType string
    The policy type of control policy. Valid values: Custom and System.
    TargetId string
    The Id of target.
    Language string
    The language. Valid value zh-CN, en, and ja. Default value zh-CN
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PolicyType string
    The policy type of control policy. Valid values: Custom and System.
    targetId String
    The Id of target.
    language String
    The language. Valid value zh-CN, en, and ja. Default value zh-CN
    outputFile String
    File name where to save data source results (after running pulumi preview).
    policyType String
    The policy type of control policy. Valid values: Custom and System.
    targetId string
    The Id of target.
    language string
    The language. Valid value zh-CN, en, and ja. Default value zh-CN
    outputFile string
    File name where to save data source results (after running pulumi preview).
    policyType string
    The policy type of control policy. Valid values: Custom and System.
    target_id str
    The Id of target.
    language str
    The language. Valid value zh-CN, en, and ja. Default value zh-CN
    output_file str
    File name where to save data source results (after running pulumi preview).
    policy_type str
    The policy type of control policy. Valid values: Custom and System.
    targetId String
    The Id of target.
    language String
    The language. Valid value zh-CN, en, and ja. Default value zh-CN
    outputFile String
    File name where to save data source results (after running pulumi preview).
    policyType String
    The policy type of control policy. Valid values: Custom and System.

    getControlPolicyAttachments Result

    The following output properties are available:

    Attachments List<Pulumi.AliCloud.ResourceManager.Outputs.GetControlPolicyAttachmentsAttachment>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    TargetId string
    Language string
    OutputFile string
    PolicyType string
    Attachments []GetControlPolicyAttachmentsAttachment
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    TargetId string
    Language string
    OutputFile string
    PolicyType string
    attachments List<GetControlPolicyAttachmentsAttachment>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    targetId String
    language String
    outputFile String
    policyType String
    attachments GetControlPolicyAttachmentsAttachment[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    targetId string
    language string
    outputFile string
    policyType string
    attachments Sequence[GetControlPolicyAttachmentsAttachment]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    target_id str
    language str
    output_file str
    policy_type str
    attachments List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    targetId String
    language String
    outputFile String
    policyType String

    Supporting Types

    GetControlPolicyAttachmentsAttachment

    AttachDate string
    The attach date.
    Description string
    The description of policy.
    Id string
    The ID of the Control Policy Attachment.
    PolicyId string
    The ID of policy.
    PolicyName string
    The name of policy.
    PolicyType string
    The type of policy.
    AttachDate string
    The attach date.
    Description string
    The description of policy.
    Id string
    The ID of the Control Policy Attachment.
    PolicyId string
    The ID of policy.
    PolicyName string
    The name of policy.
    PolicyType string
    The type of policy.
    attachDate String
    The attach date.
    description String
    The description of policy.
    id String
    The ID of the Control Policy Attachment.
    policyId String
    The ID of policy.
    policyName String
    The name of policy.
    policyType String
    The type of policy.
    attachDate string
    The attach date.
    description string
    The description of policy.
    id string
    The ID of the Control Policy Attachment.
    policyId string
    The ID of policy.
    policyName string
    The name of policy.
    policyType string
    The type of policy.
    attach_date str
    The attach date.
    description str
    The description of policy.
    id str
    The ID of the Control Policy Attachment.
    policy_id str
    The ID of policy.
    policy_name str
    The name of policy.
    policy_type str
    The type of policy.
    attachDate String
    The attach date.
    description String
    The description of policy.
    id String
    The ID of the Control Policy Attachment.
    policyId String
    The ID of policy.
    policyName String
    The name of policy.
    policyType String
    The type of policy.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi