getBgpPeers

This data source provides the Vpc Bgp Peers of the current Alibaba Cloud user.

NOTE: Available in v1.153.0+.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetBgpPeersArgs;
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 ids = VpcFunctions.getBgpPeers(GetBgpPeersArgs.builder()
.ids(
"example_value-1",
"example_value-2")
.build());
ctx.export("vpcBgpPeerId1", ids.applyValue(getBgpPeersResult -> getBgpPeersResult.peers()[0].id()));
final var bgpGroupId = VpcFunctions.getBgpPeers(GetBgpPeersArgs.builder()
.bgpGroupId("example_value")
.build());
ctx.export("vpcBgpPeerId2", bgpGroupId.applyValue(getBgpPeersResult -> getBgpPeersResult.peers()[0].id()));
final var routerId = VpcFunctions.getBgpPeers(GetBgpPeersArgs.builder()
.routerId("example_value")
.build());
ctx.export("vpcBgpPeerId3", routerId.applyValue(getBgpPeersResult -> getBgpPeersResult.peers()[0].id()));
final var status = VpcFunctions.getBgpPeers(GetBgpPeersArgs.builder()
.status("Available")
.build());
ctx.export("vpcBgpPeerId4", status.applyValue(getBgpPeersResult -> getBgpPeersResult.peers()[0].id()));
}
}

Return

A collection of values returned by getBgpPeers.

Parameters

argument

A collection of arguments for invoking getBgpPeers.


suspend fun getBgpPeers(bgpGroupId: String? = null, ids: List<String>? = null, outputFile: String? = null, routerId: String? = null, status: String? = null): GetBgpPeersResult

Return

A collection of values returned by getBgpPeers.

See also

Parameters

bgpGroupId

The ID of the BGP group.

ids

A list of Bgp Peer IDs.

outputFile

File name where to save data source results (after running pulumi preview).

routerId

The ID of the router.

status

The status of the BGP peer.


suspend fun getBgpPeers(argument: suspend GetBgpPeersPlainArgsBuilder.() -> Unit): GetBgpPeersResult

Return

A collection of values returned by getBgpPeers.

See also

Parameters

argument

Builder for com.pulumi.alicloud.vpc.kotlin.inputs.GetBgpPeersPlainArgs.