1. Packages
  2. Ucloud Provider
  3. API Docs
  4. getLbAttachments
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.getLbAttachments

Explore with Pulumi AI

This data source provides a list of Load Balancer Attachment resources according to their Load Balancer Attachment ID.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as ucloud from "@pulumi/ucloud";

const example = ucloud.getLbAttachments({
    loadBalancerId: "ulb-xxx",
    listenerId: "vserver-xxx",
});
export const first = example.then(example => example.lbAttachments?.[0]?.id);
Copy
import pulumi
import pulumi_ucloud as ucloud

example = ucloud.get_lb_attachments(load_balancer_id="ulb-xxx",
    listener_id="vserver-xxx")
pulumi.export("first", example.lb_attachments[0].id)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := ucloud.GetLbAttachments(ctx, &ucloud.GetLbAttachmentsArgs{
			LoadBalancerId: "ulb-xxx",
			ListenerId:     "vserver-xxx",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("first", example.LbAttachments[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ucloud = Pulumi.Ucloud;

return await Deployment.RunAsync(() => 
{
    var example = Ucloud.GetLbAttachments.Invoke(new()
    {
        LoadBalancerId = "ulb-xxx",
        ListenerId = "vserver-xxx",
    });

    return new Dictionary<string, object?>
    {
        ["first"] = example.Apply(getLbAttachmentsResult => getLbAttachmentsResult.LbAttachments[0]?.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ucloud.UcloudFunctions;
import com.pulumi.ucloud.inputs.GetLbAttachmentsArgs;
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 = UcloudFunctions.getLbAttachments(GetLbAttachmentsArgs.builder()
            .loadBalancerId("ulb-xxx")
            .listenerId("vserver-xxx")
            .build());

        ctx.export("first", example.applyValue(getLbAttachmentsResult -> getLbAttachmentsResult.lbAttachments()[0].id()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ucloud:getLbAttachments
      arguments:
        loadBalancerId: ulb-xxx
        listenerId: vserver-xxx
outputs:
  first: ${example.lbAttachments[0].id}
Copy

Using getLbAttachments

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 getLbAttachments(args: GetLbAttachmentsArgs, opts?: InvokeOptions): Promise<GetLbAttachmentsResult>
function getLbAttachmentsOutput(args: GetLbAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetLbAttachmentsResult>
Copy
def get_lb_attachments(id: Optional[str] = None,
                       ids: Optional[Sequence[str]] = None,
                       listener_id: Optional[str] = None,
                       load_balancer_id: Optional[str] = None,
                       output_file: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetLbAttachmentsResult
def get_lb_attachments_output(id: Optional[pulumi.Input[str]] = None,
                       ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                       listener_id: Optional[pulumi.Input[str]] = None,
                       load_balancer_id: Optional[pulumi.Input[str]] = None,
                       output_file: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetLbAttachmentsResult]
Copy
func GetLbAttachments(ctx *Context, args *GetLbAttachmentsArgs, opts ...InvokeOption) (*GetLbAttachmentsResult, error)
func GetLbAttachmentsOutput(ctx *Context, args *GetLbAttachmentsOutputArgs, opts ...InvokeOption) GetLbAttachmentsResultOutput
Copy

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

public static class GetLbAttachments 
{
    public static Task<GetLbAttachmentsResult> InvokeAsync(GetLbAttachmentsArgs args, InvokeOptions? opts = null)
    public static Output<GetLbAttachmentsResult> Invoke(GetLbAttachmentsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetLbAttachmentsResult> getLbAttachments(GetLbAttachmentsArgs args, InvokeOptions options)
public static Output<GetLbAttachmentsResult> getLbAttachments(GetLbAttachmentsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: ucloud:index/getLbAttachments:getLbAttachments
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ListenerId This property is required. string
The ID of a listener server.
LoadBalancerId This property is required. string
The ID of a load balancer.
Id string
The ID of LB Attachment.
Ids List<string>
A list of LB Attachment IDs, all the LB Attachments belong to the Load Balancer listener will be retrieved if the ID is [].
OutputFile string
File name where to save data source results (after running pulumi preview).
ListenerId This property is required. string
The ID of a listener server.
LoadBalancerId This property is required. string
The ID of a load balancer.
Id string
The ID of LB Attachment.
Ids []string
A list of LB Attachment IDs, all the LB Attachments belong to the Load Balancer listener will be retrieved if the ID is [].
OutputFile string
File name where to save data source results (after running pulumi preview).
listenerId This property is required. String
The ID of a listener server.
loadBalancerId This property is required. String
The ID of a load balancer.
id String
The ID of LB Attachment.
ids List<String>
A list of LB Attachment IDs, all the LB Attachments belong to the Load Balancer listener will be retrieved if the ID is [].
outputFile String
File name where to save data source results (after running pulumi preview).
listenerId This property is required. string
The ID of a listener server.
loadBalancerId This property is required. string
The ID of a load balancer.
id string
The ID of LB Attachment.
ids string[]
A list of LB Attachment IDs, all the LB Attachments belong to the Load Balancer listener will be retrieved if the ID is [].
outputFile string
File name where to save data source results (after running pulumi preview).
listener_id This property is required. str
The ID of a listener server.
load_balancer_id This property is required. str
The ID of a load balancer.
id str
The ID of LB Attachment.
ids Sequence[str]
A list of LB Attachment IDs, all the LB Attachments belong to the Load Balancer listener will be retrieved if the ID is [].
output_file str
File name where to save data source results (after running pulumi preview).
listenerId This property is required. String
The ID of a listener server.
loadBalancerId This property is required. String
The ID of a load balancer.
id String
The ID of LB Attachment.
ids List<String>
A list of LB Attachment IDs, all the LB Attachments belong to the Load Balancer listener will be retrieved if the ID is [].
outputFile String
File name where to save data source results (after running pulumi preview).

getLbAttachments Result

The following output properties are available:

Id string
The ID of LB Attachment.
Ids List<string>
LbAttachments List<GetLbAttachmentsLbAttachment>
It is a nested type which documented below.
ListenerId string
LoadBalancerId string
TotalCount double
Total number of LB Attachments that satisfy the condition.
OutputFile string
Id string
The ID of LB Attachment.
Ids []string
LbAttachments []GetLbAttachmentsLbAttachment
It is a nested type which documented below.
ListenerId string
LoadBalancerId string
TotalCount float64
Total number of LB Attachments that satisfy the condition.
OutputFile string
id String
The ID of LB Attachment.
ids List<String>
lbAttachments List<GetLbAttachmentsLbAttachment>
It is a nested type which documented below.
listenerId String
loadBalancerId String
totalCount Double
Total number of LB Attachments that satisfy the condition.
outputFile String
id string
The ID of LB Attachment.
ids string[]
lbAttachments GetLbAttachmentsLbAttachment[]
It is a nested type which documented below.
listenerId string
loadBalancerId string
totalCount number
Total number of LB Attachments that satisfy the condition.
outputFile string
id str
The ID of LB Attachment.
ids Sequence[str]
lb_attachments Sequence[GetLbAttachmentsLbAttachment]
It is a nested type which documented below.
listener_id str
load_balancer_id str
total_count float
Total number of LB Attachments that satisfy the condition.
output_file str
id String
The ID of LB Attachment.
ids List<String>
lbAttachments List<Property Map>
It is a nested type which documented below.
listenerId String
loadBalancerId String
totalCount Number
Total number of LB Attachments that satisfy the condition.
outputFile String

Supporting Types

GetLbAttachmentsLbAttachment

Id This property is required. string
The ID of LB Attachment.
Port This property is required. double
Port opened on the backend server to receive requests, range: 1-65535.
PrivateIp This property is required. string
The private ip address for backend servers.
ResourceId This property is required. string
The ID of a backend server.
Status This property is required. string
The status of backend servers. Possible values are: normalRunning, exceptionRunning.
Id This property is required. string
The ID of LB Attachment.
Port This property is required. float64
Port opened on the backend server to receive requests, range: 1-65535.
PrivateIp This property is required. string
The private ip address for backend servers.
ResourceId This property is required. string
The ID of a backend server.
Status This property is required. string
The status of backend servers. Possible values are: normalRunning, exceptionRunning.
id This property is required. String
The ID of LB Attachment.
port This property is required. Double
Port opened on the backend server to receive requests, range: 1-65535.
privateIp This property is required. String
The private ip address for backend servers.
resourceId This property is required. String
The ID of a backend server.
status This property is required. String
The status of backend servers. Possible values are: normalRunning, exceptionRunning.
id This property is required. string
The ID of LB Attachment.
port This property is required. number
Port opened on the backend server to receive requests, range: 1-65535.
privateIp This property is required. string
The private ip address for backend servers.
resourceId This property is required. string
The ID of a backend server.
status This property is required. string
The status of backend servers. Possible values are: normalRunning, exceptionRunning.
id This property is required. str
The ID of LB Attachment.
port This property is required. float
Port opened on the backend server to receive requests, range: 1-65535.
private_ip This property is required. str
The private ip address for backend servers.
resource_id This property is required. str
The ID of a backend server.
status This property is required. str
The status of backend servers. Possible values are: normalRunning, exceptionRunning.
id This property is required. String
The ID of LB Attachment.
port This property is required. Number
Port opened on the backend server to receive requests, range: 1-65535.
privateIp This property is required. String
The private ip address for backend servers.
resourceId This property is required. String
The ID of a backend server.
status This property is required. String
The status of backend servers. Possible values are: normalRunning, exceptionRunning.

Package Details

Repository
ucloud ucloud/terraform-provider-ucloud
License
Notes
This Pulumi package is based on the ucloud Terraform Provider.