1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cen
  5. getInstanceAttachments
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.cen.getInstanceAttachments

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides Cen Instance Attachments of the current Alibaba Cloud User.

    NOTE: Available in v1.97.0+.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.cen.getInstanceAttachments({
        instanceId: "cen-o40h17ll9w********",
    });
    export const theFirstAttachmentedInstanceId = example.then(example => example.attachments?.[0]?.childInstanceId);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.cen.get_instance_attachments(instance_id="cen-o40h17ll9w********")
    pulumi.export("theFirstAttachmentedInstanceId", example.attachments[0].child_instance_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := cen.GetInstanceAttachments(ctx, &cen.GetInstanceAttachmentsArgs{
    			InstanceId: "cen-o40h17ll9w********",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("theFirstAttachmentedInstanceId", example.Attachments[0].ChildInstanceId)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.Cen.GetInstanceAttachments.Invoke(new()
        {
            InstanceId = "cen-o40h17ll9w********",
        });
    
        return new Dictionary<string, object?>
        {
            ["theFirstAttachmentedInstanceId"] = example.Apply(getInstanceAttachmentsResult => getInstanceAttachmentsResult.Attachments[0]?.ChildInstanceId),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cen.CenFunctions;
    import com.pulumi.alicloud.cen.inputs.GetInstanceAttachmentsArgs;
    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 = CenFunctions.getInstanceAttachments(GetInstanceAttachmentsArgs.builder()
                .instanceId("cen-o40h17ll9w********")
                .build());
    
            ctx.export("theFirstAttachmentedInstanceId", example.applyValue(getInstanceAttachmentsResult -> getInstanceAttachmentsResult.attachments()[0].childInstanceId()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:cen:getInstanceAttachments
          Arguments:
            instanceId: cen-o40h17ll9w********
    outputs:
      theFirstAttachmentedInstanceId: ${example.attachments[0].childInstanceId}
    

    Using getInstanceAttachments

    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 getInstanceAttachments(args: GetInstanceAttachmentsArgs, opts?: InvokeOptions): Promise<GetInstanceAttachmentsResult>
    function getInstanceAttachmentsOutput(args: GetInstanceAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetInstanceAttachmentsResult>
    def get_instance_attachments(child_instance_region_id: Optional[str] = None,
                                 child_instance_type: Optional[str] = None,
                                 instance_id: Optional[str] = None,
                                 output_file: Optional[str] = None,
                                 status: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetInstanceAttachmentsResult
    def get_instance_attachments_output(child_instance_region_id: Optional[pulumi.Input[str]] = None,
                                 child_instance_type: Optional[pulumi.Input[str]] = None,
                                 instance_id: Optional[pulumi.Input[str]] = None,
                                 output_file: Optional[pulumi.Input[str]] = None,
                                 status: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetInstanceAttachmentsResult]
    func GetInstanceAttachments(ctx *Context, args *GetInstanceAttachmentsArgs, opts ...InvokeOption) (*GetInstanceAttachmentsResult, error)
    func GetInstanceAttachmentsOutput(ctx *Context, args *GetInstanceAttachmentsOutputArgs, opts ...InvokeOption) GetInstanceAttachmentsResultOutput

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

    public static class GetInstanceAttachments 
    {
        public static Task<GetInstanceAttachmentsResult> InvokeAsync(GetInstanceAttachmentsArgs args, InvokeOptions? opts = null)
        public static Output<GetInstanceAttachmentsResult> Invoke(GetInstanceAttachmentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstanceAttachmentsResult> getInstanceAttachments(GetInstanceAttachmentsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:cen/getInstanceAttachments:getInstanceAttachments
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    The ID of the CEN instance.
    ChildInstanceRegionId string
    The region to which the network to be queried belongs.
    ChildInstanceType string
    The type of the associated network. Valid values: VPC, VBR and CCN.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.
    InstanceId string
    The ID of the CEN instance.
    ChildInstanceRegionId string
    The region to which the network to be queried belongs.
    ChildInstanceType string
    The type of the associated network. Valid values: VPC, VBR and CCN.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.
    instanceId String
    The ID of the CEN instance.
    childInstanceRegionId String
    The region to which the network to be queried belongs.
    childInstanceType String
    The type of the associated network. Valid values: VPC, VBR and CCN.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.
    instanceId string
    The ID of the CEN instance.
    childInstanceRegionId string
    The region to which the network to be queried belongs.
    childInstanceType string
    The type of the associated network. Valid values: VPC, VBR and CCN.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status string
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.
    instance_id str
    The ID of the CEN instance.
    child_instance_region_id str
    The region to which the network to be queried belongs.
    child_instance_type str
    The type of the associated network. Valid values: VPC, VBR and CCN.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status str
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.
    instanceId String
    The ID of the CEN instance.
    childInstanceRegionId String
    The region to which the network to be queried belongs.
    childInstanceType String
    The type of the associated network. Valid values: VPC, VBR and CCN.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.

    getInstanceAttachments Result

    The following output properties are available:

    Attachments List<Pulumi.AliCloud.Cen.Outputs.GetInstanceAttachmentsAttachment>
    A list of CEN Instance Attachments. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of CEN Instance Attachment IDs.
    InstanceId string
    The ID of the CEN instance.
    ChildInstanceRegionId string
    The ID of the region to which the network belongs.
    ChildInstanceType string
    The type of the associated network.
    OutputFile string
    Status string
    The status of the network.
    Attachments []GetInstanceAttachmentsAttachment
    A list of CEN Instance Attachments. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of CEN Instance Attachment IDs.
    InstanceId string
    The ID of the CEN instance.
    ChildInstanceRegionId string
    The ID of the region to which the network belongs.
    ChildInstanceType string
    The type of the associated network.
    OutputFile string
    Status string
    The status of the network.
    attachments List<GetInstanceAttachmentsAttachment>
    A list of CEN Instance Attachments. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of CEN Instance Attachment IDs.
    instanceId String
    The ID of the CEN instance.
    childInstanceRegionId String
    The ID of the region to which the network belongs.
    childInstanceType String
    The type of the associated network.
    outputFile String
    status String
    The status of the network.
    attachments GetInstanceAttachmentsAttachment[]
    A list of CEN Instance Attachments. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of CEN Instance Attachment IDs.
    instanceId string
    The ID of the CEN instance.
    childInstanceRegionId string
    The ID of the region to which the network belongs.
    childInstanceType string
    The type of the associated network.
    outputFile string
    status string
    The status of the network.
    attachments Sequence[GetInstanceAttachmentsAttachment]
    A list of CEN Instance Attachments. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of CEN Instance Attachment IDs.
    instance_id str
    The ID of the CEN instance.
    child_instance_region_id str
    The ID of the region to which the network belongs.
    child_instance_type str
    The type of the associated network.
    output_file str
    status str
    The status of the network.
    attachments List<Property Map>
    A list of CEN Instance Attachments. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of CEN Instance Attachment IDs.
    instanceId String
    The ID of the CEN instance.
    childInstanceRegionId String
    The ID of the region to which the network belongs.
    childInstanceType String
    The type of the associated network.
    outputFile String
    status String
    The status of the network.

    Supporting Types

    GetInstanceAttachmentsAttachment

    ChildInstanceAttachTime string
    The time when the network is associated with the CEN instance.
    ChildInstanceId string
    The ID of the network.
    ChildInstanceOwnerId int
    The ID of the account to which the network belongs.
    ChildInstanceRegionId string
    The region to which the network to be queried belongs.
    ChildInstanceType string
    The type of the associated network. Valid values: VPC, VBR and CCN.
    Id string
    The ID of the CEN Instance Attachment.
    InstanceId string
    The ID of the CEN instance.
    Status string
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.
    ChildInstanceAttachTime string
    The time when the network is associated with the CEN instance.
    ChildInstanceId string
    The ID of the network.
    ChildInstanceOwnerId int
    The ID of the account to which the network belongs.
    ChildInstanceRegionId string
    The region to which the network to be queried belongs.
    ChildInstanceType string
    The type of the associated network. Valid values: VPC, VBR and CCN.
    Id string
    The ID of the CEN Instance Attachment.
    InstanceId string
    The ID of the CEN instance.
    Status string
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.
    childInstanceAttachTime String
    The time when the network is associated with the CEN instance.
    childInstanceId String
    The ID of the network.
    childInstanceOwnerId Integer
    The ID of the account to which the network belongs.
    childInstanceRegionId String
    The region to which the network to be queried belongs.
    childInstanceType String
    The type of the associated network. Valid values: VPC, VBR and CCN.
    id String
    The ID of the CEN Instance Attachment.
    instanceId String
    The ID of the CEN instance.
    status String
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.
    childInstanceAttachTime string
    The time when the network is associated with the CEN instance.
    childInstanceId string
    The ID of the network.
    childInstanceOwnerId number
    The ID of the account to which the network belongs.
    childInstanceRegionId string
    The region to which the network to be queried belongs.
    childInstanceType string
    The type of the associated network. Valid values: VPC, VBR and CCN.
    id string
    The ID of the CEN Instance Attachment.
    instanceId string
    The ID of the CEN instance.
    status string
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.
    child_instance_attach_time str
    The time when the network is associated with the CEN instance.
    child_instance_id str
    The ID of the network.
    child_instance_owner_id int
    The ID of the account to which the network belongs.
    child_instance_region_id str
    The region to which the network to be queried belongs.
    child_instance_type str
    The type of the associated network. Valid values: VPC, VBR and CCN.
    id str
    The ID of the CEN Instance Attachment.
    instance_id str
    The ID of the CEN instance.
    status str
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.
    childInstanceAttachTime String
    The time when the network is associated with the CEN instance.
    childInstanceId String
    The ID of the network.
    childInstanceOwnerId Number
    The ID of the account to which the network belongs.
    childInstanceRegionId String
    The region to which the network to be queried belongs.
    childInstanceType String
    The type of the associated network. Valid values: VPC, VBR and CCN.
    id String
    The ID of the CEN Instance Attachment.
    instanceId String
    The ID of the CEN instance.
    status String
    The status of the Cen Child Instance Attachment. Valid value: Attaching, Attached and Aetaching.

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi