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);
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)
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
})
}
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),
};
});
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()));
}
}
variables:
example:
fn::invoke:
function: ucloud:getLbAttachments
arguments:
loadBalancerId: ulb-xxx
listenerId: vserver-xxx
outputs:
first: ${example.lbAttachments[0].id}
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>
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]
func GetLbAttachments(ctx *Context, args *GetLbAttachmentsArgs, opts ...InvokeOption) (*GetLbAttachmentsResult, error)
func GetLbAttachmentsOutput(ctx *Context, args *GetLbAttachmentsOutputArgs, opts ...InvokeOption) GetLbAttachmentsResultOutput
> 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)
}
public static CompletableFuture<GetLbAttachmentsResult> getLbAttachments(GetLbAttachmentsArgs args, InvokeOptions options)
public static Output<GetLbAttachmentsResult> getLbAttachments(GetLbAttachmentsArgs args, InvokeOptions options)
fn::invoke:
function: ucloud:index/getLbAttachments:getLbAttachments
arguments:
# arguments dictionary
The following arguments are supported:
- Listener
Id string - The ID of a listener server.
- Load
Balancer stringId - 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
[]
. - Output
File string - File name where to save data source results (after running
pulumi preview
).
- Listener
Id string - The ID of a listener server.
- Load
Balancer stringId - 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
[]
. - Output
File string - File name where to save data source results (after running
pulumi preview
).
- listener
Id String - The ID of a listener server.
- load
Balancer StringId - 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
[]
. - output
File String - File name where to save data source results (after running
pulumi preview
).
- listener
Id string - The ID of a listener server.
- load
Balancer stringId - 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
[]
. - output
File string - File name where to save data source results (after running
pulumi preview
).
- listener_
id str - The ID of a listener server.
- load_
balancer_ strid - 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
).
- listener
Id String - The ID of a listener server.
- load
Balancer StringId - 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
[]
. - output
File 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>
- Lb
Attachments List<GetLb Attachments Lb Attachment> - It is a nested type which documented below.
- Listener
Id string - Load
Balancer stringId - Total
Count double - Total number of LB Attachments that satisfy the condition.
- Output
File string
- Id string
- The ID of LB Attachment.
- Ids []string
- Lb
Attachments []GetLb Attachments Lb Attachment - It is a nested type which documented below.
- Listener
Id string - Load
Balancer stringId - Total
Count float64 - Total number of LB Attachments that satisfy the condition.
- Output
File string
- id String
- The ID of LB Attachment.
- ids List<String>
- lb
Attachments List<GetLb Attachments Lb Attachment> - It is a nested type which documented below.
- listener
Id String - load
Balancer StringId - total
Count Double - Total number of LB Attachments that satisfy the condition.
- output
File String
- id string
- The ID of LB Attachment.
- ids string[]
- lb
Attachments GetLb Attachments Lb Attachment[] - It is a nested type which documented below.
- listener
Id string - load
Balancer stringId - total
Count number - Total number of LB Attachments that satisfy the condition.
- output
File string
- id str
- The ID of LB Attachment.
- ids Sequence[str]
- lb_
attachments Sequence[GetLb Attachments Lb Attachment] - It is a nested type which documented below.
- listener_
id str - load_
balancer_ strid - 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>
- lb
Attachments List<Property Map> - It is a nested type which documented below.
- listener
Id String - load
Balancer StringId - total
Count Number - Total number of LB Attachments that satisfy the condition.
- output
File String
Supporting Types
GetLbAttachmentsLbAttachment
- Id string
- The ID of LB Attachment.
- Port double
- Port opened on the backend server to receive requests, range: 1-65535.
- Private
Ip string - The private ip address for backend servers.
- Resource
Id string - The ID of a backend server.
- Status string
- The status of backend servers. Possible values are:
normalRunning
,exceptionRunning
.
- Id string
- The ID of LB Attachment.
- Port float64
- Port opened on the backend server to receive requests, range: 1-65535.
- Private
Ip string - The private ip address for backend servers.
- Resource
Id string - The ID of a backend server.
- Status string
- The status of backend servers. Possible values are:
normalRunning
,exceptionRunning
.
- id String
- The ID of LB Attachment.
- port Double
- Port opened on the backend server to receive requests, range: 1-65535.
- private
Ip String - The private ip address for backend servers.
- resource
Id String - The ID of a backend server.
- status String
- The status of backend servers. Possible values are:
normalRunning
,exceptionRunning
.
- id string
- The ID of LB Attachment.
- port number
- Port opened on the backend server to receive requests, range: 1-65535.
- private
Ip string - The private ip address for backend servers.
- resource
Id string - The ID of a backend server.
- status string
- The status of backend servers. Possible values are:
normalRunning
,exceptionRunning
.
- id str
- The ID of LB Attachment.
- port float
- Port opened on the backend server to receive requests, range: 1-65535.
- private_
ip str - The private ip address for backend servers.
- resource_
id str - The ID of a backend server.
- status str
- The status of backend servers. Possible values are:
normalRunning
,exceptionRunning
.
- id String
- The ID of LB Attachment.
- port Number
- Port opened on the backend server to receive requests, range: 1-65535.
- private
Ip String - The private ip address for backend servers.
- resource
Id String - The ID of a backend server.
- status 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.