Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:vpc/getBgpPeers:getBgpPeers
arguments:
# arguments dictionary
The following arguments are supported:
- Bgp
Group stringId - The ID of the BGP group to which the BGP peer that you want to query belongs.
- Ids List<string>
- A list of Bgp Peer IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Router
Id string - The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- Status string
- The status of the BGP peer. Valid values:
Available
,Deleted
,Deleting
,Modifying
,Pending
.
- Bgp
Group stringId - The ID of the BGP group to which the BGP peer that you want to query belongs.
- Ids []string
- A list of Bgp Peer IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Router
Id string - The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- Status string
- The status of the BGP peer. Valid values:
Available
,Deleted
,Deleting
,Modifying
,Pending
.
- bgp
Group StringId - The ID of the BGP group to which the BGP peer that you want to query belongs.
- ids List<String>
- A list of Bgp Peer IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
). - router
Id String - The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- status String
- The status of the BGP peer. Valid values:
Available
,Deleted
,Deleting
,Modifying
,Pending
.
- bgp
Group stringId - The ID of the BGP group to which the BGP peer that you want to query belongs.
- ids string[]
- A list of Bgp Peer IDs.
- output
File string - File name where to save data source results (after running
pulumi preview
). - router
Id string - The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- status string
- The status of the BGP peer. Valid values:
Available
,Deleted
,Deleting
,Modifying
,Pending
.
- bgp_
group_ strid - The ID of the BGP group to which the BGP peer that you want to query belongs.
- ids Sequence[str]
- A list of Bgp Peer IDs.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - router_
id str - The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- status str
- The status of the BGP peer. Valid values:
Available
,Deleted
,Deleting
,Modifying
,Pending
.
- bgp
Group StringId - The ID of the BGP group to which the BGP peer that you want to query belongs.
- ids List<String>
- A list of Bgp Peer IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
). - router
Id String - The ID of the virtual border router (VBR) that is associated with the BGP peer that you want to query.
- status String
- 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 string - The authentication key of the BGP group.
- Bfd
Multi intHop - The BFD hop count.
- Bgp
Group stringId - The ID of the BGP group.
- Bgp
Peer stringId - The ID of the BGP neighbor.
- Bgp
Peer stringName - The name of the BGP neighbor.
- Bgp
Status string - The status of the BGP connection.
- Description string
- The description of the BGP group.
- Enable
Bfd bool - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- Hold string
- The hold time.
- Id string
- The ID of the Bgp Peer.
- Ip
Version string - The IP version.
- Is
Fake bool - Indicates whether a fake AS number is used.
- Keepalive string
- The keepalive time.
- Local
Asn string - The AS number of the device on the Alibaba Cloud side.
- Peer
Asn string - The autonomous system (AS) number of the BGP peer.
- Peer
Ip stringAddress - The IP address of the BGP neighbor.
- Route
Limit string - The limit on routes.
- Router
Id string - The ID of the router.
- Status string
- The status of the BGP peer.
- Auth
Key string - The authentication key of the BGP group.
- Bfd
Multi intHop - The BFD hop count.
- Bgp
Group stringId - The ID of the BGP group.
- Bgp
Peer stringId - The ID of the BGP neighbor.
- Bgp
Peer stringName - The name of the BGP neighbor.
- Bgp
Status string - The status of the BGP connection.
- Description string
- The description of the BGP group.
- Enable
Bfd bool - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- Hold string
- The hold time.
- Id string
- The ID of the Bgp Peer.
- Ip
Version string - The IP version.
- Is
Fake bool - Indicates whether a fake AS number is used.
- Keepalive string
- The keepalive time.
- Local
Asn string - The AS number of the device on the Alibaba Cloud side.
- Peer
Asn string - The autonomous system (AS) number of the BGP peer.
- Peer
Ip stringAddress - The IP address of the BGP neighbor.
- Route
Limit string - The limit on routes.
- Router
Id string - The ID of the router.
- Status string
- The status of the BGP peer.
- auth
Key String - The authentication key of the BGP group.
- bfd
Multi IntegerHop - The BFD hop count.
- bgp
Group StringId - The ID of the BGP group.
- bgp
Peer StringId - The ID of the BGP neighbor.
- bgp
Peer StringName - The name of the BGP neighbor.
- bgp
Status String - The status of the BGP connection.
- description String
- The description of the BGP group.
- enable
Bfd Boolean - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- hold String
- The hold time.
- id String
- The ID of the Bgp Peer.
- ip
Version String - The IP version.
- is
Fake Boolean - Indicates whether a fake AS number is used.
- keepalive String
- The keepalive time.
- local
Asn String - The AS number of the device on the Alibaba Cloud side.
- peer
Asn String - The autonomous system (AS) number of the BGP peer.
- peer
Ip StringAddress - The IP address of the BGP neighbor.
- route
Limit String - The limit on routes.
- router
Id String - The ID of the router.
- status String
- The status of the BGP peer.
- auth
Key string - The authentication key of the BGP group.
- bfd
Multi numberHop - The BFD hop count.
- bgp
Group stringId - The ID of the BGP group.
- bgp
Peer stringId - The ID of the BGP neighbor.
- bgp
Peer stringName - The name of the BGP neighbor.
- bgp
Status string - The status of the BGP connection.
- description string
- The description of the BGP group.
- enable
Bfd boolean - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- hold string
- The hold time.
- id string
- The ID of the Bgp Peer.
- ip
Version string - The IP version.
- is
Fake boolean - Indicates whether a fake AS number is used.
- keepalive string
- The keepalive time.
- local
Asn string - The AS number of the device on the Alibaba Cloud side.
- peer
Asn string - The autonomous system (AS) number of the BGP peer.
- peer
Ip stringAddress - The IP address of the BGP neighbor.
- route
Limit string - The limit on routes.
- router
Id string - The ID of the router.
- status string
- The status of the BGP peer.
- auth_
key str - The authentication key of the BGP group.
- bfd_
multi_ inthop - The BFD hop count.
- bgp_
group_ strid - The ID of the BGP group.
- bgp_
peer_ strid - The ID of the BGP neighbor.
- bgp_
peer_ strname - The name of the BGP neighbor.
- bgp_
status str - The status of the BGP connection.
- description str
- The description of the BGP group.
- enable_
bfd bool - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- hold str
- The hold time.
- id str
- The ID of the Bgp Peer.
- ip_
version str - The IP version.
- is_
fake bool - Indicates whether a fake AS number is used.
- keepalive str
- The keepalive time.
- local_
asn str - The AS number of the device on the Alibaba Cloud side.
- peer_
asn str - The autonomous system (AS) number of the BGP peer.
- peer_
ip_ straddress - The IP address of the BGP neighbor.
- route_
limit str - The limit on routes.
- router_
id str - The ID of the router.
- status str
- The status of the BGP peer.
- auth
Key String - The authentication key of the BGP group.
- bfd
Multi NumberHop - The BFD hop count.
- bgp
Group StringId - The ID of the BGP group.
- bgp
Peer StringId - The ID of the BGP neighbor.
- bgp
Peer StringName - The name of the BGP neighbor.
- bgp
Status String - The status of the BGP connection.
- description String
- The description of the BGP group.
- enable
Bfd Boolean - Indicates whether the Bidirectional Forwarding Detection (BFD) protocol is enabled.
- hold String
- The hold time.
- id String
- The ID of the Bgp Peer.
- ip
Version String - The IP version.
- is
Fake Boolean - Indicates whether a fake AS number is used.
- keepalive String
- The keepalive time.
- local
Asn String - The AS number of the device on the Alibaba Cloud side.
- peer
Asn String - The autonomous system (AS) number of the BGP peer.
- peer
Ip StringAddress - The IP address of the BGP neighbor.
- route
Limit String - The limit on routes.
- router
Id String - The ID of the router.
- status 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.