1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cen
  5. getInstanceAttachments
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.cen.getInstanceAttachments

Explore with Pulumi AI

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);
Copy
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)
Copy
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
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: alicloud:cen:getInstanceAttachments
      arguments:
        instanceId: cen-o40h17ll9w********
outputs:
  theFirstAttachmentedInstanceId: ${example.attachments[0].childInstanceId}
Copy

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>
Copy
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]
Copy
func GetInstanceAttachments(ctx *Context, args *GetInstanceAttachmentsArgs, opts ...InvokeOption) (*GetInstanceAttachmentsResult, error)
func GetInstanceAttachmentsOutput(ctx *Context, args *GetInstanceAttachmentsOutputArgs, opts ...InvokeOption) GetInstanceAttachmentsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetInstanceAttachmentsResult> getInstanceAttachments(GetInstanceAttachmentsArgs args, InvokeOptions options)
public static Output<GetInstanceAttachmentsResult> getInstanceAttachments(GetInstanceAttachmentsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:cen/getInstanceAttachments:getInstanceAttachments
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

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