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:
- Load
Balancer stringId ID of the SLB with attachments.
- Instance
Ids List<string> List of attached ECS instance IDs.
- Output
File string
- Load
Balancer stringId ID of the SLB with attachments.
- Instance
Ids []string List of attached ECS instance IDs.
- Output
File string
- load
Balancer stringId ID of the SLB with attachments.
- instance
Ids string[] List of attached ECS instance IDs.
- output
File string
- load_
balancer_ strid 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.
- Load
Balancer stringId - Slb
Attachments List<Pulumi.Ali Cloud. Slb. Outputs. Get Attachments Slb Attachment> A list of SLB attachments. Each element contains the following attributes:
- Instance
Ids List<string> - Output
File string
- Id string
The provider-assigned unique ID for this managed resource.
- Load
Balancer stringId - Slb
Attachments []GetAttachments Slb Attachment A list of SLB attachments. Each element contains the following attributes:
- Instance
Ids []string - Output
File string
- id string
The provider-assigned unique ID for this managed resource.
- load
Balancer stringId - slb
Attachments GetAttachments Slb Attachment[] A list of SLB attachments. Each element contains the following attributes:
- instance
Ids string[] - output
File string
- id str
The provider-assigned unique ID for this managed resource.
- load_
balancer_ strid - slb_
attachments List[GetAttachments Slb Attachment] 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.
- Instance
Id string ID of the attached ECS instance.
- Weight int
Weight associated to the ECS instance.
- Instance
Id string ID of the attached ECS instance.
- Weight int
Weight associated to the ECS instance.
- instance
Id 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
alicloudTerraform Provider.