alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.vpc.BgpPeer

Provides a VPC Bgp Peer resource.

For information about VPC Bgp Peer and how to use it, see What is Bgp Peer.

NOTE: Available in v1.153.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultPhysicalConnections = AliCloud.ExpressConnect.GetPhysicalConnections.Invoke();

    var defaultVirtualBorderRouter = new AliCloud.ExpressConnect.VirtualBorderRouter("defaultVirtualBorderRouter", new()
    {
        LocalGatewayIp = "10.0.0.1",
        PeerGatewayIp = "10.0.0.2",
        PeeringSubnetMask = "255.255.255.252",
        PhysicalConnectionId = defaultPhysicalConnections.Apply(getPhysicalConnectionsResult => getPhysicalConnectionsResult.Connections[0]?.Id),
        VirtualBorderRouterName = "example_value",
        VlanId = 120,
        MinRxInterval = 1000,
        MinTxInterval = 1000,
        DetectMultiplier = 10,
    });

    var defaultBgpGroup = new AliCloud.Vpc.BgpGroup("defaultBgpGroup", new()
    {
        AuthKey = "YourPassword+12345678",
        BgpGroupName = "example_value",
        Description = "example_value",
        LocalAsn = 64512,
        PeerAsn = 1111,
        RouterId = defaultVirtualBorderRouter.Id,
    });

    var defaultBgpPeer = new AliCloud.Vpc.BgpPeer("defaultBgpPeer", new()
    {
        BfdMultiHop = 10,
        BgpGroupId = defaultBgpGroup.Id,
        EnableBfd = true,
        IpVersion = "IPV4",
        PeerIpAddress = "1.1.1.1",
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/expressconnect"
	"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 {
		defaultPhysicalConnections, err := expressconnect.GetPhysicalConnections(ctx, nil, nil)
		if err != nil {
			return err
		}
		defaultVirtualBorderRouter, err := expressconnect.NewVirtualBorderRouter(ctx, "defaultVirtualBorderRouter", &expressconnect.VirtualBorderRouterArgs{
			LocalGatewayIp:          pulumi.String("10.0.0.1"),
			PeerGatewayIp:           pulumi.String("10.0.0.2"),
			PeeringSubnetMask:       pulumi.String("255.255.255.252"),
			PhysicalConnectionId:    *pulumi.String(defaultPhysicalConnections.Connections[0].Id),
			VirtualBorderRouterName: pulumi.String("example_value"),
			VlanId:                  pulumi.Int(120),
			MinRxInterval:           pulumi.Int(1000),
			MinTxInterval:           pulumi.Int(1000),
			DetectMultiplier:        pulumi.Int(10),
		})
		if err != nil {
			return err
		}
		defaultBgpGroup, err := vpc.NewBgpGroup(ctx, "defaultBgpGroup", &vpc.BgpGroupArgs{
			AuthKey:      pulumi.String("YourPassword+12345678"),
			BgpGroupName: pulumi.String("example_value"),
			Description:  pulumi.String("example_value"),
			LocalAsn:     pulumi.Int(64512),
			PeerAsn:      pulumi.Int(1111),
			RouterId:     defaultVirtualBorderRouter.ID(),
		})
		if err != nil {
			return err
		}
		_, err = vpc.NewBgpPeer(ctx, "defaultBgpPeer", &vpc.BgpPeerArgs{
			BfdMultiHop:   pulumi.Int(10),
			BgpGroupId:    defaultBgpGroup.ID(),
			EnableBfd:     pulumi.Bool(true),
			IpVersion:     pulumi.String("IPV4"),
			PeerIpAddress: pulumi.String("1.1.1.1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.expressconnect.ExpressconnectFunctions;
import com.pulumi.alicloud.expressconnect.inputs.GetPhysicalConnectionsArgs;
import com.pulumi.alicloud.expressconnect.VirtualBorderRouter;
import com.pulumi.alicloud.expressconnect.VirtualBorderRouterArgs;
import com.pulumi.alicloud.vpc.BgpGroup;
import com.pulumi.alicloud.vpc.BgpGroupArgs;
import com.pulumi.alicloud.vpc.BgpPeer;
import com.pulumi.alicloud.vpc.BgpPeerArgs;
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 defaultPhysicalConnections = ExpressconnectFunctions.getPhysicalConnections();

        var defaultVirtualBorderRouter = new VirtualBorderRouter("defaultVirtualBorderRouter", VirtualBorderRouterArgs.builder()        
            .localGatewayIp("10.0.0.1")
            .peerGatewayIp("10.0.0.2")
            .peeringSubnetMask("255.255.255.252")
            .physicalConnectionId(defaultPhysicalConnections.applyValue(getPhysicalConnectionsResult -> getPhysicalConnectionsResult.connections()[0].id()))
            .virtualBorderRouterName("example_value")
            .vlanId(120)
            .minRxInterval(1000)
            .minTxInterval(1000)
            .detectMultiplier(10)
            .build());

        var defaultBgpGroup = new BgpGroup("defaultBgpGroup", BgpGroupArgs.builder()        
            .authKey("YourPassword+12345678")
            .bgpGroupName("example_value")
            .description("example_value")
            .localAsn(64512)
            .peerAsn(1111)
            .routerId(defaultVirtualBorderRouter.id())
            .build());

        var defaultBgpPeer = new BgpPeer("defaultBgpPeer", BgpPeerArgs.builder()        
            .bfdMultiHop("10")
            .bgpGroupId(defaultBgpGroup.id())
            .enableBfd(true)
            .ipVersion("IPV4")
            .peerIpAddress("1.1.1.1")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_physical_connections = alicloud.expressconnect.get_physical_connections()
default_virtual_border_router = alicloud.expressconnect.VirtualBorderRouter("defaultVirtualBorderRouter",
    local_gateway_ip="10.0.0.1",
    peer_gateway_ip="10.0.0.2",
    peering_subnet_mask="255.255.255.252",
    physical_connection_id=default_physical_connections.connections[0].id,
    virtual_border_router_name="example_value",
    vlan_id=120,
    min_rx_interval=1000,
    min_tx_interval=1000,
    detect_multiplier=10)
default_bgp_group = alicloud.vpc.BgpGroup("defaultBgpGroup",
    auth_key="YourPassword+12345678",
    bgp_group_name="example_value",
    description="example_value",
    local_asn=64512,
    peer_asn=1111,
    router_id=default_virtual_border_router.id)
default_bgp_peer = alicloud.vpc.BgpPeer("defaultBgpPeer",
    bfd_multi_hop=10,
    bgp_group_id=default_bgp_group.id,
    enable_bfd=True,
    ip_version="IPV4",
    peer_ip_address="1.1.1.1")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultPhysicalConnections = alicloud.expressconnect.getPhysicalConnections({});
const defaultVirtualBorderRouter = new alicloud.expressconnect.VirtualBorderRouter("defaultVirtualBorderRouter", {
    localGatewayIp: "10.0.0.1",
    peerGatewayIp: "10.0.0.2",
    peeringSubnetMask: "255.255.255.252",
    physicalConnectionId: defaultPhysicalConnections.then(defaultPhysicalConnections => defaultPhysicalConnections.connections?.[0]?.id),
    virtualBorderRouterName: "example_value",
    vlanId: 120,
    minRxInterval: 1000,
    minTxInterval: 1000,
    detectMultiplier: 10,
});
const defaultBgpGroup = new alicloud.vpc.BgpGroup("defaultBgpGroup", {
    authKey: "YourPassword+12345678",
    bgpGroupName: "example_value",
    description: "example_value",
    localAsn: 64512,
    peerAsn: 1111,
    routerId: defaultVirtualBorderRouter.id,
});
const defaultBgpPeer = new alicloud.vpc.BgpPeer("defaultBgpPeer", {
    bfdMultiHop: 10,
    bgpGroupId: defaultBgpGroup.id,
    enableBfd: true,
    ipVersion: "IPV4",
    peerIpAddress: "1.1.1.1",
});
resources:
  defaultVirtualBorderRouter:
    type: alicloud:expressconnect:VirtualBorderRouter
    properties:
      localGatewayIp: 10.0.0.1
      peerGatewayIp: 10.0.0.2
      peeringSubnetMask: 255.255.255.252
      physicalConnectionId: ${defaultPhysicalConnections.connections[0].id}
      virtualBorderRouterName: example_value
      vlanId: 120
      minRxInterval: 1000
      minTxInterval: 1000
      detectMultiplier: 10
  defaultBgpGroup:
    type: alicloud:vpc:BgpGroup
    properties:
      authKey: YourPassword+12345678
      bgpGroupName: example_value
      description: example_value
      localAsn: 64512
      peerAsn: 1111
      routerId: ${defaultVirtualBorderRouter.id}
  defaultBgpPeer:
    type: alicloud:vpc:BgpPeer
    properties:
      bfdMultiHop: '10'
      bgpGroupId: ${defaultBgpGroup.id}
      enableBfd: true
      ipVersion: IPV4
      peerIpAddress: 1.1.1.1
variables:
  defaultPhysicalConnections:
    fn::invoke:
      Function: alicloud:expressconnect:getPhysicalConnections
      Arguments: {}

Create BgpPeer Resource

new BgpPeer(name: string, args: BgpPeerArgs, opts?: CustomResourceOptions);
@overload
def BgpPeer(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            bfd_multi_hop: Optional[int] = None,
            bgp_group_id: Optional[str] = None,
            enable_bfd: Optional[bool] = None,
            ip_version: Optional[str] = None,
            peer_ip_address: Optional[str] = None)
@overload
def BgpPeer(resource_name: str,
            args: BgpPeerArgs,
            opts: Optional[ResourceOptions] = None)
func NewBgpPeer(ctx *Context, name string, args BgpPeerArgs, opts ...ResourceOption) (*BgpPeer, error)
public BgpPeer(string name, BgpPeerArgs args, CustomResourceOptions? opts = null)
public BgpPeer(String name, BgpPeerArgs args)
public BgpPeer(String name, BgpPeerArgs args, CustomResourceOptions options)
type: alicloud:vpc:BgpPeer
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args BgpPeerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args BgpPeerArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args BgpPeerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BgpPeerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args BgpPeerArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

BgpPeer Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The BgpPeer resource accepts the following input properties:

BgpGroupId string

The ID of the BGP group.

BfdMultiHop int

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

EnableBfd bool

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

IpVersion string

The IP version.

PeerIpAddress string

The IP address of the BGP peer.

BgpGroupId string

The ID of the BGP group.

BfdMultiHop int

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

EnableBfd bool

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

IpVersion string

The IP version.

PeerIpAddress string

The IP address of the BGP peer.

bgpGroupId String

The ID of the BGP group.

bfdMultiHop Integer

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

enableBfd Boolean

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

ipVersion String

The IP version.

peerIpAddress String

The IP address of the BGP peer.

bgpGroupId string

The ID of the BGP group.

bfdMultiHop number

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

enableBfd boolean

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

ipVersion string

The IP version.

peerIpAddress string

The IP address of the BGP peer.

bgp_group_id str

The ID of the BGP group.

bfd_multi_hop int

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

enable_bfd bool

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

ip_version str

The IP version.

peer_ip_address str

The IP address of the BGP peer.

bgpGroupId String

The ID of the BGP group.

bfdMultiHop Number

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

enableBfd Boolean

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

ipVersion String

The IP version.

peerIpAddress String

The IP address of the BGP peer.

Outputs

All input properties are implicitly available as output properties. Additionally, the BgpPeer resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the BGP peer.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the BGP peer.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the BGP peer.

id string

The provider-assigned unique ID for this managed resource.

status string

The status of the BGP peer.

id str

The provider-assigned unique ID for this managed resource.

status str

The status of the BGP peer.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the BGP peer.

Look up Existing BgpPeer Resource

Get an existing BgpPeer resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: BgpPeerState, opts?: CustomResourceOptions): BgpPeer
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bfd_multi_hop: Optional[int] = None,
        bgp_group_id: Optional[str] = None,
        enable_bfd: Optional[bool] = None,
        ip_version: Optional[str] = None,
        peer_ip_address: Optional[str] = None,
        status: Optional[str] = None) -> BgpPeer
func GetBgpPeer(ctx *Context, name string, id IDInput, state *BgpPeerState, opts ...ResourceOption) (*BgpPeer, error)
public static BgpPeer Get(string name, Input<string> id, BgpPeerState? state, CustomResourceOptions? opts = null)
public static BgpPeer get(String name, Output<String> id, BgpPeerState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
BfdMultiHop int

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

BgpGroupId string

The ID of the BGP group.

EnableBfd bool

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

IpVersion string

The IP version.

PeerIpAddress string

The IP address of the BGP peer.

Status string

The status of the BGP peer.

BfdMultiHop int

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

BgpGroupId string

The ID of the BGP group.

EnableBfd bool

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

IpVersion string

The IP version.

PeerIpAddress string

The IP address of the BGP peer.

Status string

The status of the BGP peer.

bfdMultiHop Integer

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

bgpGroupId String

The ID of the BGP group.

enableBfd Boolean

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

ipVersion String

The IP version.

peerIpAddress String

The IP address of the BGP peer.

status String

The status of the BGP peer.

bfdMultiHop number

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

bgpGroupId string

The ID of the BGP group.

enableBfd boolean

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

ipVersion string

The IP version.

peerIpAddress string

The IP address of the BGP peer.

status string

The status of the BGP peer.

bfd_multi_hop int

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

bgp_group_id str

The ID of the BGP group.

enable_bfd bool

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

ip_version str

The IP version.

peer_ip_address str

The IP address of the BGP peer.

status str

The status of the BGP peer.

bfdMultiHop Number

The BFD hop count. Valid values: 1 to 255. NOTE: The attribute is valid when the attribute enable_bfd is true. The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. You can set a proper value based on the factors that affect the physical connection.

bgpGroupId String

The ID of the BGP group.

enableBfd Boolean

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature.

ipVersion String

The IP version.

peerIpAddress String

The IP address of the BGP peer.

status String

The status of the BGP peer.

Import

VPC Bgp Peer can be imported using the id, e.g.

 $ pulumi import alicloud:vpc/bgpPeer:BgpPeer example <id>

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.