Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi
alicloud.vpc.getBgpPeers
Explore with Pulumi AI
This data source provides the Vpc Bgp Peers of the current Alibaba Cloud user.
NOTE: Available in v1.153.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.vpc.getBgpPeers({
ids: [
"example_value-1",
"example_value-2",
],
});
export const vpcBgpPeerId1 = ids.then(ids => ids.peers?.[0]?.id);
const bgpGroupId = alicloud.vpc.getBgpPeers({
bgpGroupId: "example_value",
});
export const vpcBgpPeerId2 = bgpGroupId.then(bgpGroupId => bgpGroupId.peers?.[0]?.id);
const routerId = alicloud.vpc.getBgpPeers({
routerId: "example_value",
});
export const vpcBgpPeerId3 = routerId.then(routerId => routerId.peers?.[0]?.id);
const status = alicloud.vpc.getBgpPeers({
status: "Available",
});
export const vpcBgpPeerId4 = status.then(status => status.peers?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.vpc.get_bgp_peers(ids=[
"example_value-1",
"example_value-2",
])
pulumi.export("vpcBgpPeerId1", ids.peers[0].id)
bgp_group_id = alicloud.vpc.get_bgp_peers(bgp_group_id="example_value")
pulumi.export("vpcBgpPeerId2", bgp_group_id.peers[0].id)
router_id = alicloud.vpc.get_bgp_peers(router_id="example_value")
pulumi.export("vpcBgpPeerId3", router_id.peers[0].id)
status = alicloud.vpc.get_bgp_peers(status="Available")
pulumi.export("vpcBgpPeerId4", status.peers[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := vpc.GetBgpPeers(ctx, &vpc.GetBgpPeersArgs{
Ids: []string{
"example_value-1",
"example_value-2",
},
}, nil)
if err != nil {
return err
}
ctx.Export("vpcBgpPeerId1", ids.Peers[0].Id)
bgpGroupId, err := vpc.GetBgpPeers(ctx, &vpc.GetBgpPeersArgs{
BgpGroupId: pulumi.StringRef("example_value"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcBgpPeerId2", bgpGroupId.Peers[0].Id)
routerId, err := vpc.GetBgpPeers(ctx, &vpc.GetBgpPeersArgs{
RouterId: pulumi.StringRef("example_value"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcBgpPeerId3", routerId.Peers[0].Id)
status, err := vpc.GetBgpPeers(ctx, &vpc.GetBgpPeersArgs{
Status: pulumi.StringRef("Available"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcBgpPeerId4", status.Peers[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Vpc.GetBgpPeers.Invoke(new()
{
Ids = new[]
{
"example_value-1",
"example_value-2",
},
});
var bgpGroupId = AliCloud.Vpc.GetBgpPeers.Invoke(new()
{
BgpGroupId = "example_value",
});
var routerId = AliCloud.Vpc.GetBgpPeers.Invoke(new()
{
RouterId = "example_value",
});
var status = AliCloud.Vpc.GetBgpPeers.Invoke(new()
{
Status = "Available",
});
return new Dictionary<string, object?>
{
["vpcBgpPeerId1"] = ids.Apply(getBgpPeersResult => getBgpPeersResult.Peers[0]?.Id),
["vpcBgpPeerId2"] = bgpGroupId.Apply(getBgpPeersResult => getBgpPeersResult.Peers[0]?.Id),
["vpcBgpPeerId3"] = routerId.Apply(getBgpPeersResult => getBgpPeersResult.Peers[0]?.Id),
["vpcBgpPeerId4"] = status.Apply(getBgpPeersResult => getBgpPeersResult.Peers[0]?.Id),
};
});
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()));
}
}
variables:
ids:
fn::invoke:
function: alicloud:vpc:getBgpPeers
arguments:
ids:
- example_value-1
- example_value-2
bgpGroupId:
fn::invoke:
function: alicloud:vpc:getBgpPeers
arguments:
bgpGroupId: example_value
routerId:
fn::invoke:
function: alicloud:vpc:getBgpPeers
arguments:
routerId: example_value
status:
fn::invoke:
function: alicloud:vpc:getBgpPeers
arguments:
status: Available
outputs:
vpcBgpPeerId1: ${ids.peers[0].id}
vpcBgpPeerId2: ${bgpGroupId.peers[0].id}
vpcBgpPeerId3: ${routerId.peers[0].id}
vpcBgpPeerId4: ${status.peers[0].id}
Using getBgpPeers
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 getBgpPeers(args: GetBgpPeersArgs, opts?: InvokeOptions): Promise<GetBgpPeersResult>
function getBgpPeersOutput(args: GetBgpPeersOutputArgs, opts?: InvokeOptions): Output<GetBgpPeersResult>
def get_bgp_peers(bgp_group_id: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
output_file: Optional[str] = None,
router_id: Optional[str] = None,
status: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetBgpPeersResult
def get_bgp_peers_output(bgp_group_id: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
output_file: Optional[pulumi.Input[str]] = None,
router_id: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetBgpPeersResult]
func GetBgpPeers(ctx *Context, args *GetBgpPeersArgs, opts ...InvokeOption) (*GetBgpPeersResult, error)
func GetBgpPeersOutput(ctx *Context, args *GetBgpPeersOutputArgs, opts ...InvokeOption) GetBgpPeersResultOutput
> Note: This function is named GetBgpPeers
in the Go SDK.
public static class GetBgpPeers
{
public static Task<GetBgpPeersResult> InvokeAsync(GetBgpPeersArgs args, InvokeOptions? opts = null)
public static Output<GetBgpPeersResult> Invoke(GetBgpPeersInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBgpPeersResult> getBgpPeers(GetBgpPeersArgs args, InvokeOptions options)
public static Output<GetBgpPeersResult> getBgpPeers(GetBgpPeersArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:vpc/getBgpPeers:getBgpPeers
arguments:
# arguments dictionary
The following arguments are supported:
- Bgp
Group Id Changes to this property will trigger replacement.
- The ID of the BGP group to which the BGP peer that you want to query belongs.
- Ids
Changes to this property will trigger replacement.
- A list of Bgp Peer IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Router
Id Changes to this property will trigger replacement.
- The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- Status
Changes to this property will trigger replacement.
- The status of the BGP peer. Valid values:
Available
,Deleted
,Deleting
,Modifying
,Pending
.
- Bgp
Group Id Changes to this property will trigger replacement.
- The ID of the BGP group to which the BGP peer that you want to query belongs.
- Ids
Changes to this property will trigger replacement.
- A list of Bgp Peer IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Router
Id Changes to this property will trigger replacement.
- The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- Status
Changes to this property will trigger replacement.
- The status of the BGP peer. Valid values:
Available
,Deleted
,Deleting
,Modifying
,Pending
.
- bgp
Group Id Changes to this property will trigger replacement.
- The ID of the BGP group to which the BGP peer that you want to query belongs.
- ids
Changes to this property will trigger replacement.
- A list of Bgp Peer IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
). - router
Id Changes to this property will trigger replacement.
- The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- status
Changes to this property will trigger replacement.
- The status of the BGP peer. Valid values:
Available
,Deleted
,Deleting
,Modifying
,Pending
.
- bgp
Group Id Changes to this property will trigger replacement.
- The ID of the BGP group to which the BGP peer that you want to query belongs.
- ids
Changes to this property will trigger replacement.
- A list of Bgp Peer IDs.
- output
File string - File name where to save data source results (after running
pulumi preview
). - router
Id Changes to this property will trigger replacement.
- The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- status
Changes to this property will trigger replacement.
- The status of the BGP peer. Valid values:
Available
,Deleted
,Deleting
,Modifying
,Pending
.
- bgp_
group_ id Changes to this property will trigger replacement.
- The ID of the BGP group to which the BGP peer that you want to query belongs.
- ids
Changes to this property will trigger replacement.
- A list of Bgp Peer IDs.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - router_
id Changes to this property will trigger replacement.
- The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- status
Changes to this property will trigger replacement.
- The status of the BGP peer. Valid values:
Available
,Deleted
,Deleting
,Modifying
,Pending
.
- bgp
Group Id Changes to this property will trigger replacement.
- The ID of the BGP group to which the BGP peer that you want to query belongs.
- ids
Changes to this property will trigger replacement.
- A list of Bgp Peer IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
). - router
Id Changes to this property will trigger replacement.
- The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- status
Changes to this property will trigger replacement.
- The status of the BGP peer. Valid values:
Available
,Deleted
,Deleting
,Modifying
,Pending
.
getBgpPeers Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Peers
List<Pulumi.
Ali Cloud. Vpc. Outputs. Get Bgp Peers Peer> - Bgp
Group stringId - Output
File string - Router
Id string - Status string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Peers
[]Get
Bgp Peers Peer - Bgp
Group stringId - Output
File string - Router
Id string - Status string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- peers
List<Get
Bgp Peers Peer> - bgp
Group StringId - output
File String - router
Id String - status String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- peers
Get
Bgp Peers Peer[] - bgp
Group stringId - output
File string - router
Id string - status string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- peers
Sequence[Get
Bgp Peers Peer] - bgp_
group_ strid - output_
file str - router_
id str - status str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- peers List<Property Map>
- bgp
Group StringId - output
File String - router
Id String - status String
Supporting Types
GetBgpPeersPeer
- Auth
Key This property is required. string - The authentication key of the BGP group.
- Bfd
Multi Hop This property is required. int - The BFD hop count.
- Bgp
Group Id This property is required. string - The ID of the BGP group.
- Bgp
Peer Id This property is required. string - The ID of the BGP neighbor.
- Bgp
Peer Name This property is required. string - The name of the BGP neighbor.
- Bgp
Status This property is required. string - The status of the BGP connection.
- Description
This property is required. string - The description of the BGP group.
- Enable
Bfd This property is required. bool - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- Hold
This property is required. string - The hold time.
- Id
This property is required. string - The ID of the Bgp Peer.
- Ip
Version This property is required. string - The IP version.
- Is
Fake This property is required. bool - Indicates whether a fake AS number is used.
- Keepalive
This property is required. string - The keepalive time.
- Local
Asn This property is required. string - The AS number of the device on the Alibaba Cloud side.
- Peer
Asn This property is required. string - The autonomous system (AS) number of the BGP peer.
- Peer
Ip Address This property is required. string - The IP address of the BGP neighbor.
- Route
Limit This property is required. string - The limit on routes.
- Router
Id This property is required. string - The ID of the router.
- Status
This property is required. string - The status of the BGP peer.
- Auth
Key This property is required. string - The authentication key of the BGP group.
- Bfd
Multi Hop This property is required. int - The BFD hop count.
- Bgp
Group Id This property is required. string - The ID of the BGP group.
- Bgp
Peer Id This property is required. string - The ID of the BGP neighbor.
- Bgp
Peer Name This property is required. string - The name of the BGP neighbor.
- Bgp
Status This property is required. string - The status of the BGP connection.
- Description
This property is required. string - The description of the BGP group.
- Enable
Bfd This property is required. bool - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- Hold
This property is required. string - The hold time.
- Id
This property is required. string - The ID of the Bgp Peer.
- Ip
Version This property is required. string - The IP version.
- Is
Fake This property is required. bool - Indicates whether a fake AS number is used.
- Keepalive
This property is required. string - The keepalive time.
- Local
Asn This property is required. string - The AS number of the device on the Alibaba Cloud side.
- Peer
Asn This property is required. string - The autonomous system (AS) number of the BGP peer.
- Peer
Ip Address This property is required. string - The IP address of the BGP neighbor.
- Route
Limit This property is required. string - The limit on routes.
- Router
Id This property is required. string - The ID of the router.
- Status
This property is required. string - The status of the BGP peer.
- auth
Key This property is required. String - The authentication key of the BGP group.
- bfd
Multi Hop This property is required. Integer - The BFD hop count.
- bgp
Group Id This property is required. String - The ID of the BGP group.
- bgp
Peer Id This property is required. String - The ID of the BGP neighbor.
- bgp
Peer Name This property is required. String - The name of the BGP neighbor.
- bgp
Status This property is required. String - The status of the BGP connection.
- description
This property is required. String - The description of the BGP group.
- enable
Bfd This property is required. Boolean - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- hold
This property is required. String - The hold time.
- id
This property is required. String - The ID of the Bgp Peer.
- ip
Version This property is required. String - The IP version.
- is
Fake This property is required. Boolean - Indicates whether a fake AS number is used.
- keepalive
This property is required. String - The keepalive time.
- local
Asn This property is required. String - The AS number of the device on the Alibaba Cloud side.
- peer
Asn This property is required. String - The autonomous system (AS) number of the BGP peer.
- peer
Ip Address This property is required. String - The IP address of the BGP neighbor.
- route
Limit This property is required. String - The limit on routes.
- router
Id This property is required. String - The ID of the router.
- status
This property is required. String - The status of the BGP peer.
- auth
Key This property is required. string - The authentication key of the BGP group.
- bfd
Multi Hop This property is required. number - The BFD hop count.
- bgp
Group Id This property is required. string - The ID of the BGP group.
- bgp
Peer Id This property is required. string - The ID of the BGP neighbor.
- bgp
Peer Name This property is required. string - The name of the BGP neighbor.
- bgp
Status This property is required. string - The status of the BGP connection.
- description
This property is required. string - The description of the BGP group.
- enable
Bfd This property is required. boolean - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- hold
This property is required. string - The hold time.
- id
This property is required. string - The ID of the Bgp Peer.
- ip
Version This property is required. string - The IP version.
- is
Fake This property is required. boolean - Indicates whether a fake AS number is used.
- keepalive
This property is required. string - The keepalive time.
- local
Asn This property is required. string - The AS number of the device on the Alibaba Cloud side.
- peer
Asn This property is required. string - The autonomous system (AS) number of the BGP peer.
- peer
Ip Address This property is required. string - The IP address of the BGP neighbor.
- route
Limit This property is required. string - The limit on routes.
- router
Id This property is required. string - The ID of the router.
- status
This property is required. string - The status of the BGP peer.
- auth_
key This property is required. str - The authentication key of the BGP group.
- bfd_
multi_ hop This property is required. int - The BFD hop count.
- bgp_
group_ id This property is required. str - The ID of the BGP group.
- bgp_
peer_ id This property is required. str - The ID of the BGP neighbor.
- bgp_
peer_ name This property is required. str - The name of the BGP neighbor.
- bgp_
status This property is required. str - The status of the BGP connection.
- description
This property is required. str - The description of the BGP group.
- enable_
bfd This property is required. bool - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- hold
This property is required. str - The hold time.
- id
This property is required. str - The ID of the Bgp Peer.
- ip_
version This property is required. str - The IP version.
- is_
fake This property is required. bool - Indicates whether a fake AS number is used.
- keepalive
This property is required. str - The keepalive time.
- local_
asn This property is required. str - The AS number of the device on the Alibaba Cloud side.
- peer_
asn This property is required. str - The autonomous system (AS) number of the BGP peer.
- peer_
ip_ address This property is required. str - The IP address of the BGP neighbor.
- route_
limit This property is required. str - The limit on routes.
- router_
id This property is required. str - The ID of the router.
- status
This property is required. str - The status of the BGP peer.
- auth
Key This property is required. String - The authentication key of the BGP group.
- bfd
Multi Hop This property is required. Number - The BFD hop count.
- bgp
Group Id This property is required. String - The ID of the BGP group.
- bgp
Peer Id This property is required. String - The ID of the BGP neighbor.
- bgp
Peer Name This property is required. String - The name of the BGP neighbor.
- bgp
Status This property is required. String - The status of the BGP connection.
- description
This property is required. String - The description of the BGP group.
- enable
Bfd This property is required. Boolean - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- hold
This property is required. String - The hold time.
- id
This property is required. String - The ID of the Bgp Peer.
- ip
Version This property is required. String - The IP version.
- is
Fake This property is required. Boolean - Indicates whether a fake AS number is used.
- keepalive
This property is required. String - The keepalive time.
- local
Asn This property is required. String - The AS number of the device on the Alibaba Cloud side.
- peer
Asn This property is required. String - The autonomous system (AS) number of the BGP peer.
- peer
Ip Address This property is required. String - The IP address of the BGP neighbor.
- route
Limit This property is required. String - The limit on routes.
- router
Id This property is required. String - The ID of the router.
- status
This property is required. String - The status of the BGP peer.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.