GetAttachments

This data source provides the server load balancer attachments of the current Alibaba Cloud user.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var sampleDs = Output.Create(AliCloud.Slb.GetAttachments.InvokeAsync(new AliCloud.Slb.GetAttachmentsArgs
        {
            LoadBalancerId = alicloud_slb.Sample_slb.Id,
        }));
        this.FirstSlbAttachmentInstanceId = sampleDs.Apply(sampleDs => sampleDs.SlbAttachments[0].InstanceId);
    }

    [Output("firstSlbAttachmentInstanceId")]
    public Output<string> FirstSlbAttachmentInstanceId { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

sample_ds = alicloud.slb.get_attachments(load_balancer_id=alicloud_slb["sample_slb"]["id"])
pulumi.export("firstSlbAttachmentInstanceId", sample_ds.slb_attachments[0]["instance_id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const sampleDs = alicloud_slb_sample_slb.id.apply(id => alicloud.slb.getAttachments({
    loadBalancerId: id,
}, { async: true }));

export const firstSlbAttachmentInstanceId = sampleDs.slbAttachments[0].instanceId;

Using GetAttachments

function getAttachments(args: GetAttachmentsArgs, opts?: InvokeOptions): Promise<GetAttachmentsResult>
function  get_attachments(instance_ids=None, load_balancer_id=None, output_file=None, opts=None)
func GetAttachments(ctx *Context, args *GetAttachmentsArgs, opts ...InvokeOption) (*GetAttachmentsResult, error)
public static class GetAttachments {
    public static Task<GetAttachmentsResult> InvokeAsync(GetAttachmentsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

LoadBalancerId string

ID of the SLB with attachments.

InstanceIds List<string>

List of attached ECS instance IDs.

OutputFile string
LoadBalancerId string

ID of the SLB with attachments.

InstanceIds []string

List of attached ECS instance IDs.

OutputFile string
loadBalancerId string

ID of the SLB with attachments.

instanceIds string[]

List of attached ECS instance IDs.

outputFile string
load_balancer_id str

ID of the SLB with attachments.

instance_ids List[str]

List of attached ECS instance IDs.

output_file str

GetAttachments Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

LoadBalancerId string
SlbAttachments List<Pulumi.AliCloud.Slb.Outputs.GetAttachmentsSlbAttachment>

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

InstanceIds List<string>
OutputFile string
Id string

The provider-assigned unique ID for this managed resource.

LoadBalancerId string
SlbAttachments []GetAttachmentsSlbAttachment

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

InstanceIds []string
OutputFile string
id string

The provider-assigned unique ID for this managed resource.

loadBalancerId string
slbAttachments GetAttachmentsSlbAttachment[]

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

instanceIds string[]
outputFile string
id str

The provider-assigned unique ID for this managed resource.

load_balancer_id str
slb_attachments List[GetAttachmentsSlbAttachment]

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

instance_ids List[str]
output_file str

Supporting Types

GetAttachmentsSlbAttachment

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

InstanceId string

ID of the attached ECS instance.

Weight int

Weight associated to the ECS instance.

InstanceId string

ID of the attached ECS instance.

Weight int

Weight associated to the ECS instance.

instanceId string

ID of the attached ECS instance.

weight number

Weight associated to the ECS instance.

instance_id str

ID of the attached ECS instance.

weight float

Weight associated to the ECS 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.