BgpPeer

class BgpPeer : KotlinCustomResource

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

NOTE: Available since 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.expressconnect.ExpressconnectFunctions;
import com.pulumi.alicloud.expressconnect.inputs.GetPhysicalConnectionsArgs;
import com.pulumi.random.RandomInteger;
import com.pulumi.random.RandomIntegerArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("tf-example");
final var examplePhysicalConnections = ExpressconnectFunctions.getPhysicalConnections(GetPhysicalConnectionsArgs.builder()
.nameRegex("^preserved-NODELETING")
.build());
var vlanId = new RandomInteger("vlanId", RandomIntegerArgs.builder()
.max(2999)
.min(1)
.build());
var exampleVirtualBorderRouter = new VirtualBorderRouter("exampleVirtualBorderRouter", VirtualBorderRouterArgs.builder()
.localGatewayIp("10.0.0.1")
.peerGatewayIp("10.0.0.2")
.peeringSubnetMask("255.255.255.252")
.physicalConnectionId(examplePhysicalConnections.applyValue(getPhysicalConnectionsResult -> getPhysicalConnectionsResult.connections()[0].id()))
.virtualBorderRouterName(name)
.vlanId(vlanId.id())
.minRxInterval(1000)
.minTxInterval(1000)
.detectMultiplier(10)
.build());
var exampleBgpGroup = new BgpGroup("exampleBgpGroup", BgpGroupArgs.builder()
.authKey("YourPassword+12345678")
.bgpGroupName(name)
.description(name)
.peerAsn(1111)
.routerId(exampleVirtualBorderRouter.id())
.isFakeAsn(true)
.build());
var exampleBgpPeer = new BgpPeer("exampleBgpPeer", BgpPeerArgs.builder()
.bfdMultiHop("10")
.bgpGroupId(exampleBgpGroup.id())
.enableBfd(true)
.ipVersion("IPV4")
.peerIpAddress("1.1.1.1")
.build());
}
}

Import

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

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

Properties

Link copied to clipboard
val bfdMultiHop: Output<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.

Link copied to clipboard
val bgpGroupId: Output<String>

The ID of the BGP group.

Link copied to clipboard
val enableBfd: Output<Boolean>?

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val ipVersion: Output<String>

The IP version.

Link copied to clipboard
val peerIpAddress: Output<String>?

The IP address of the BGP peer.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val status: Output<String>

The status of the BGP peer.

Link copied to clipboard
val urn: Output<String>