Router Peer Args
BGP information that must be configured into the routing stack to establish BGP peering. This information must specify the peer ASN and either the interface name, IP address, or peer IP address. Please refer to RFC4273. To get more information about RouterBgpPeer, see:
How-to Guides
Example Usage
Router Peer Basic
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RouterPeer;
import com.pulumi.gcp.compute.RouterPeerArgs;
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) {
var peer = new RouterPeer("peer", RouterPeerArgs.builder()
.advertisedRoutePriority(100)
.interface_("interface-1")
.peerAsn(65513)
.region("us-central1")
.router("my-router")
.build());
}
}
Router Peer Disabled
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RouterPeer;
import com.pulumi.gcp.compute.RouterPeerArgs;
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) {
var peer = new RouterPeer("peer", RouterPeerArgs.builder()
.advertisedRoutePriority(100)
.enable(false)
.interface_("interface-1")
.peerAsn(65513)
.peerIpAddress("169.254.1.2")
.region("us-central1")
.router("my-router")
.build());
}
}
Router Peer Bfd
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RouterPeer;
import com.pulumi.gcp.compute.RouterPeerArgs;
import com.pulumi.gcp.compute.inputs.RouterPeerBfdArgs;
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) {
var peer = new RouterPeer("peer", RouterPeerArgs.builder()
.advertisedRoutePriority(100)
.bfd(RouterPeerBfdArgs.builder()
.minReceiveInterval(1000)
.minTransmitInterval(1000)
.multiplier(5)
.sessionInitializationMode("ACTIVE")
.build())
.interface_("interface-1")
.peerAsn(65513)
.peerIpAddress("169.254.1.2")
.region("us-central1")
.router("my-router")
.build());
}
}
Router Peer Router Appliance
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.compute.Address;
import com.pulumi.gcp.compute.AddressArgs;
import com.pulumi.gcp.compute.Instance;
import com.pulumi.gcp.compute.InstanceArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
import com.pulumi.gcp.networkconnectivity.Hub;
import com.pulumi.gcp.networkconnectivity.Spoke;
import com.pulumi.gcp.networkconnectivity.SpokeArgs;
import com.pulumi.gcp.networkconnectivity.inputs.SpokeLinkedRouterApplianceInstancesArgs;
import com.pulumi.gcp.compute.Router;
import com.pulumi.gcp.compute.RouterArgs;
import com.pulumi.gcp.compute.inputs.RouterBgpArgs;
import com.pulumi.gcp.compute.RouterInterface;
import com.pulumi.gcp.compute.RouterInterfaceArgs;
import com.pulumi.gcp.compute.RouterPeer;
import com.pulumi.gcp.compute.RouterPeerArgs;
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) {
var network = new Network("network", NetworkArgs.builder()
.autoCreateSubnetworks(false)
.build());
var subnetwork = new Subnetwork("subnetwork", SubnetworkArgs.builder()
.network(network.selfLink())
.ipCidrRange("10.0.0.0/16")
.region("us-central1")
.build());
var addrIntf = new Address("addrIntf", AddressArgs.builder()
.region(subnetwork.region())
.subnetwork(subnetwork.id())
.addressType("INTERNAL")
.build());
var addrIntfRedundant = new Address("addrIntfRedundant", AddressArgs.builder()
.region(subnetwork.region())
.subnetwork(subnetwork.id())
.addressType("INTERNAL")
.build());
var addrPeer = new Address("addrPeer", AddressArgs.builder()
.region(subnetwork.region())
.subnetwork(subnetwork.id())
.addressType("INTERNAL")
.build());
var instance = new Instance("instance", InstanceArgs.builder()
.zone("us-central1-a")
.machineType("e2-medium")
.canIpForward(true)
.bootDisk(InstanceBootDiskArgs.builder()
.initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
.image("debian-cloud/debian-11")
.build())
.build())
.networkInterfaces(InstanceNetworkInterfaceArgs.builder()
.networkIp(addrPeer.address())
.subnetwork(subnetwork.selfLink())
.build())
.build());
var hub = new Hub("hub");
var spoke = new Spoke("spoke", SpokeArgs.builder()
.location(subnetwork.region())
.hub(hub.id())
.linkedRouterApplianceInstances(SpokeLinkedRouterApplianceInstancesArgs.builder()
.instances(SpokeLinkedRouterApplianceInstancesInstanceArgs.builder()
.virtualMachine(instance.selfLink())
.ipAddress(addrPeer.address())
.build())
.siteToSiteDataTransfer(false)
.build())
.build());
var router = new Router("router", RouterArgs.builder()
.region(subnetwork.region())
.network(network.selfLink())
.bgp(RouterBgpArgs.builder()
.asn(64514)
.build())
.build());
var interfaceRedundant = new RouterInterface("interfaceRedundant", RouterInterfaceArgs.builder()
.region(router.region())
.router(router.name())
.subnetwork(subnetwork.selfLink())
.privateIpAddress(addrIntfRedundant.address())
.build());
var interface_ = new RouterInterface("interface", RouterInterfaceArgs.builder()
.region(router.region())
.router(router.name())
.subnetwork(subnetwork.selfLink())
.privateIpAddress(addrIntf.address())
.redundantInterface(interfaceRedundant.name())
.build());
var peer = new RouterPeer("peer", RouterPeerArgs.builder()
.router(router.name())
.region(router.region())
.interface_(interface_.name())
.routerApplianceInstance(instance.selfLink())
.peerAsn(65513)
.peerIpAddress(addrPeer.address())
.build());
}
}
Import
RouterBgpPeer can be imported using any of these accepted formats
$ pulumi import gcp:compute/routerPeer:RouterPeer default projects/{{project}}/regions/{{region}}/routers/{{router}}/{{name}}
$ pulumi import gcp:compute/routerPeer:RouterPeer default {{project}}/{{region}}/{{router}}/{{name}}
$ pulumi import gcp:compute/routerPeer:RouterPeer default {{region}}/{{router}}/{{name}}
$ pulumi import gcp:compute/routerPeer:RouterPeer default {{router}}/{{name}}
Constructors
Properties
User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:
User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM
and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. Structure is documented below.
The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win.
User-specified flag to indicate which mode to use for advertisement. Valid values of this enum field are: DEFAULT
, CUSTOM
Default value is DEFAULT
. Possible values are: DEFAULT
, CUSTOM
.
BFD configuration for the BGP peering. Structure is documented below.
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
IPv6 address of the interface inside Google Cloud Platform. The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. If you do not specify the next hop addresses, Google Cloud automatically assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you.
Name of this BGP peer. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address
is set.
IPv6 address of the BGP interface outside Google Cloud Platform. The address must be in the range 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64. If you do not specify the next hop addresses, Google Cloud automatically assigns unused addresses from the 2600:2d00:0:2::/64 or 2600:2d00:0:3::/64 range for you.
The URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance must be located in zones contained in the same region as this Cloud Router. The VM instance is the peer side of the BGP session.