Alibaba Cloud

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

getInstanceAttachments

Deprecated:

alicloud.oss.getInstanceAttachments has been deprecated in favor of alicloud.ots.getInstanceAttachments

This data source provides the ots instance attachments of the current Alibaba Cloud user.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var attachmentsDs = Output.Create(AliCloud.Ots.GetInstanceAttachments.InvokeAsync(new AliCloud.Ots.GetInstanceAttachmentsArgs
        {
            InstanceName = "sample-instance",
            NameRegex = "testvpc",
            OutputFile = "attachments.txt",
        }));
        this.FirstOtsAttachmentId = attachmentsDs.Apply(attachmentsDs => attachmentsDs.Attachments?[0]?.Id);
    }

    [Output("firstOtsAttachmentId")]
    public Output<string> FirstOtsAttachmentId { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		attachmentsDs, err := ots.GetInstanceAttachments(ctx, &ots.GetInstanceAttachmentsArgs{
			InstanceName: "sample-instance",
			NameRegex:    pulumi.StringRef("testvpc"),
			OutputFile:   pulumi.StringRef("attachments.txt"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstOtsAttachmentId", attachmentsDs.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.ots.OtsFunctions;
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 attachmentsDs = OtsFunctions.getInstanceAttachments(GetInstanceAttachmentsArgs.builder()
            .instanceName("sample-instance")
            .nameRegex("testvpc")
            .outputFile("attachments.txt")
            .build());

        ctx.export("firstOtsAttachmentId", attachmentsDs.applyValue(getInstanceAttachmentsResult -> getInstanceAttachmentsResult.attachments()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

attachments_ds = alicloud.ots.get_instance_attachments(instance_name="sample-instance",
    name_regex="testvpc",
    output_file="attachments.txt")
pulumi.export("firstOtsAttachmentId", attachments_ds.attachments[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const attachmentsDs = pulumi.output(alicloud.ots.getInstanceAttachments({
    instanceName: "sample-instance",
    nameRegex: "testvpc",
    outputFile: "attachments.txt",
}));

export const firstOtsAttachmentId = attachmentsDs.attachments[0].id;
variables:
  attachmentsDs:
    Fn::Invoke:
      Function: alicloud:ots:getInstanceAttachments
      Arguments:
        instanceName: sample-instance
        nameRegex: testvpc
        outputFile: attachments.txt
outputs:
  firstOtsAttachmentId: ${attachmentsDs.attachments[0].id}

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(instance_name: Optional[str] = None,
                             name_regex: Optional[str] = None,
                             output_file: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetInstanceAttachmentsResult
def get_instance_attachments_output(instance_name: Optional[pulumi.Input[str]] = None,
                             name_regex: Optional[pulumi.Input[str]] = None,
                             output_file: 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:oss/getInstanceAttachments:getInstanceAttachments
  Arguments:
    # Arguments dictionary

The following arguments are supported:

InstanceName string

The name of OTS instance.

NameRegex string

A regex string to filter results by vpc name.

OutputFile string
InstanceName string

The name of OTS instance.

NameRegex string

A regex string to filter results by vpc name.

OutputFile string
instanceName String

The name of OTS instance.

nameRegex String

A regex string to filter results by vpc name.

outputFile String
instanceName string

The name of OTS instance.

nameRegex string

A regex string to filter results by vpc name.

outputFile string
instance_name str

The name of OTS instance.

name_regex str

A regex string to filter results by vpc name.

output_file str
instanceName String

The name of OTS instance.

nameRegex String

A regex string to filter results by vpc name.

outputFile String

getInstanceAttachments Result

The following output properties are available:

Attachments List<Pulumi.AliCloud.Oss.Outputs.GetInstanceAttachmentsAttachment>

A list of instance attachments. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

InstanceName string

The instance name.

Names List<string>

A list of vpc names.

VpcIds List<string>

A list of vpc ids.

NameRegex string
OutputFile string
Attachments []GetInstanceAttachmentsAttachment

A list of instance attachments. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

InstanceName string

The instance name.

Names []string

A list of vpc names.

VpcIds []string

A list of vpc ids.

NameRegex string
OutputFile string
attachments List<GetInstanceAttachmentsAttachment>

A list of instance attachments. Each element contains the following attributes:

id String

The provider-assigned unique ID for this managed resource.

instanceName String

The instance name.

names List<String>

A list of vpc names.

vpcIds List<String>

A list of vpc ids.

nameRegex String
outputFile String
attachments GetInstanceAttachmentsAttachment[]

A list of instance attachments. Each element contains the following attributes:

id string

The provider-assigned unique ID for this managed resource.

instanceName string

The instance name.

names string[]

A list of vpc names.

vpcIds string[]

A list of vpc ids.

nameRegex string
outputFile string
attachments Sequence[GetInstanceAttachmentsAttachment]

A list of instance attachments. Each element contains the following attributes:

id str

The provider-assigned unique ID for this managed resource.

instance_name str

The instance name.

names Sequence[str]

A list of vpc names.

vpc_ids Sequence[str]

A list of vpc ids.

name_regex str
output_file str
attachments List<Property Map>

A list of instance attachments. Each element contains the following attributes:

id String

The provider-assigned unique ID for this managed resource.

instanceName String

The instance name.

names List<String>

A list of vpc names.

vpcIds List<String>

A list of vpc ids.

nameRegex String
outputFile String

Supporting Types

GetInstanceAttachmentsAttachment

Domain string

The domain of the instance attachment.

Endpoint string

The access endpoint of the instance attachment.

Id string

The resource ID, the value is same as "instance_name".

InstanceName string

The name of OTS instance.

Region string

The region of the instance attachment.

VpcId string

The ID of attaching VPC to instance.

VpcName string

The name of attaching VPC to instance.

Domain string

The domain of the instance attachment.

Endpoint string

The access endpoint of the instance attachment.

Id string

The resource ID, the value is same as "instance_name".

InstanceName string

The name of OTS instance.

Region string

The region of the instance attachment.

VpcId string

The ID of attaching VPC to instance.

VpcName string

The name of attaching VPC to instance.

domain String

The domain of the instance attachment.

endpoint String

The access endpoint of the instance attachment.

id String

The resource ID, the value is same as "instance_name".

instanceName String

The name of OTS instance.

region String

The region of the instance attachment.

vpcId String

The ID of attaching VPC to instance.

vpcName String

The name of attaching VPC to instance.

domain string

The domain of the instance attachment.

endpoint string

The access endpoint of the instance attachment.

id string

The resource ID, the value is same as "instance_name".

instanceName string

The name of OTS instance.

region string

The region of the instance attachment.

vpcId string

The ID of attaching VPC to instance.

vpcName string

The name of attaching VPC to instance.

domain str

The domain of the instance attachment.

endpoint str

The access endpoint of the instance attachment.

id str

The resource ID, the value is same as "instance_name".

instance_name str

The name of OTS instance.

region str

The region of the instance attachment.

vpc_id str

The ID of attaching VPC to instance.

vpc_name str

The name of attaching VPC to instance.

domain String

The domain of the instance attachment.

endpoint String

The access endpoint of the instance attachment.

id String

The resource ID, the value is same as "instance_name".

instanceName String

The name of OTS instance.

region String

The region of the instance attachment.

vpcId String

The ID of attaching VPC to instance.

vpcName String

The name of attaching VPC to instance.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.