1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. RouterPeer
Google Cloud v8.27.0 published on Thursday, Apr 17, 2025 by Pulumi

gcp.compute.RouterPeer

Explore with Pulumi AI

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:

Example Usage

Router Peer Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const peer = new gcp.compute.RouterPeer("peer", {
    name: "my-router-peer",
    router: "my-router",
    region: "us-central1",
    peerAsn: 65513,
    advertisedRoutePriority: 100,
    "interface": "interface-1",
});
Copy
import pulumi
import pulumi_gcp as gcp

peer = gcp.compute.RouterPeer("peer",
    name="my-router-peer",
    router="my-router",
    region="us-central1",
    peer_asn=65513,
    advertised_route_priority=100,
    interface="interface-1")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewRouterPeer(ctx, "peer", &compute.RouterPeerArgs{
			Name:                    pulumi.String("my-router-peer"),
			Router:                  pulumi.String("my-router"),
			Region:                  pulumi.String("us-central1"),
			PeerAsn:                 pulumi.Int(65513),
			AdvertisedRoutePriority: pulumi.Int(100),
			Interface:               pulumi.String("interface-1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var peer = new Gcp.Compute.RouterPeer("peer", new()
    {
        Name = "my-router-peer",
        Router = "my-router",
        Region = "us-central1",
        PeerAsn = 65513,
        AdvertisedRoutePriority = 100,
        Interface = "interface-1",
    });

});
Copy
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()
            .name("my-router-peer")
            .router("my-router")
            .region("us-central1")
            .peerAsn(65513)
            .advertisedRoutePriority(100)
            .interface_("interface-1")
            .build());

    }
}
Copy
resources:
  peer:
    type: gcp:compute:RouterPeer
    properties:
      name: my-router-peer
      router: my-router
      region: us-central1
      peerAsn: 65513
      advertisedRoutePriority: 100
      interface: interface-1
Copy

Router Peer Disabled

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const peer = new gcp.compute.RouterPeer("peer", {
    name: "my-router-peer",
    router: "my-router",
    region: "us-central1",
    peerIpAddress: "169.254.1.2",
    peerAsn: 65513,
    advertisedRoutePriority: 100,
    "interface": "interface-1",
    enable: false,
});
Copy
import pulumi
import pulumi_gcp as gcp

peer = gcp.compute.RouterPeer("peer",
    name="my-router-peer",
    router="my-router",
    region="us-central1",
    peer_ip_address="169.254.1.2",
    peer_asn=65513,
    advertised_route_priority=100,
    interface="interface-1",
    enable=False)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewRouterPeer(ctx, "peer", &compute.RouterPeerArgs{
			Name:                    pulumi.String("my-router-peer"),
			Router:                  pulumi.String("my-router"),
			Region:                  pulumi.String("us-central1"),
			PeerIpAddress:           pulumi.String("169.254.1.2"),
			PeerAsn:                 pulumi.Int(65513),
			AdvertisedRoutePriority: pulumi.Int(100),
			Interface:               pulumi.String("interface-1"),
			Enable:                  pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var peer = new Gcp.Compute.RouterPeer("peer", new()
    {
        Name = "my-router-peer",
        Router = "my-router",
        Region = "us-central1",
        PeerIpAddress = "169.254.1.2",
        PeerAsn = 65513,
        AdvertisedRoutePriority = 100,
        Interface = "interface-1",
        Enable = false,
    });

});
Copy
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()
            .name("my-router-peer")
            .router("my-router")
            .region("us-central1")
            .peerIpAddress("169.254.1.2")
            .peerAsn(65513)
            .advertisedRoutePriority(100)
            .interface_("interface-1")
            .enable(false)
            .build());

    }
}
Copy
resources:
  peer:
    type: gcp:compute:RouterPeer
    properties:
      name: my-router-peer
      router: my-router
      region: us-central1
      peerIpAddress: 169.254.1.2
      peerAsn: 65513
      advertisedRoutePriority: 100
      interface: interface-1
      enable: false
Copy

Router Peer Bfd

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const peer = new gcp.compute.RouterPeer("peer", {
    name: "my-router-peer",
    router: "my-router",
    region: "us-central1",
    peerIpAddress: "169.254.1.2",
    peerAsn: 65513,
    advertisedRoutePriority: 100,
    "interface": "interface-1",
    bfd: {
        minReceiveInterval: 1000,
        minTransmitInterval: 1000,
        multiplier: 5,
        sessionInitializationMode: "ACTIVE",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

peer = gcp.compute.RouterPeer("peer",
    name="my-router-peer",
    router="my-router",
    region="us-central1",
    peer_ip_address="169.254.1.2",
    peer_asn=65513,
    advertised_route_priority=100,
    interface="interface-1",
    bfd={
        "min_receive_interval": 1000,
        "min_transmit_interval": 1000,
        "multiplier": 5,
        "session_initialization_mode": "ACTIVE",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewRouterPeer(ctx, "peer", &compute.RouterPeerArgs{
			Name:                    pulumi.String("my-router-peer"),
			Router:                  pulumi.String("my-router"),
			Region:                  pulumi.String("us-central1"),
			PeerIpAddress:           pulumi.String("169.254.1.2"),
			PeerAsn:                 pulumi.Int(65513),
			AdvertisedRoutePriority: pulumi.Int(100),
			Interface:               pulumi.String("interface-1"),
			Bfd: &compute.RouterPeerBfdArgs{
				MinReceiveInterval:        pulumi.Int(1000),
				MinTransmitInterval:       pulumi.Int(1000),
				Multiplier:                pulumi.Int(5),
				SessionInitializationMode: pulumi.String("ACTIVE"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var peer = new Gcp.Compute.RouterPeer("peer", new()
    {
        Name = "my-router-peer",
        Router = "my-router",
        Region = "us-central1",
        PeerIpAddress = "169.254.1.2",
        PeerAsn = 65513,
        AdvertisedRoutePriority = 100,
        Interface = "interface-1",
        Bfd = new Gcp.Compute.Inputs.RouterPeerBfdArgs
        {
            MinReceiveInterval = 1000,
            MinTransmitInterval = 1000,
            Multiplier = 5,
            SessionInitializationMode = "ACTIVE",
        },
    });

});
Copy
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()
            .name("my-router-peer")
            .router("my-router")
            .region("us-central1")
            .peerIpAddress("169.254.1.2")
            .peerAsn(65513)
            .advertisedRoutePriority(100)
            .interface_("interface-1")
            .bfd(RouterPeerBfdArgs.builder()
                .minReceiveInterval(1000)
                .minTransmitInterval(1000)
                .multiplier(5)
                .sessionInitializationMode("ACTIVE")
                .build())
            .build());

    }
}
Copy
resources:
  peer:
    type: gcp:compute:RouterPeer
    properties:
      name: my-router-peer
      router: my-router
      region: us-central1
      peerIpAddress: 169.254.1.2
      peerAsn: 65513
      advertisedRoutePriority: 100
      interface: interface-1
      bfd:
        minReceiveInterval: 1000
        minTransmitInterval: 1000
        multiplier: 5
        sessionInitializationMode: ACTIVE
Copy

Router Zero Custom Learend Route Priority

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const peer = new gcp.compute.RouterPeer("peer", {
    name: "my-router-peer",
    router: "my-router",
    region: "us-central1",
    "interface": "interface-1",
    peerAsn: 65513,
    customLearnedRoutePriority: 0,
    zeroCustomLearnedRoutePriority: true,
});
Copy
import pulumi
import pulumi_gcp as gcp

peer = gcp.compute.RouterPeer("peer",
    name="my-router-peer",
    router="my-router",
    region="us-central1",
    interface="interface-1",
    peer_asn=65513,
    custom_learned_route_priority=0,
    zero_custom_learned_route_priority=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewRouterPeer(ctx, "peer", &compute.RouterPeerArgs{
			Name:                           pulumi.String("my-router-peer"),
			Router:                         pulumi.String("my-router"),
			Region:                         pulumi.String("us-central1"),
			Interface:                      pulumi.String("interface-1"),
			PeerAsn:                        pulumi.Int(65513),
			CustomLearnedRoutePriority:     pulumi.Int(0),
			ZeroCustomLearnedRoutePriority: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var peer = new Gcp.Compute.RouterPeer("peer", new()
    {
        Name = "my-router-peer",
        Router = "my-router",
        Region = "us-central1",
        Interface = "interface-1",
        PeerAsn = 65513,
        CustomLearnedRoutePriority = 0,
        ZeroCustomLearnedRoutePriority = true,
    });

});
Copy
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()
            .name("my-router-peer")
            .router("my-router")
            .region("us-central1")
            .interface_("interface-1")
            .peerAsn(65513)
            .customLearnedRoutePriority(0)
            .zeroCustomLearnedRoutePriority(true)
            .build());

    }
}
Copy
resources:
  peer:
    type: gcp:compute:RouterPeer
    properties:
      name: my-router-peer
      router: my-router
      region: us-central1
      interface: interface-1
      peerAsn: 65513
      customLearnedRoutePriority: 0
      zeroCustomLearnedRoutePriority: true
Copy

Router Zero Advertised Route Priority

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const peer = new gcp.compute.RouterPeer("peer", {
    name: "my-router-peer",
    router: "my-router",
    region: "us-central1",
    "interface": "interface-1",
    peerAsn: 65513,
    advertisedRoutePriority: 0,
    zeroAdvertisedRoutePriority: true,
});
Copy
import pulumi
import pulumi_gcp as gcp

peer = gcp.compute.RouterPeer("peer",
    name="my-router-peer",
    router="my-router",
    region="us-central1",
    interface="interface-1",
    peer_asn=65513,
    advertised_route_priority=0,
    zero_advertised_route_priority=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewRouterPeer(ctx, "peer", &compute.RouterPeerArgs{
			Name:                        pulumi.String("my-router-peer"),
			Router:                      pulumi.String("my-router"),
			Region:                      pulumi.String("us-central1"),
			Interface:                   pulumi.String("interface-1"),
			PeerAsn:                     pulumi.Int(65513),
			AdvertisedRoutePriority:     pulumi.Int(0),
			ZeroAdvertisedRoutePriority: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var peer = new Gcp.Compute.RouterPeer("peer", new()
    {
        Name = "my-router-peer",
        Router = "my-router",
        Region = "us-central1",
        Interface = "interface-1",
        PeerAsn = 65513,
        AdvertisedRoutePriority = 0,
        ZeroAdvertisedRoutePriority = true,
    });

});
Copy
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()
            .name("my-router-peer")
            .router("my-router")
            .region("us-central1")
            .interface_("interface-1")
            .peerAsn(65513)
            .advertisedRoutePriority(0)
            .zeroAdvertisedRoutePriority(true)
            .build());

    }
}
Copy
resources:
  peer:
    type: gcp:compute:RouterPeer
    properties:
      name: my-router-peer
      router: my-router
      region: us-central1
      interface: interface-1
      peerAsn: 65513
      advertisedRoutePriority: 0
      zeroAdvertisedRoutePriority: true
Copy

Router Peer Router Appliance

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const network = new gcp.compute.Network("network", {
    name: "my-router-net",
    autoCreateSubnetworks: false,
});
const subnetwork = new gcp.compute.Subnetwork("subnetwork", {
    name: "my-router-sub",
    network: network.selfLink,
    ipCidrRange: "10.0.0.0/16",
    region: "us-central1",
});
const addrIntf = new gcp.compute.Address("addr_intf", {
    name: "my-router-addr-intf",
    region: subnetwork.region,
    subnetwork: subnetwork.id,
    addressType: "INTERNAL",
});
const addrIntfRedundant = new gcp.compute.Address("addr_intf_redundant", {
    name: "my-router-addr-intf-red",
    region: subnetwork.region,
    subnetwork: subnetwork.id,
    addressType: "INTERNAL",
});
const addrPeer = new gcp.compute.Address("addr_peer", {
    name: "my-router-addr-peer",
    region: subnetwork.region,
    subnetwork: subnetwork.id,
    addressType: "INTERNAL",
});
const instance = new gcp.compute.Instance("instance", {
    name: "router-appliance",
    zone: "us-central1-a",
    machineType: "e2-medium",
    canIpForward: true,
    bootDisk: {
        initializeParams: {
            image: "debian-cloud/debian-11",
        },
    },
    networkInterfaces: [{
        networkIp: addrPeer.address,
        subnetwork: subnetwork.selfLink,
    }],
});
const hub = new gcp.networkconnectivity.Hub("hub", {name: "my-router-hub"});
const spoke = new gcp.networkconnectivity.Spoke("spoke", {
    name: "my-router-spoke",
    location: subnetwork.region,
    hub: hub.id,
    linkedRouterApplianceInstances: {
        instances: [{
            virtualMachine: instance.selfLink,
            ipAddress: addrPeer.address,
        }],
        siteToSiteDataTransfer: false,
    },
});
const router = new gcp.compute.Router("router", {
    name: "my-router-router",
    region: subnetwork.region,
    network: network.selfLink,
    bgp: {
        asn: 64514,
    },
});
const interfaceRedundant = new gcp.compute.RouterInterface("interface_redundant", {
    name: "my-router-intf-red",
    region: router.region,
    router: router.name,
    subnetwork: subnetwork.selfLink,
    privateIpAddress: addrIntfRedundant.address,
});
const _interface = new gcp.compute.RouterInterface("interface", {
    name: "my-router-intf",
    region: router.region,
    router: router.name,
    subnetwork: subnetwork.selfLink,
    privateIpAddress: addrIntf.address,
    redundantInterface: interfaceRedundant.name,
});
const peer = new gcp.compute.RouterPeer("peer", {
    name: "my-router-peer",
    router: router.name,
    region: router.region,
    "interface": _interface.name,
    routerApplianceInstance: instance.selfLink,
    peerAsn: 65513,
    peerIpAddress: addrPeer.address,
});
Copy
import pulumi
import pulumi_gcp as gcp

network = gcp.compute.Network("network",
    name="my-router-net",
    auto_create_subnetworks=False)
subnetwork = gcp.compute.Subnetwork("subnetwork",
    name="my-router-sub",
    network=network.self_link,
    ip_cidr_range="10.0.0.0/16",
    region="us-central1")
addr_intf = gcp.compute.Address("addr_intf",
    name="my-router-addr-intf",
    region=subnetwork.region,
    subnetwork=subnetwork.id,
    address_type="INTERNAL")
addr_intf_redundant = gcp.compute.Address("addr_intf_redundant",
    name="my-router-addr-intf-red",
    region=subnetwork.region,
    subnetwork=subnetwork.id,
    address_type="INTERNAL")
addr_peer = gcp.compute.Address("addr_peer",
    name="my-router-addr-peer",
    region=subnetwork.region,
    subnetwork=subnetwork.id,
    address_type="INTERNAL")
instance = gcp.compute.Instance("instance",
    name="router-appliance",
    zone="us-central1-a",
    machine_type="e2-medium",
    can_ip_forward=True,
    boot_disk={
        "initialize_params": {
            "image": "debian-cloud/debian-11",
        },
    },
    network_interfaces=[{
        "network_ip": addr_peer.address,
        "subnetwork": subnetwork.self_link,
    }])
hub = gcp.networkconnectivity.Hub("hub", name="my-router-hub")
spoke = gcp.networkconnectivity.Spoke("spoke",
    name="my-router-spoke",
    location=subnetwork.region,
    hub=hub.id,
    linked_router_appliance_instances={
        "instances": [{
            "virtual_machine": instance.self_link,
            "ip_address": addr_peer.address,
        }],
        "site_to_site_data_transfer": False,
    })
router = gcp.compute.Router("router",
    name="my-router-router",
    region=subnetwork.region,
    network=network.self_link,
    bgp={
        "asn": 64514,
    })
interface_redundant = gcp.compute.RouterInterface("interface_redundant",
    name="my-router-intf-red",
    region=router.region,
    router=router.name,
    subnetwork=subnetwork.self_link,
    private_ip_address=addr_intf_redundant.address)
interface = gcp.compute.RouterInterface("interface",
    name="my-router-intf",
    region=router.region,
    router=router.name,
    subnetwork=subnetwork.self_link,
    private_ip_address=addr_intf.address,
    redundant_interface=interface_redundant.name)
peer = gcp.compute.RouterPeer("peer",
    name="my-router-peer",
    router=router.name,
    region=router.region,
    interface=interface.name,
    router_appliance_instance=instance.self_link,
    peer_asn=65513,
    peer_ip_address=addr_peer.address)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
Name: pulumi.String("my-router-net"),
AutoCreateSubnetworks: pulumi.Bool(false),
})
if err != nil {
return err
}
subnetwork, err := compute.NewSubnetwork(ctx, "subnetwork", &compute.SubnetworkArgs{
Name: pulumi.String("my-router-sub"),
Network: network.SelfLink,
IpCidrRange: pulumi.String("10.0.0.0/16"),
Region: pulumi.String("us-central1"),
})
if err != nil {
return err
}
addrIntf, err := compute.NewAddress(ctx, "addr_intf", &compute.AddressArgs{
Name: pulumi.String("my-router-addr-intf"),
Region: subnetwork.Region,
Subnetwork: subnetwork.ID(),
AddressType: pulumi.String("INTERNAL"),
})
if err != nil {
return err
}
addrIntfRedundant, err := compute.NewAddress(ctx, "addr_intf_redundant", &compute.AddressArgs{
Name: pulumi.String("my-router-addr-intf-red"),
Region: subnetwork.Region,
Subnetwork: subnetwork.ID(),
AddressType: pulumi.String("INTERNAL"),
})
if err != nil {
return err
}
addrPeer, err := compute.NewAddress(ctx, "addr_peer", &compute.AddressArgs{
Name: pulumi.String("my-router-addr-peer"),
Region: subnetwork.Region,
Subnetwork: subnetwork.ID(),
AddressType: pulumi.String("INTERNAL"),
})
if err != nil {
return err
}
instance, err := compute.NewInstance(ctx, "instance", &compute.InstanceArgs{
Name: pulumi.String("router-appliance"),
Zone: pulumi.String("us-central1-a"),
MachineType: pulumi.String("e2-medium"),
CanIpForward: pulumi.Bool(true),
BootDisk: &compute.InstanceBootDiskArgs{
InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
Image: pulumi.String("debian-cloud/debian-11"),
},
},
NetworkInterfaces: compute.InstanceNetworkInterfaceArray{
&compute.InstanceNetworkInterfaceArgs{
NetworkIp: addrPeer.Address,
Subnetwork: subnetwork.SelfLink,
},
},
})
if err != nil {
return err
}
hub, err := networkconnectivity.NewHub(ctx, "hub", &networkconnectivity.HubArgs{
Name: pulumi.String("my-router-hub"),
})
if err != nil {
return err
}
_, err = networkconnectivity.NewSpoke(ctx, "spoke", &networkconnectivity.SpokeArgs{
Name: pulumi.String("my-router-spoke"),
Location: subnetwork.Region,
Hub: hub.ID(),
LinkedRouterApplianceInstances: &networkconnectivity.SpokeLinkedRouterApplianceInstancesArgs{
Instances: networkconnectivity.SpokeLinkedRouterApplianceInstancesInstanceArray{
&networkconnectivity.SpokeLinkedRouterApplianceInstancesInstanceArgs{
VirtualMachine: instance.SelfLink,
IpAddress: addrPeer.Address,
},
},
SiteToSiteDataTransfer: pulumi.Bool(false),
},
})
if err != nil {
return err
}
router, err := compute.NewRouter(ctx, "router", &compute.RouterArgs{
Name: pulumi.String("my-router-router"),
Region: subnetwork.Region,
Network: network.SelfLink,
Bgp: &compute.RouterBgpArgs{
Asn: pulumi.Int(64514),
},
})
if err != nil {
return err
}
interfaceRedundant, err := compute.NewRouterInterface(ctx, "interface_redundant", &compute.RouterInterfaceArgs{
Name: pulumi.String("my-router-intf-red"),
Region: router.Region,
Router: router.Name,
Subnetwork: subnetwork.SelfLink,
PrivateIpAddress: addrIntfRedundant.Address,
})
if err != nil {
return err
}
interface, err := compute.NewRouterInterface(ctx, "interface", &compute.RouterInterfaceArgs{
Name: pulumi.String("my-router-intf"),
Region: router.Region,
Router: router.Name,
Subnetwork: subnetwork.SelfLink,
PrivateIpAddress: addrIntf.Address,
RedundantInterface: interfaceRedundant.Name,
})
if err != nil {
return err
}
_, err = compute.NewRouterPeer(ctx, "peer", &compute.RouterPeerArgs{
Name: pulumi.String("my-router-peer"),
Router: router.Name,
Region: router.Region,
Interface: interface.Name,
RouterApplianceInstance: instance.SelfLink,
PeerAsn: pulumi.Int(65513),
PeerIpAddress: addrPeer.Address,
})
if err != nil {
return err
}
return nil
})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var network = new Gcp.Compute.Network("network", new()
    {
        Name = "my-router-net",
        AutoCreateSubnetworks = false,
    });

    var subnetwork = new Gcp.Compute.Subnetwork("subnetwork", new()
    {
        Name = "my-router-sub",
        Network = network.SelfLink,
        IpCidrRange = "10.0.0.0/16",
        Region = "us-central1",
    });

    var addrIntf = new Gcp.Compute.Address("addr_intf", new()
    {
        Name = "my-router-addr-intf",
        Region = subnetwork.Region,
        Subnetwork = subnetwork.Id,
        AddressType = "INTERNAL",
    });

    var addrIntfRedundant = new Gcp.Compute.Address("addr_intf_redundant", new()
    {
        Name = "my-router-addr-intf-red",
        Region = subnetwork.Region,
        Subnetwork = subnetwork.Id,
        AddressType = "INTERNAL",
    });

    var addrPeer = new Gcp.Compute.Address("addr_peer", new()
    {
        Name = "my-router-addr-peer",
        Region = subnetwork.Region,
        Subnetwork = subnetwork.Id,
        AddressType = "INTERNAL",
    });

    var instance = new Gcp.Compute.Instance("instance", new()
    {
        Name = "router-appliance",
        Zone = "us-central1-a",
        MachineType = "e2-medium",
        CanIpForward = true,
        BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
        {
            InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
            {
                Image = "debian-cloud/debian-11",
            },
        },
        NetworkInterfaces = new[]
        {
            new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
            {
                NetworkIp = addrPeer.IPAddress,
                Subnetwork = subnetwork.SelfLink,
            },
        },
    });

    var hub = new Gcp.NetworkConnectivity.Hub("hub", new()
    {
        Name = "my-router-hub",
    });

    var spoke = new Gcp.NetworkConnectivity.Spoke("spoke", new()
    {
        Name = "my-router-spoke",
        Location = subnetwork.Region,
        Hub = hub.Id,
        LinkedRouterApplianceInstances = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedRouterApplianceInstancesArgs
        {
            Instances = new[]
            {
                new Gcp.NetworkConnectivity.Inputs.SpokeLinkedRouterApplianceInstancesInstanceArgs
                {
                    VirtualMachine = instance.SelfLink,
                    IpAddress = addrPeer.IPAddress,
                },
            },
            SiteToSiteDataTransfer = false,
        },
    });

    var router = new Gcp.Compute.Router("router", new()
    {
        Name = "my-router-router",
        Region = subnetwork.Region,
        Network = network.SelfLink,
        Bgp = new Gcp.Compute.Inputs.RouterBgpArgs
        {
            Asn = 64514,
        },
    });

    var interfaceRedundant = new Gcp.Compute.RouterInterface("interface_redundant", new()
    {
        Name = "my-router-intf-red",
        Region = router.Region,
        Router = router.Name,
        Subnetwork = subnetwork.SelfLink,
        PrivateIpAddress = addrIntfRedundant.IPAddress,
    });

    var @interface = new Gcp.Compute.RouterInterface("interface", new()
    {
        Name = "my-router-intf",
        Region = router.Region,
        Router = router.Name,
        Subnetwork = subnetwork.SelfLink,
        PrivateIpAddress = addrIntf.IPAddress,
        RedundantInterface = interfaceRedundant.Name,
    });

    var peer = new Gcp.Compute.RouterPeer("peer", new()
    {
        Name = "my-router-peer",
        Router = router.Name,
        Region = router.Region,
        Interface = @interface.Name,
        RouterApplianceInstance = instance.SelfLink,
        PeerAsn = 65513,
        PeerIpAddress = addrPeer.IPAddress,
    });

});
Copy
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.HubArgs;
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()
            .name("my-router-net")
            .autoCreateSubnetworks(false)
            .build());

        var subnetwork = new Subnetwork("subnetwork", SubnetworkArgs.builder()
            .name("my-router-sub")
            .network(network.selfLink())
            .ipCidrRange("10.0.0.0/16")
            .region("us-central1")
            .build());

        var addrIntf = new Address("addrIntf", AddressArgs.builder()
            .name("my-router-addr-intf")
            .region(subnetwork.region())
            .subnetwork(subnetwork.id())
            .addressType("INTERNAL")
            .build());

        var addrIntfRedundant = new Address("addrIntfRedundant", AddressArgs.builder()
            .name("my-router-addr-intf-red")
            .region(subnetwork.region())
            .subnetwork(subnetwork.id())
            .addressType("INTERNAL")
            .build());

        var addrPeer = new Address("addrPeer", AddressArgs.builder()
            .name("my-router-addr-peer")
            .region(subnetwork.region())
            .subnetwork(subnetwork.id())
            .addressType("INTERNAL")
            .build());

        var instance = new Instance("instance", InstanceArgs.builder()
            .name("router-appliance")
            .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", HubArgs.builder()
            .name("my-router-hub")
            .build());

        var spoke = new Spoke("spoke", SpokeArgs.builder()
            .name("my-router-spoke")
            .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()
            .name("my-router-router")
            .region(subnetwork.region())
            .network(network.selfLink())
            .bgp(RouterBgpArgs.builder()
                .asn(64514)
                .build())
            .build());

        var interfaceRedundant = new RouterInterface("interfaceRedundant", RouterInterfaceArgs.builder()
            .name("my-router-intf-red")
            .region(router.region())
            .router(router.name())
            .subnetwork(subnetwork.selfLink())
            .privateIpAddress(addrIntfRedundant.address())
            .build());

        var interface_ = new RouterInterface("interface", RouterInterfaceArgs.builder()
            .name("my-router-intf")
            .region(router.region())
            .router(router.name())
            .subnetwork(subnetwork.selfLink())
            .privateIpAddress(addrIntf.address())
            .redundantInterface(interfaceRedundant.name())
            .build());

        var peer = new RouterPeer("peer", RouterPeerArgs.builder()
            .name("my-router-peer")
            .router(router.name())
            .region(router.region())
            .interface_(interface_.name())
            .routerApplianceInstance(instance.selfLink())
            .peerAsn(65513)
            .peerIpAddress(addrPeer.address())
            .build());

    }
}
Copy
resources:
  network:
    type: gcp:compute:Network
    properties:
      name: my-router-net
      autoCreateSubnetworks: false
  subnetwork:
    type: gcp:compute:Subnetwork
    properties:
      name: my-router-sub
      network: ${network.selfLink}
      ipCidrRange: 10.0.0.0/16
      region: us-central1
  addrIntf:
    type: gcp:compute:Address
    name: addr_intf
    properties:
      name: my-router-addr-intf
      region: ${subnetwork.region}
      subnetwork: ${subnetwork.id}
      addressType: INTERNAL
  addrIntfRedundant:
    type: gcp:compute:Address
    name: addr_intf_redundant
    properties:
      name: my-router-addr-intf-red
      region: ${subnetwork.region}
      subnetwork: ${subnetwork.id}
      addressType: INTERNAL
  addrPeer:
    type: gcp:compute:Address
    name: addr_peer
    properties:
      name: my-router-addr-peer
      region: ${subnetwork.region}
      subnetwork: ${subnetwork.id}
      addressType: INTERNAL
  instance:
    type: gcp:compute:Instance
    properties:
      name: router-appliance
      zone: us-central1-a
      machineType: e2-medium
      canIpForward: true
      bootDisk:
        initializeParams:
          image: debian-cloud/debian-11
      networkInterfaces:
        - networkIp: ${addrPeer.address}
          subnetwork: ${subnetwork.selfLink}
  hub:
    type: gcp:networkconnectivity:Hub
    properties:
      name: my-router-hub
  spoke:
    type: gcp:networkconnectivity:Spoke
    properties:
      name: my-router-spoke
      location: ${subnetwork.region}
      hub: ${hub.id}
      linkedRouterApplianceInstances:
        instances:
          - virtualMachine: ${instance.selfLink}
            ipAddress: ${addrPeer.address}
        siteToSiteDataTransfer: false
  router:
    type: gcp:compute:Router
    properties:
      name: my-router-router
      region: ${subnetwork.region}
      network: ${network.selfLink}
      bgp:
        asn: 64514
  interfaceRedundant:
    type: gcp:compute:RouterInterface
    name: interface_redundant
    properties:
      name: my-router-intf-red
      region: ${router.region}
      router: ${router.name}
      subnetwork: ${subnetwork.selfLink}
      privateIpAddress: ${addrIntfRedundant.address}
  interface:
    type: gcp:compute:RouterInterface
    properties:
      name: my-router-intf
      region: ${router.region}
      router: ${router.name}
      subnetwork: ${subnetwork.selfLink}
      privateIpAddress: ${addrIntf.address}
      redundantInterface: ${interfaceRedundant.name}
  peer:
    type: gcp:compute:RouterPeer
    properties:
      name: my-router-peer
      router: ${router.name}
      region: ${router.region}
      interface: ${interface.name}
      routerApplianceInstance: ${instance.selfLink}
      peerAsn: 65513
      peerIpAddress: ${addrPeer.address}
Copy

Router Peer Md5 Authentication Key

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const foobar = new gcp.compute.RouterPeer("foobar", {
    name: "%s-peer",
    router: foobarGoogleComputeRouter.name,
    region: foobarGoogleComputeRouter.region,
    peerAsn: 65515,
    advertisedRoutePriority: 100,
    "interface": foobarGoogleComputeRouterInterface.name,
    peerIpAddress: "169.254.3.2",
    md5AuthenticationKey: {
        name: "%s-peer-key",
        key: "%s-peer-key-value",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

foobar = gcp.compute.RouterPeer("foobar",
    name="%s-peer",
    router=foobar_google_compute_router["name"],
    region=foobar_google_compute_router["region"],
    peer_asn=65515,
    advertised_route_priority=100,
    interface=foobar_google_compute_router_interface["name"],
    peer_ip_address="169.254.3.2",
    md5_authentication_key={
        "name": "%s-peer-key",
        "key": "%s-peer-key-value",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewRouterPeer(ctx, "foobar", &compute.RouterPeerArgs{
			Name:                    pulumi.String("%s-peer"),
			Router:                  pulumi.Any(foobarGoogleComputeRouter.Name),
			Region:                  pulumi.Any(foobarGoogleComputeRouter.Region),
			PeerAsn:                 pulumi.Int(65515),
			AdvertisedRoutePriority: pulumi.Int(100),
			Interface:               pulumi.Any(foobarGoogleComputeRouterInterface.Name),
			PeerIpAddress:           pulumi.String("169.254.3.2"),
			Md5AuthenticationKey: &compute.RouterPeerMd5AuthenticationKeyArgs{
				Name: pulumi.String("%s-peer-key"),
				Key:  pulumi.String("%s-peer-key-value"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var foobar = new Gcp.Compute.RouterPeer("foobar", new()
    {
        Name = "%s-peer",
        Router = foobarGoogleComputeRouter.Name,
        Region = foobarGoogleComputeRouter.Region,
        PeerAsn = 65515,
        AdvertisedRoutePriority = 100,
        Interface = foobarGoogleComputeRouterInterface.Name,
        PeerIpAddress = "169.254.3.2",
        Md5AuthenticationKey = new Gcp.Compute.Inputs.RouterPeerMd5AuthenticationKeyArgs
        {
            Name = "%s-peer-key",
            Key = "%s-peer-key-value",
        },
    });

});
Copy
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.RouterPeerMd5AuthenticationKeyArgs;
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 foobar = new RouterPeer("foobar", RouterPeerArgs.builder()
            .name("%s-peer")
            .router(foobarGoogleComputeRouter.name())
            .region(foobarGoogleComputeRouter.region())
            .peerAsn(65515)
            .advertisedRoutePriority(100)
            .interface_(foobarGoogleComputeRouterInterface.name())
            .peerIpAddress("169.254.3.2")
            .md5AuthenticationKey(RouterPeerMd5AuthenticationKeyArgs.builder()
                .name("%s-peer-key")
                .key("%s-peer-key-value")
                .build())
            .build());

    }
}
Copy
resources:
  foobar:
    type: gcp:compute:RouterPeer
    properties:
      name: '%s-peer'
      router: ${foobarGoogleComputeRouter.name}
      region: ${foobarGoogleComputeRouter.region}
      peerAsn: 65515
      advertisedRoutePriority: 100
      interface: ${foobarGoogleComputeRouterInterface.name}
      peerIpAddress: 169.254.3.2
      md5AuthenticationKey:
        name: '%s-peer-key'
        key: '%s-peer-key-value'
Copy

Router Peer Export And Import Policies

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const network = new gcp.compute.Network("network", {
    name: "my-router-net",
    autoCreateSubnetworks: false,
});
const subnetwork = new gcp.compute.Subnetwork("subnetwork", {
    name: "my-router-subnet",
    network: network.selfLink,
    ipCidrRange: "10.0.0.0/16",
    region: "us-central1",
});
const address = new gcp.compute.Address("address", {
    name: "my-router",
    region: subnetwork.region,
});
const vpnGateway = new gcp.compute.HaVpnGateway("vpn_gateway", {
    name: "my-router-gateway",
    network: network.selfLink,
    region: subnetwork.region,
});
const externalGateway = new gcp.compute.ExternalVpnGateway("external_gateway", {
    name: "my-router-external-gateway",
    redundancyType: "SINGLE_IP_INTERNALLY_REDUNDANT",
    description: "An externally managed VPN gateway",
    interfaces: [{
        id: 0,
        ipAddress: "8.8.8.8",
    }],
});
const router = new gcp.compute.Router("router", {
    name: "my-router",
    region: subnetwork.region,
    network: network.selfLink,
    bgp: {
        asn: 64514,
    },
});
const vpnTunnel = new gcp.compute.VPNTunnel("vpn_tunnel", {
    name: "my-router",
    region: subnetwork.region,
    vpnGateway: vpnGateway.id,
    peerExternalGateway: externalGateway.id,
    peerExternalGatewayInterface: 0,
    sharedSecret: "unguessable",
    router: router.name,
    vpnGatewayInterface: 0,
});
const routerInterface = new gcp.compute.RouterInterface("router_interface", {
    name: "my-router",
    router: router.name,
    region: router.region,
    vpnTunnel: vpnTunnel.name,
});
const rp_export = new gcp.compute.RouterRoutePolicy("rp-export", {
    name: "my-router-rp-export",
    router: router.name,
    region: router.region,
    type: "ROUTE_POLICY_TYPE_EXPORT",
    terms: [{
        priority: 2,
        match: {
            expression: "destination == '10.0.0.0/12'",
            title: "export_expression",
            description: "acceptance expression for export",
        },
        actions: [{
            expression: "accept()",
        }],
    }],
}, {
    dependsOn: [routerInterface],
});
const rp_import = new gcp.compute.RouterRoutePolicy("rp-import", {
    name: "my-router-rp-import",
    router: router.name,
    region: router.region,
    type: "ROUTE_POLICY_TYPE_IMPORT",
    terms: [{
        priority: 1,
        match: {
            expression: "destination == '10.0.0.0/12'",
            title: "import_expression",
            description: "acceptance expression for import",
        },
        actions: [{
            expression: "accept()",
        }],
    }],
}, {
    dependsOn: [
        routerInterface,
        rp_export,
    ],
});
const routerPeer = new gcp.compute.RouterPeer("router_peer", {
    name: "my-router-peer",
    router: router.name,
    region: router.region,
    peerAsn: 65515,
    advertisedRoutePriority: 100,
    "interface": routerInterface.name,
    md5AuthenticationKey: {
        name: "my-router-peer-key",
        key: "my-router-peer-key-value",
    },
    importPolicies: [rp_import.name],
    exportPolicies: [rp_export.name],
}, {
    dependsOn: [
        rp_export,
        rp_import,
        routerInterface,
    ],
});
Copy
import pulumi
import pulumi_gcp as gcp

network = gcp.compute.Network("network",
    name="my-router-net",
    auto_create_subnetworks=False)
subnetwork = gcp.compute.Subnetwork("subnetwork",
    name="my-router-subnet",
    network=network.self_link,
    ip_cidr_range="10.0.0.0/16",
    region="us-central1")
address = gcp.compute.Address("address",
    name="my-router",
    region=subnetwork.region)
vpn_gateway = gcp.compute.HaVpnGateway("vpn_gateway",
    name="my-router-gateway",
    network=network.self_link,
    region=subnetwork.region)
external_gateway = gcp.compute.ExternalVpnGateway("external_gateway",
    name="my-router-external-gateway",
    redundancy_type="SINGLE_IP_INTERNALLY_REDUNDANT",
    description="An externally managed VPN gateway",
    interfaces=[{
        "id": 0,
        "ip_address": "8.8.8.8",
    }])
router = gcp.compute.Router("router",
    name="my-router",
    region=subnetwork.region,
    network=network.self_link,
    bgp={
        "asn": 64514,
    })
vpn_tunnel = gcp.compute.VPNTunnel("vpn_tunnel",
    name="my-router",
    region=subnetwork.region,
    vpn_gateway=vpn_gateway.id,
    peer_external_gateway=external_gateway.id,
    peer_external_gateway_interface=0,
    shared_secret="unguessable",
    router=router.name,
    vpn_gateway_interface=0)
router_interface = gcp.compute.RouterInterface("router_interface",
    name="my-router",
    router=router.name,
    region=router.region,
    vpn_tunnel=vpn_tunnel.name)
rp_export = gcp.compute.RouterRoutePolicy("rp-export",
    name="my-router-rp-export",
    router=router.name,
    region=router.region,
    type="ROUTE_POLICY_TYPE_EXPORT",
    terms=[{
        "priority": 2,
        "match": {
            "expression": "destination == '10.0.0.0/12'",
            "title": "export_expression",
            "description": "acceptance expression for export",
        },
        "actions": [{
            "expression": "accept()",
        }],
    }],
    opts = pulumi.ResourceOptions(depends_on=[router_interface]))
rp_import = gcp.compute.RouterRoutePolicy("rp-import",
    name="my-router-rp-import",
    router=router.name,
    region=router.region,
    type="ROUTE_POLICY_TYPE_IMPORT",
    terms=[{
        "priority": 1,
        "match": {
            "expression": "destination == '10.0.0.0/12'",
            "title": "import_expression",
            "description": "acceptance expression for import",
        },
        "actions": [{
            "expression": "accept()",
        }],
    }],
    opts = pulumi.ResourceOptions(depends_on=[
            router_interface,
            rp_export,
        ]))
router_peer = gcp.compute.RouterPeer("router_peer",
    name="my-router-peer",
    router=router.name,
    region=router.region,
    peer_asn=65515,
    advertised_route_priority=100,
    interface=router_interface.name,
    md5_authentication_key={
        "name": "my-router-peer-key",
        "key": "my-router-peer-key-value",
    },
    import_policies=[rp_import.name],
    export_policies=[rp_export.name],
    opts = pulumi.ResourceOptions(depends_on=[
            rp_export,
            rp_import,
            router_interface,
        ]))
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
			Name:                  pulumi.String("my-router-net"),
			AutoCreateSubnetworks: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		subnetwork, err := compute.NewSubnetwork(ctx, "subnetwork", &compute.SubnetworkArgs{
			Name:        pulumi.String("my-router-subnet"),
			Network:     network.SelfLink,
			IpCidrRange: pulumi.String("10.0.0.0/16"),
			Region:      pulumi.String("us-central1"),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewAddress(ctx, "address", &compute.AddressArgs{
			Name:   pulumi.String("my-router"),
			Region: subnetwork.Region,
		})
		if err != nil {
			return err
		}
		vpnGateway, err := compute.NewHaVpnGateway(ctx, "vpn_gateway", &compute.HaVpnGatewayArgs{
			Name:    pulumi.String("my-router-gateway"),
			Network: network.SelfLink,
			Region:  subnetwork.Region,
		})
		if err != nil {
			return err
		}
		externalGateway, err := compute.NewExternalVpnGateway(ctx, "external_gateway", &compute.ExternalVpnGatewayArgs{
			Name:           pulumi.String("my-router-external-gateway"),
			RedundancyType: pulumi.String("SINGLE_IP_INTERNALLY_REDUNDANT"),
			Description:    pulumi.String("An externally managed VPN gateway"),
			Interfaces: compute.ExternalVpnGatewayInterfaceArray{
				&compute.ExternalVpnGatewayInterfaceArgs{
					Id:        pulumi.Int(0),
					IpAddress: pulumi.String("8.8.8.8"),
				},
			},
		})
		if err != nil {
			return err
		}
		router, err := compute.NewRouter(ctx, "router", &compute.RouterArgs{
			Name:    pulumi.String("my-router"),
			Region:  subnetwork.Region,
			Network: network.SelfLink,
			Bgp: &compute.RouterBgpArgs{
				Asn: pulumi.Int(64514),
			},
		})
		if err != nil {
			return err
		}
		vpnTunnel, err := compute.NewVPNTunnel(ctx, "vpn_tunnel", &compute.VPNTunnelArgs{
			Name:                         pulumi.String("my-router"),
			Region:                       subnetwork.Region,
			VpnGateway:                   vpnGateway.ID(),
			PeerExternalGateway:          externalGateway.ID(),
			PeerExternalGatewayInterface: pulumi.Int(0),
			SharedSecret:                 pulumi.String("unguessable"),
			Router:                       router.Name,
			VpnGatewayInterface:          pulumi.Int(0),
		})
		if err != nil {
			return err
		}
		routerInterface, err := compute.NewRouterInterface(ctx, "router_interface", &compute.RouterInterfaceArgs{
			Name:      pulumi.String("my-router"),
			Router:    router.Name,
			Region:    router.Region,
			VpnTunnel: vpnTunnel.Name,
		})
		if err != nil {
			return err
		}
		rp_export, err := compute.NewRouterRoutePolicy(ctx, "rp-export", &compute.RouterRoutePolicyArgs{
			Name:   pulumi.String("my-router-rp-export"),
			Router: router.Name,
			Region: router.Region,
			Type:   pulumi.String("ROUTE_POLICY_TYPE_EXPORT"),
			Terms: compute.RouterRoutePolicyTermArray{
				&compute.RouterRoutePolicyTermArgs{
					Priority: pulumi.Int(2),
					Match: &compute.RouterRoutePolicyTermMatchArgs{
						Expression:  pulumi.String("destination == '10.0.0.0/12'"),
						Title:       pulumi.String("export_expression"),
						Description: pulumi.String("acceptance expression for export"),
					},
					Actions: compute.RouterRoutePolicyTermActionArray{
						&compute.RouterRoutePolicyTermActionArgs{
							Expression: pulumi.String("accept()"),
						},
					},
				},
			},
		}, pulumi.DependsOn([]pulumi.Resource{
			routerInterface,
		}))
		if err != nil {
			return err
		}
		rp_import, err := compute.NewRouterRoutePolicy(ctx, "rp-import", &compute.RouterRoutePolicyArgs{
			Name:   pulumi.String("my-router-rp-import"),
			Router: router.Name,
			Region: router.Region,
			Type:   pulumi.String("ROUTE_POLICY_TYPE_IMPORT"),
			Terms: compute.RouterRoutePolicyTermArray{
				&compute.RouterRoutePolicyTermArgs{
					Priority: pulumi.Int(1),
					Match: &compute.RouterRoutePolicyTermMatchArgs{
						Expression:  pulumi.String("destination == '10.0.0.0/12'"),
						Title:       pulumi.String("import_expression"),
						Description: pulumi.String("acceptance expression for import"),
					},
					Actions: compute.RouterRoutePolicyTermActionArray{
						&compute.RouterRoutePolicyTermActionArgs{
							Expression: pulumi.String("accept()"),
						},
					},
				},
			},
		}, pulumi.DependsOn([]pulumi.Resource{
			routerInterface,
			rp_export,
		}))
		if err != nil {
			return err
		}
		_, err = compute.NewRouterPeer(ctx, "router_peer", &compute.RouterPeerArgs{
			Name:                    pulumi.String("my-router-peer"),
			Router:                  router.Name,
			Region:                  router.Region,
			PeerAsn:                 pulumi.Int(65515),
			AdvertisedRoutePriority: pulumi.Int(100),
			Interface:               routerInterface.Name,
			Md5AuthenticationKey: &compute.RouterPeerMd5AuthenticationKeyArgs{
				Name: pulumi.String("my-router-peer-key"),
				Key:  pulumi.String("my-router-peer-key-value"),
			},
			ImportPolicies: pulumi.StringArray{
				rp_import.Name,
			},
			ExportPolicies: pulumi.StringArray{
				rp_export.Name,
			},
		}, pulumi.DependsOn([]pulumi.Resource{
			rp_export,
			rp_import,
			routerInterface,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var network = new Gcp.Compute.Network("network", new()
    {
        Name = "my-router-net",
        AutoCreateSubnetworks = false,
    });

    var subnetwork = new Gcp.Compute.Subnetwork("subnetwork", new()
    {
        Name = "my-router-subnet",
        Network = network.SelfLink,
        IpCidrRange = "10.0.0.0/16",
        Region = "us-central1",
    });

    var address = new Gcp.Compute.Address("address", new()
    {
        Name = "my-router",
        Region = subnetwork.Region,
    });

    var vpnGateway = new Gcp.Compute.HaVpnGateway("vpn_gateway", new()
    {
        Name = "my-router-gateway",
        Network = network.SelfLink,
        Region = subnetwork.Region,
    });

    var externalGateway = new Gcp.Compute.ExternalVpnGateway("external_gateway", new()
    {
        Name = "my-router-external-gateway",
        RedundancyType = "SINGLE_IP_INTERNALLY_REDUNDANT",
        Description = "An externally managed VPN gateway",
        Interfaces = new[]
        {
            new Gcp.Compute.Inputs.ExternalVpnGatewayInterfaceArgs
            {
                Id = 0,
                IpAddress = "8.8.8.8",
            },
        },
    });

    var router = new Gcp.Compute.Router("router", new()
    {
        Name = "my-router",
        Region = subnetwork.Region,
        Network = network.SelfLink,
        Bgp = new Gcp.Compute.Inputs.RouterBgpArgs
        {
            Asn = 64514,
        },
    });

    var vpnTunnel = new Gcp.Compute.VPNTunnel("vpn_tunnel", new()
    {
        Name = "my-router",
        Region = subnetwork.Region,
        VpnGateway = vpnGateway.Id,
        PeerExternalGateway = externalGateway.Id,
        PeerExternalGatewayInterface = 0,
        SharedSecret = "unguessable",
        Router = router.Name,
        VpnGatewayInterface = 0,
    });

    var routerInterface = new Gcp.Compute.RouterInterface("router_interface", new()
    {
        Name = "my-router",
        Router = router.Name,
        Region = router.Region,
        VpnTunnel = vpnTunnel.Name,
    });

    var rp_export = new Gcp.Compute.RouterRoutePolicy("rp-export", new()
    {
        Name = "my-router-rp-export",
        Router = router.Name,
        Region = router.Region,
        Type = "ROUTE_POLICY_TYPE_EXPORT",
        Terms = new[]
        {
            new Gcp.Compute.Inputs.RouterRoutePolicyTermArgs
            {
                Priority = 2,
                Match = new Gcp.Compute.Inputs.RouterRoutePolicyTermMatchArgs
                {
                    Expression = "destination == '10.0.0.0/12'",
                    Title = "export_expression",
                    Description = "acceptance expression for export",
                },
                Actions = new[]
                {
                    new Gcp.Compute.Inputs.RouterRoutePolicyTermActionArgs
                    {
                        Expression = "accept()",
                    },
                },
            },
        },
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            routerInterface,
        },
    });

    var rp_import = new Gcp.Compute.RouterRoutePolicy("rp-import", new()
    {
        Name = "my-router-rp-import",
        Router = router.Name,
        Region = router.Region,
        Type = "ROUTE_POLICY_TYPE_IMPORT",
        Terms = new[]
        {
            new Gcp.Compute.Inputs.RouterRoutePolicyTermArgs
            {
                Priority = 1,
                Match = new Gcp.Compute.Inputs.RouterRoutePolicyTermMatchArgs
                {
                    Expression = "destination == '10.0.0.0/12'",
                    Title = "import_expression",
                    Description = "acceptance expression for import",
                },
                Actions = new[]
                {
                    new Gcp.Compute.Inputs.RouterRoutePolicyTermActionArgs
                    {
                        Expression = "accept()",
                    },
                },
            },
        },
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            routerInterface,
            rp_export,
        },
    });

    var routerPeer = new Gcp.Compute.RouterPeer("router_peer", new()
    {
        Name = "my-router-peer",
        Router = router.Name,
        Region = router.Region,
        PeerAsn = 65515,
        AdvertisedRoutePriority = 100,
        Interface = routerInterface.Name,
        Md5AuthenticationKey = new Gcp.Compute.Inputs.RouterPeerMd5AuthenticationKeyArgs
        {
            Name = "my-router-peer-key",
            Key = "my-router-peer-key-value",
        },
        ImportPolicies = new[]
        {
            rp_import.Name,
        },
        ExportPolicies = new[]
        {
            rp_export.Name,
        },
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            rp_export,
            rp_import,
            routerInterface,
        },
    });

});
Copy
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.HaVpnGateway;
import com.pulumi.gcp.compute.HaVpnGatewayArgs;
import com.pulumi.gcp.compute.ExternalVpnGateway;
import com.pulumi.gcp.compute.ExternalVpnGatewayArgs;
import com.pulumi.gcp.compute.inputs.ExternalVpnGatewayInterfaceArgs;
import com.pulumi.gcp.compute.Router;
import com.pulumi.gcp.compute.RouterArgs;
import com.pulumi.gcp.compute.inputs.RouterBgpArgs;
import com.pulumi.gcp.compute.VPNTunnel;
import com.pulumi.gcp.compute.VPNTunnelArgs;
import com.pulumi.gcp.compute.RouterInterface;
import com.pulumi.gcp.compute.RouterInterfaceArgs;
import com.pulumi.gcp.compute.RouterRoutePolicy;
import com.pulumi.gcp.compute.RouterRoutePolicyArgs;
import com.pulumi.gcp.compute.inputs.RouterRoutePolicyTermArgs;
import com.pulumi.gcp.compute.inputs.RouterRoutePolicyTermMatchArgs;
import com.pulumi.gcp.compute.RouterPeer;
import com.pulumi.gcp.compute.RouterPeerArgs;
import com.pulumi.gcp.compute.inputs.RouterPeerMd5AuthenticationKeyArgs;
import com.pulumi.resources.CustomResourceOptions;
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()
            .name("my-router-net")
            .autoCreateSubnetworks(false)
            .build());

        var subnetwork = new Subnetwork("subnetwork", SubnetworkArgs.builder()
            .name("my-router-subnet")
            .network(network.selfLink())
            .ipCidrRange("10.0.0.0/16")
            .region("us-central1")
            .build());

        var address = new Address("address", AddressArgs.builder()
            .name("my-router")
            .region(subnetwork.region())
            .build());

        var vpnGateway = new HaVpnGateway("vpnGateway", HaVpnGatewayArgs.builder()
            .name("my-router-gateway")
            .network(network.selfLink())
            .region(subnetwork.region())
            .build());

        var externalGateway = new ExternalVpnGateway("externalGateway", ExternalVpnGatewayArgs.builder()
            .name("my-router-external-gateway")
            .redundancyType("SINGLE_IP_INTERNALLY_REDUNDANT")
            .description("An externally managed VPN gateway")
            .interfaces(ExternalVpnGatewayInterfaceArgs.builder()
                .id(0)
                .ipAddress("8.8.8.8")
                .build())
            .build());

        var router = new Router("router", RouterArgs.builder()
            .name("my-router")
            .region(subnetwork.region())
            .network(network.selfLink())
            .bgp(RouterBgpArgs.builder()
                .asn(64514)
                .build())
            .build());

        var vpnTunnel = new VPNTunnel("vpnTunnel", VPNTunnelArgs.builder()
            .name("my-router")
            .region(subnetwork.region())
            .vpnGateway(vpnGateway.id())
            .peerExternalGateway(externalGateway.id())
            .peerExternalGatewayInterface(0)
            .sharedSecret("unguessable")
            .router(router.name())
            .vpnGatewayInterface(0)
            .build());

        var routerInterface = new RouterInterface("routerInterface", RouterInterfaceArgs.builder()
            .name("my-router")
            .router(router.name())
            .region(router.region())
            .vpnTunnel(vpnTunnel.name())
            .build());

        var rp_export = new RouterRoutePolicy("rp-export", RouterRoutePolicyArgs.builder()
            .name("my-router-rp-export")
            .router(router.name())
            .region(router.region())
            .type("ROUTE_POLICY_TYPE_EXPORT")
            .terms(RouterRoutePolicyTermArgs.builder()
                .priority(2)
                .match(RouterRoutePolicyTermMatchArgs.builder()
                    .expression("destination == '10.0.0.0/12'")
                    .title("export_expression")
                    .description("acceptance expression for export")
                    .build())
                .actions(RouterRoutePolicyTermActionArgs.builder()
                    .expression("accept()")
                    .build())
                .build())
            .build(), CustomResourceOptions.builder()
                .dependsOn(routerInterface)
                .build());

        var rp_import = new RouterRoutePolicy("rp-import", RouterRoutePolicyArgs.builder()
            .name("my-router-rp-import")
            .router(router.name())
            .region(router.region())
            .type("ROUTE_POLICY_TYPE_IMPORT")
            .terms(RouterRoutePolicyTermArgs.builder()
                .priority(1)
                .match(RouterRoutePolicyTermMatchArgs.builder()
                    .expression("destination == '10.0.0.0/12'")
                    .title("import_expression")
                    .description("acceptance expression for import")
                    .build())
                .actions(RouterRoutePolicyTermActionArgs.builder()
                    .expression("accept()")
                    .build())
                .build())
            .build(), CustomResourceOptions.builder()
                .dependsOn(                
                    routerInterface,
                    rp_export)
                .build());

        var routerPeer = new RouterPeer("routerPeer", RouterPeerArgs.builder()
            .name("my-router-peer")
            .router(router.name())
            .region(router.region())
            .peerAsn(65515)
            .advertisedRoutePriority(100)
            .interface_(routerInterface.name())
            .md5AuthenticationKey(RouterPeerMd5AuthenticationKeyArgs.builder()
                .name("my-router-peer-key")
                .key("my-router-peer-key-value")
                .build())
            .importPolicies(rp_import.name())
            .exportPolicies(rp_export.name())
            .build(), CustomResourceOptions.builder()
                .dependsOn(                
                    rp_export,
                    rp_import,
                    routerInterface)
                .build());

    }
}
Copy
resources:
  network:
    type: gcp:compute:Network
    properties:
      name: my-router-net
      autoCreateSubnetworks: false
  subnetwork:
    type: gcp:compute:Subnetwork
    properties:
      name: my-router-subnet
      network: ${network.selfLink}
      ipCidrRange: 10.0.0.0/16
      region: us-central1
  address:
    type: gcp:compute:Address
    properties:
      name: my-router
      region: ${subnetwork.region}
  vpnGateway:
    type: gcp:compute:HaVpnGateway
    name: vpn_gateway
    properties:
      name: my-router-gateway
      network: ${network.selfLink}
      region: ${subnetwork.region}
  externalGateway:
    type: gcp:compute:ExternalVpnGateway
    name: external_gateway
    properties:
      name: my-router-external-gateway
      redundancyType: SINGLE_IP_INTERNALLY_REDUNDANT
      description: An externally managed VPN gateway
      interfaces:
        - id: 0
          ipAddress: 8.8.8.8
  router:
    type: gcp:compute:Router
    properties:
      name: my-router
      region: ${subnetwork.region}
      network: ${network.selfLink}
      bgp:
        asn: 64514
  vpnTunnel:
    type: gcp:compute:VPNTunnel
    name: vpn_tunnel
    properties:
      name: my-router
      region: ${subnetwork.region}
      vpnGateway: ${vpnGateway.id}
      peerExternalGateway: ${externalGateway.id}
      peerExternalGatewayInterface: 0
      sharedSecret: unguessable
      router: ${router.name}
      vpnGatewayInterface: 0
  routerInterface:
    type: gcp:compute:RouterInterface
    name: router_interface
    properties:
      name: my-router
      router: ${router.name}
      region: ${router.region}
      vpnTunnel: ${vpnTunnel.name}
  rp-export:
    type: gcp:compute:RouterRoutePolicy
    properties:
      name: my-router-rp-export
      router: ${router.name}
      region: ${router.region}
      type: ROUTE_POLICY_TYPE_EXPORT
      terms:
        - priority: 2
          match:
            expression: destination == '10.0.0.0/12'
            title: export_expression
            description: acceptance expression for export
          actions:
            - expression: accept()
    options:
      dependsOn:
        - ${routerInterface}
  rp-import:
    type: gcp:compute:RouterRoutePolicy
    properties:
      name: my-router-rp-import
      router: ${router.name}
      region: ${router.region}
      type: ROUTE_POLICY_TYPE_IMPORT
      terms:
        - priority: 1
          match:
            expression: destination == '10.0.0.0/12'
            title: import_expression
            description: acceptance expression for import
          actions:
            - expression: accept()
    options:
      dependsOn:
        - ${routerInterface}
        - ${["rp-export"]}
  routerPeer:
    type: gcp:compute:RouterPeer
    name: router_peer
    properties:
      name: my-router-peer
      router: ${router.name}
      region: ${router.region}
      peerAsn: 65515
      advertisedRoutePriority: 100
      interface: ${routerInterface.name}
      md5AuthenticationKey:
        name: my-router-peer-key
        key: my-router-peer-key-value
      importPolicies:
        - ${["rp-import"].name}
      exportPolicies:
        - ${["rp-export"].name}
    options:
      dependsOn:
        - ${["rp-export"]}
        - ${["rp-import"]}
        - ${routerInterface}
Copy

Create RouterPeer Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RouterPeer(name: string, args: RouterPeerArgs, opts?: CustomResourceOptions);
@overload
def RouterPeer(resource_name: str,
               args: RouterPeerArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def RouterPeer(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               interface: Optional[str] = None,
               router: Optional[str] = None,
               peer_asn: Optional[int] = None,
               ipv4_nexthop_address: Optional[str] = None,
               md5_authentication_key: Optional[RouterPeerMd5AuthenticationKeyArgs] = None,
               custom_learned_ip_ranges: Optional[Sequence[RouterPeerCustomLearnedIpRangeArgs]] = None,
               custom_learned_route_priority: Optional[int] = None,
               enable: Optional[bool] = None,
               enable_ipv4: Optional[bool] = None,
               enable_ipv6: Optional[bool] = None,
               export_policies: Optional[Sequence[str]] = None,
               import_policies: Optional[Sequence[str]] = None,
               advertised_route_priority: Optional[int] = None,
               ip_address: Optional[str] = None,
               advertise_mode: Optional[str] = None,
               ipv6_nexthop_address: Optional[str] = None,
               bfd: Optional[RouterPeerBfdArgs] = None,
               name: Optional[str] = None,
               advertised_ip_ranges: Optional[Sequence[RouterPeerAdvertisedIpRangeArgs]] = None,
               peer_ip_address: Optional[str] = None,
               peer_ipv4_nexthop_address: Optional[str] = None,
               peer_ipv6_nexthop_address: Optional[str] = None,
               project: Optional[str] = None,
               region: Optional[str] = None,
               advertised_groups: Optional[Sequence[str]] = None,
               router_appliance_instance: Optional[str] = None,
               zero_advertised_route_priority: Optional[bool] = None,
               zero_custom_learned_route_priority: Optional[bool] = None)
func NewRouterPeer(ctx *Context, name string, args RouterPeerArgs, opts ...ResourceOption) (*RouterPeer, error)
public RouterPeer(string name, RouterPeerArgs args, CustomResourceOptions? opts = null)
public RouterPeer(String name, RouterPeerArgs args)
public RouterPeer(String name, RouterPeerArgs args, CustomResourceOptions options)
type: gcp:compute:RouterPeer
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

Constructor example

The following reference example uses placeholder values for all input properties.

var routerPeerResource = new Gcp.Compute.RouterPeer("routerPeerResource", new()
{
    Interface = "string",
    Router = "string",
    PeerAsn = 0,
    Ipv4NexthopAddress = "string",
    Md5AuthenticationKey = new Gcp.Compute.Inputs.RouterPeerMd5AuthenticationKeyArgs
    {
        Key = "string",
        Name = "string",
    },
    CustomLearnedIpRanges = new[]
    {
        new Gcp.Compute.Inputs.RouterPeerCustomLearnedIpRangeArgs
        {
            Range = "string",
        },
    },
    CustomLearnedRoutePriority = 0,
    Enable = false,
    EnableIpv4 = false,
    EnableIpv6 = false,
    ExportPolicies = new[]
    {
        "string",
    },
    ImportPolicies = new[]
    {
        "string",
    },
    AdvertisedRoutePriority = 0,
    IpAddress = "string",
    AdvertiseMode = "string",
    Ipv6NexthopAddress = "string",
    Bfd = new Gcp.Compute.Inputs.RouterPeerBfdArgs
    {
        SessionInitializationMode = "string",
        MinReceiveInterval = 0,
        MinTransmitInterval = 0,
        Multiplier = 0,
    },
    Name = "string",
    AdvertisedIpRanges = new[]
    {
        new Gcp.Compute.Inputs.RouterPeerAdvertisedIpRangeArgs
        {
            Range = "string",
            Description = "string",
        },
    },
    PeerIpAddress = "string",
    PeerIpv4NexthopAddress = "string",
    PeerIpv6NexthopAddress = "string",
    Project = "string",
    Region = "string",
    AdvertisedGroups = new[]
    {
        "string",
    },
    RouterApplianceInstance = "string",
    ZeroAdvertisedRoutePriority = false,
    ZeroCustomLearnedRoutePriority = false,
});
Copy
example, err := compute.NewRouterPeer(ctx, "routerPeerResource", &compute.RouterPeerArgs{
	Interface:          pulumi.String("string"),
	Router:             pulumi.String("string"),
	PeerAsn:            pulumi.Int(0),
	Ipv4NexthopAddress: pulumi.String("string"),
	Md5AuthenticationKey: &compute.RouterPeerMd5AuthenticationKeyArgs{
		Key:  pulumi.String("string"),
		Name: pulumi.String("string"),
	},
	CustomLearnedIpRanges: compute.RouterPeerCustomLearnedIpRangeArray{
		&compute.RouterPeerCustomLearnedIpRangeArgs{
			Range: pulumi.String("string"),
		},
	},
	CustomLearnedRoutePriority: pulumi.Int(0),
	Enable:                     pulumi.Bool(false),
	EnableIpv4:                 pulumi.Bool(false),
	EnableIpv6:                 pulumi.Bool(false),
	ExportPolicies: pulumi.StringArray{
		pulumi.String("string"),
	},
	ImportPolicies: pulumi.StringArray{
		pulumi.String("string"),
	},
	AdvertisedRoutePriority: pulumi.Int(0),
	IpAddress:               pulumi.String("string"),
	AdvertiseMode:           pulumi.String("string"),
	Ipv6NexthopAddress:      pulumi.String("string"),
	Bfd: &compute.RouterPeerBfdArgs{
		SessionInitializationMode: pulumi.String("string"),
		MinReceiveInterval:        pulumi.Int(0),
		MinTransmitInterval:       pulumi.Int(0),
		Multiplier:                pulumi.Int(0),
	},
	Name: pulumi.String("string"),
	AdvertisedIpRanges: compute.RouterPeerAdvertisedIpRangeArray{
		&compute.RouterPeerAdvertisedIpRangeArgs{
			Range:       pulumi.String("string"),
			Description: pulumi.String("string"),
		},
	},
	PeerIpAddress:          pulumi.String("string"),
	PeerIpv4NexthopAddress: pulumi.String("string"),
	PeerIpv6NexthopAddress: pulumi.String("string"),
	Project:                pulumi.String("string"),
	Region:                 pulumi.String("string"),
	AdvertisedGroups: pulumi.StringArray{
		pulumi.String("string"),
	},
	RouterApplianceInstance:        pulumi.String("string"),
	ZeroAdvertisedRoutePriority:    pulumi.Bool(false),
	ZeroCustomLearnedRoutePriority: pulumi.Bool(false),
})
Copy
var routerPeerResource = new RouterPeer("routerPeerResource", RouterPeerArgs.builder()
    .interface_("string")
    .router("string")
    .peerAsn(0)
    .ipv4NexthopAddress("string")
    .md5AuthenticationKey(RouterPeerMd5AuthenticationKeyArgs.builder()
        .key("string")
        .name("string")
        .build())
    .customLearnedIpRanges(RouterPeerCustomLearnedIpRangeArgs.builder()
        .range("string")
        .build())
    .customLearnedRoutePriority(0)
    .enable(false)
    .enableIpv4(false)
    .enableIpv6(false)
    .exportPolicies("string")
    .importPolicies("string")
    .advertisedRoutePriority(0)
    .ipAddress("string")
    .advertiseMode("string")
    .ipv6NexthopAddress("string")
    .bfd(RouterPeerBfdArgs.builder()
        .sessionInitializationMode("string")
        .minReceiveInterval(0)
        .minTransmitInterval(0)
        .multiplier(0)
        .build())
    .name("string")
    .advertisedIpRanges(RouterPeerAdvertisedIpRangeArgs.builder()
        .range("string")
        .description("string")
        .build())
    .peerIpAddress("string")
    .peerIpv4NexthopAddress("string")
    .peerIpv6NexthopAddress("string")
    .project("string")
    .region("string")
    .advertisedGroups("string")
    .routerApplianceInstance("string")
    .zeroAdvertisedRoutePriority(false)
    .zeroCustomLearnedRoutePriority(false)
    .build());
Copy
router_peer_resource = gcp.compute.RouterPeer("routerPeerResource",
    interface="string",
    router="string",
    peer_asn=0,
    ipv4_nexthop_address="string",
    md5_authentication_key={
        "key": "string",
        "name": "string",
    },
    custom_learned_ip_ranges=[{
        "range": "string",
    }],
    custom_learned_route_priority=0,
    enable=False,
    enable_ipv4=False,
    enable_ipv6=False,
    export_policies=["string"],
    import_policies=["string"],
    advertised_route_priority=0,
    ip_address="string",
    advertise_mode="string",
    ipv6_nexthop_address="string",
    bfd={
        "session_initialization_mode": "string",
        "min_receive_interval": 0,
        "min_transmit_interval": 0,
        "multiplier": 0,
    },
    name="string",
    advertised_ip_ranges=[{
        "range": "string",
        "description": "string",
    }],
    peer_ip_address="string",
    peer_ipv4_nexthop_address="string",
    peer_ipv6_nexthop_address="string",
    project="string",
    region="string",
    advertised_groups=["string"],
    router_appliance_instance="string",
    zero_advertised_route_priority=False,
    zero_custom_learned_route_priority=False)
Copy
const routerPeerResource = new gcp.compute.RouterPeer("routerPeerResource", {
    "interface": "string",
    router: "string",
    peerAsn: 0,
    ipv4NexthopAddress: "string",
    md5AuthenticationKey: {
        key: "string",
        name: "string",
    },
    customLearnedIpRanges: [{
        range: "string",
    }],
    customLearnedRoutePriority: 0,
    enable: false,
    enableIpv4: false,
    enableIpv6: false,
    exportPolicies: ["string"],
    importPolicies: ["string"],
    advertisedRoutePriority: 0,
    ipAddress: "string",
    advertiseMode: "string",
    ipv6NexthopAddress: "string",
    bfd: {
        sessionInitializationMode: "string",
        minReceiveInterval: 0,
        minTransmitInterval: 0,
        multiplier: 0,
    },
    name: "string",
    advertisedIpRanges: [{
        range: "string",
        description: "string",
    }],
    peerIpAddress: "string",
    peerIpv4NexthopAddress: "string",
    peerIpv6NexthopAddress: "string",
    project: "string",
    region: "string",
    advertisedGroups: ["string"],
    routerApplianceInstance: "string",
    zeroAdvertisedRoutePriority: false,
    zeroCustomLearnedRoutePriority: false,
});
Copy
type: gcp:compute:RouterPeer
properties:
    advertiseMode: string
    advertisedGroups:
        - string
    advertisedIpRanges:
        - description: string
          range: string
    advertisedRoutePriority: 0
    bfd:
        minReceiveInterval: 0
        minTransmitInterval: 0
        multiplier: 0
        sessionInitializationMode: string
    customLearnedIpRanges:
        - range: string
    customLearnedRoutePriority: 0
    enable: false
    enableIpv4: false
    enableIpv6: false
    exportPolicies:
        - string
    importPolicies:
        - string
    interface: string
    ipAddress: string
    ipv4NexthopAddress: string
    ipv6NexthopAddress: string
    md5AuthenticationKey:
        key: string
        name: string
    name: string
    peerAsn: 0
    peerIpAddress: string
    peerIpv4NexthopAddress: string
    peerIpv6NexthopAddress: string
    project: string
    region: string
    router: string
    routerApplianceInstance: string
    zeroAdvertisedRoutePriority: false
    zeroCustomLearnedRoutePriority: false
Copy

RouterPeer Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The RouterPeer resource accepts the following input properties:

Interface
This property is required.
Changes to this property will trigger replacement.
string
Name of the interface the BGP peer is associated with.
PeerAsn This property is required. int
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
Router
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cloud Router in which this BgpPeer will be configured.


AdvertiseMode string
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.
AdvertisedGroups List<string>

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

AdvertisedIpRanges List<RouterPeerAdvertisedIpRange>
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.
AdvertisedRoutePriority int
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.
Bfd RouterPeerBfd
BFD configuration for the BGP peering. Structure is documented below.
CustomLearnedIpRanges List<RouterPeerCustomLearnedIpRange>
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
CustomLearnedRoutePriority int
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
Enable bool
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
EnableIpv4 bool
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
EnableIpv6 bool
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
ExportPolicies List<string>
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
ImportPolicies List<string>
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
IpAddress string
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
Ipv4NexthopAddress string
IPv4 address of the interface inside Google Cloud Platform.
Ipv6NexthopAddress string
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.
Md5AuthenticationKey RouterPeerMd5AuthenticationKey
Configuration for MD5 authentication on the BGP session. Structure is documented below.
Name Changes to this property will trigger replacement. string
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.
PeerIpAddress string
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
PeerIpv4NexthopAddress string
IPv4 address of the BGP interface outside Google Cloud Platform.
PeerIpv6NexthopAddress string
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.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
RouterApplianceInstance string
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.
ZeroAdvertisedRoutePriority bool
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
ZeroCustomLearnedRoutePriority bool
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.
Interface
This property is required.
Changes to this property will trigger replacement.
string
Name of the interface the BGP peer is associated with.
PeerAsn This property is required. int
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
Router
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cloud Router in which this BgpPeer will be configured.


AdvertiseMode string
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.
AdvertisedGroups []string

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

AdvertisedIpRanges []RouterPeerAdvertisedIpRangeArgs
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.
AdvertisedRoutePriority int
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.
Bfd RouterPeerBfdArgs
BFD configuration for the BGP peering. Structure is documented below.
CustomLearnedIpRanges []RouterPeerCustomLearnedIpRangeArgs
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
CustomLearnedRoutePriority int
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
Enable bool
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
EnableIpv4 bool
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
EnableIpv6 bool
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
ExportPolicies []string
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
ImportPolicies []string
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
IpAddress string
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
Ipv4NexthopAddress string
IPv4 address of the interface inside Google Cloud Platform.
Ipv6NexthopAddress string
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.
Md5AuthenticationKey RouterPeerMd5AuthenticationKeyArgs
Configuration for MD5 authentication on the BGP session. Structure is documented below.
Name Changes to this property will trigger replacement. string
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.
PeerIpAddress string
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
PeerIpv4NexthopAddress string
IPv4 address of the BGP interface outside Google Cloud Platform.
PeerIpv6NexthopAddress string
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.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
RouterApplianceInstance string
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.
ZeroAdvertisedRoutePriority bool
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
ZeroCustomLearnedRoutePriority bool
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.
interface_
This property is required.
Changes to this property will trigger replacement.
String
Name of the interface the BGP peer is associated with.
peerAsn This property is required. Integer
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
router
This property is required.
Changes to this property will trigger replacement.
String
The name of the Cloud Router in which this BgpPeer will be configured.


advertiseMode String
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.
advertisedGroups List<String>

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

advertisedIpRanges List<RouterPeerAdvertisedIpRange>
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.
advertisedRoutePriority Integer
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.
bfd RouterPeerBfd
BFD configuration for the BGP peering. Structure is documented below.
customLearnedIpRanges List<RouterPeerCustomLearnedIpRange>
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
customLearnedRoutePriority Integer
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
enable Boolean
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
enableIpv4 Boolean
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
enableIpv6 Boolean
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
exportPolicies List<String>
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
importPolicies List<String>
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
ipAddress String
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
ipv4NexthopAddress String
IPv4 address of the interface inside Google Cloud Platform.
ipv6NexthopAddress String
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.
md5AuthenticationKey RouterPeerMd5AuthenticationKey
Configuration for MD5 authentication on the BGP session. Structure is documented below.
name Changes to this property will trigger replacement. String
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.
peerIpAddress String
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
peerIpv4NexthopAddress String
IPv4 address of the BGP interface outside Google Cloud Platform.
peerIpv6NexthopAddress String
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.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
routerApplianceInstance String
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.
zeroAdvertisedRoutePriority Boolean
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
zeroCustomLearnedRoutePriority Boolean
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.
interface
This property is required.
Changes to this property will trigger replacement.
string
Name of the interface the BGP peer is associated with.
peerAsn This property is required. number
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
router
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cloud Router in which this BgpPeer will be configured.


advertiseMode string
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.
advertisedGroups string[]

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

advertisedIpRanges RouterPeerAdvertisedIpRange[]
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.
advertisedRoutePriority number
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.
bfd RouterPeerBfd
BFD configuration for the BGP peering. Structure is documented below.
customLearnedIpRanges RouterPeerCustomLearnedIpRange[]
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
customLearnedRoutePriority number
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
enable boolean
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
enableIpv4 boolean
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
enableIpv6 boolean
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
exportPolicies string[]
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
importPolicies string[]
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
ipAddress string
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
ipv4NexthopAddress string
IPv4 address of the interface inside Google Cloud Platform.
ipv6NexthopAddress string
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.
md5AuthenticationKey RouterPeerMd5AuthenticationKey
Configuration for MD5 authentication on the BGP session. Structure is documented below.
name Changes to this property will trigger replacement. string
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.
peerIpAddress string
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
peerIpv4NexthopAddress string
IPv4 address of the BGP interface outside Google Cloud Platform.
peerIpv6NexthopAddress string
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.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. string
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
routerApplianceInstance string
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.
zeroAdvertisedRoutePriority boolean
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
zeroCustomLearnedRoutePriority boolean
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.
interface
This property is required.
Changes to this property will trigger replacement.
str
Name of the interface the BGP peer is associated with.
peer_asn This property is required. int
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
router
This property is required.
Changes to this property will trigger replacement.
str
The name of the Cloud Router in which this BgpPeer will be configured.


str
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.
advertised_groups Sequence[str]

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

advertised_ip_ranges Sequence[RouterPeerAdvertisedIpRangeArgs]
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.
advertised_route_priority int
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.
bfd RouterPeerBfdArgs
BFD configuration for the BGP peering. Structure is documented below.
custom_learned_ip_ranges Sequence[RouterPeerCustomLearnedIpRangeArgs]
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
custom_learned_route_priority int
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
enable bool
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
enable_ipv4 bool
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
enable_ipv6 bool
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
export_policies Sequence[str]
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
import_policies Sequence[str]
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
ip_address str
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
ipv4_nexthop_address str
IPv4 address of the interface inside Google Cloud Platform.
ipv6_nexthop_address str
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.
md5_authentication_key RouterPeerMd5AuthenticationKeyArgs
Configuration for MD5 authentication on the BGP session. Structure is documented below.
name Changes to this property will trigger replacement. str
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.
peer_ip_address str
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
peer_ipv4_nexthop_address str
IPv4 address of the BGP interface outside Google Cloud Platform.
peer_ipv6_nexthop_address str
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.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. str
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
router_appliance_instance str
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.
zero_advertised_route_priority bool
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
zero_custom_learned_route_priority bool
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.
interface
This property is required.
Changes to this property will trigger replacement.
String
Name of the interface the BGP peer is associated with.
peerAsn This property is required. Number
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
router
This property is required.
Changes to this property will trigger replacement.
String
The name of the Cloud Router in which this BgpPeer will be configured.


advertiseMode String
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.
advertisedGroups List<String>

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

advertisedIpRanges List<Property Map>
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.
advertisedRoutePriority Number
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.
bfd Property Map
BFD configuration for the BGP peering. Structure is documented below.
customLearnedIpRanges List<Property Map>
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
customLearnedRoutePriority Number
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
enable Boolean
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
enableIpv4 Boolean
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
enableIpv6 Boolean
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
exportPolicies List<String>
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
importPolicies List<String>
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
ipAddress String
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
ipv4NexthopAddress String
IPv4 address of the interface inside Google Cloud Platform.
ipv6NexthopAddress String
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.
md5AuthenticationKey Property Map
Configuration for MD5 authentication on the BGP session. Structure is documented below.
name Changes to this property will trigger replacement. String
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.
peerIpAddress String
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
peerIpv4NexthopAddress String
IPv4 address of the BGP interface outside Google Cloud Platform.
peerIpv6NexthopAddress String
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.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
routerApplianceInstance String
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.
zeroAdvertisedRoutePriority Boolean
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
zeroCustomLearnedRoutePriority Boolean
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
IsAdvertisedRoutePrioritySet bool
An internal boolean field for provider use for zero_advertised_route_priority.
IsCustomLearnedPrioritySet bool
An internal boolean field for provider use.
ManagementType string
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
Id string
The provider-assigned unique ID for this managed resource.
IsAdvertisedRoutePrioritySet bool
An internal boolean field for provider use for zero_advertised_route_priority.
IsCustomLearnedPrioritySet bool
An internal boolean field for provider use.
ManagementType string
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
id String
The provider-assigned unique ID for this managed resource.
isAdvertisedRoutePrioritySet Boolean
An internal boolean field for provider use for zero_advertised_route_priority.
isCustomLearnedPrioritySet Boolean
An internal boolean field for provider use.
managementType String
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
id string
The provider-assigned unique ID for this managed resource.
isAdvertisedRoutePrioritySet boolean
An internal boolean field for provider use for zero_advertised_route_priority.
isCustomLearnedPrioritySet boolean
An internal boolean field for provider use.
managementType string
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
id str
The provider-assigned unique ID for this managed resource.
is_advertised_route_priority_set bool
An internal boolean field for provider use for zero_advertised_route_priority.
is_custom_learned_priority_set bool
An internal boolean field for provider use.
management_type str
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
id String
The provider-assigned unique ID for this managed resource.
isAdvertisedRoutePrioritySet Boolean
An internal boolean field for provider use for zero_advertised_route_priority.
isCustomLearnedPrioritySet Boolean
An internal boolean field for provider use.
managementType String
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.

Look up Existing RouterPeer Resource

Get an existing RouterPeer 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?: RouterPeerState, opts?: CustomResourceOptions): RouterPeer
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        advertise_mode: Optional[str] = None,
        advertised_groups: Optional[Sequence[str]] = None,
        advertised_ip_ranges: Optional[Sequence[RouterPeerAdvertisedIpRangeArgs]] = None,
        advertised_route_priority: Optional[int] = None,
        bfd: Optional[RouterPeerBfdArgs] = None,
        custom_learned_ip_ranges: Optional[Sequence[RouterPeerCustomLearnedIpRangeArgs]] = None,
        custom_learned_route_priority: Optional[int] = None,
        enable: Optional[bool] = None,
        enable_ipv4: Optional[bool] = None,
        enable_ipv6: Optional[bool] = None,
        export_policies: Optional[Sequence[str]] = None,
        import_policies: Optional[Sequence[str]] = None,
        interface: Optional[str] = None,
        ip_address: Optional[str] = None,
        ipv4_nexthop_address: Optional[str] = None,
        ipv6_nexthop_address: Optional[str] = None,
        is_advertised_route_priority_set: Optional[bool] = None,
        is_custom_learned_priority_set: Optional[bool] = None,
        management_type: Optional[str] = None,
        md5_authentication_key: Optional[RouterPeerMd5AuthenticationKeyArgs] = None,
        name: Optional[str] = None,
        peer_asn: Optional[int] = None,
        peer_ip_address: Optional[str] = None,
        peer_ipv4_nexthop_address: Optional[str] = None,
        peer_ipv6_nexthop_address: Optional[str] = None,
        project: Optional[str] = None,
        region: Optional[str] = None,
        router: Optional[str] = None,
        router_appliance_instance: Optional[str] = None,
        zero_advertised_route_priority: Optional[bool] = None,
        zero_custom_learned_route_priority: Optional[bool] = None) -> RouterPeer
func GetRouterPeer(ctx *Context, name string, id IDInput, state *RouterPeerState, opts ...ResourceOption) (*RouterPeer, error)
public static RouterPeer Get(string name, Input<string> id, RouterPeerState? state, CustomResourceOptions? opts = null)
public static RouterPeer get(String name, Output<String> id, RouterPeerState state, CustomResourceOptions options)
resources:  _:    type: gcp:compute:RouterPeer    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AdvertiseMode string
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.
AdvertisedGroups List<string>

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

AdvertisedIpRanges List<RouterPeerAdvertisedIpRange>
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.
AdvertisedRoutePriority int
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.
Bfd RouterPeerBfd
BFD configuration for the BGP peering. Structure is documented below.
CustomLearnedIpRanges List<RouterPeerCustomLearnedIpRange>
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
CustomLearnedRoutePriority int
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
Enable bool
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
EnableIpv4 bool
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
EnableIpv6 bool
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
ExportPolicies List<string>
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
ImportPolicies List<string>
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
Interface Changes to this property will trigger replacement. string
Name of the interface the BGP peer is associated with.
IpAddress string
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
Ipv4NexthopAddress string
IPv4 address of the interface inside Google Cloud Platform.
Ipv6NexthopAddress string
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.
IsAdvertisedRoutePrioritySet bool
An internal boolean field for provider use for zero_advertised_route_priority.
IsCustomLearnedPrioritySet bool
An internal boolean field for provider use.
ManagementType string
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
Md5AuthenticationKey RouterPeerMd5AuthenticationKey
Configuration for MD5 authentication on the BGP session. Structure is documented below.
Name Changes to this property will trigger replacement. string
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.
PeerAsn int
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
PeerIpAddress string
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
PeerIpv4NexthopAddress string
IPv4 address of the BGP interface outside Google Cloud Platform.
PeerIpv6NexthopAddress string
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.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
Router Changes to this property will trigger replacement. string
The name of the Cloud Router in which this BgpPeer will be configured.


RouterApplianceInstance string
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.
ZeroAdvertisedRoutePriority bool
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
ZeroCustomLearnedRoutePriority bool
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.
AdvertiseMode string
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.
AdvertisedGroups []string

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

AdvertisedIpRanges []RouterPeerAdvertisedIpRangeArgs
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.
AdvertisedRoutePriority int
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.
Bfd RouterPeerBfdArgs
BFD configuration for the BGP peering. Structure is documented below.
CustomLearnedIpRanges []RouterPeerCustomLearnedIpRangeArgs
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
CustomLearnedRoutePriority int
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
Enable bool
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
EnableIpv4 bool
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
EnableIpv6 bool
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
ExportPolicies []string
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
ImportPolicies []string
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
Interface Changes to this property will trigger replacement. string
Name of the interface the BGP peer is associated with.
IpAddress string
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
Ipv4NexthopAddress string
IPv4 address of the interface inside Google Cloud Platform.
Ipv6NexthopAddress string
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.
IsAdvertisedRoutePrioritySet bool
An internal boolean field for provider use for zero_advertised_route_priority.
IsCustomLearnedPrioritySet bool
An internal boolean field for provider use.
ManagementType string
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
Md5AuthenticationKey RouterPeerMd5AuthenticationKeyArgs
Configuration for MD5 authentication on the BGP session. Structure is documented below.
Name Changes to this property will trigger replacement. string
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.
PeerAsn int
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
PeerIpAddress string
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
PeerIpv4NexthopAddress string
IPv4 address of the BGP interface outside Google Cloud Platform.
PeerIpv6NexthopAddress string
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.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
Router Changes to this property will trigger replacement. string
The name of the Cloud Router in which this BgpPeer will be configured.


RouterApplianceInstance string
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.
ZeroAdvertisedRoutePriority bool
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
ZeroCustomLearnedRoutePriority bool
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.
advertiseMode String
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.
advertisedGroups List<String>

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

advertisedIpRanges List<RouterPeerAdvertisedIpRange>
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.
advertisedRoutePriority Integer
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.
bfd RouterPeerBfd
BFD configuration for the BGP peering. Structure is documented below.
customLearnedIpRanges List<RouterPeerCustomLearnedIpRange>
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
customLearnedRoutePriority Integer
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
enable Boolean
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
enableIpv4 Boolean
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
enableIpv6 Boolean
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
exportPolicies List<String>
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
importPolicies List<String>
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
interface_ Changes to this property will trigger replacement. String
Name of the interface the BGP peer is associated with.
ipAddress String
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
ipv4NexthopAddress String
IPv4 address of the interface inside Google Cloud Platform.
ipv6NexthopAddress String
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.
isAdvertisedRoutePrioritySet Boolean
An internal boolean field for provider use for zero_advertised_route_priority.
isCustomLearnedPrioritySet Boolean
An internal boolean field for provider use.
managementType String
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
md5AuthenticationKey RouterPeerMd5AuthenticationKey
Configuration for MD5 authentication on the BGP session. Structure is documented below.
name Changes to this property will trigger replacement. String
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.
peerAsn Integer
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
peerIpAddress String
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
peerIpv4NexthopAddress String
IPv4 address of the BGP interface outside Google Cloud Platform.
peerIpv6NexthopAddress String
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.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
router Changes to this property will trigger replacement. String
The name of the Cloud Router in which this BgpPeer will be configured.


routerApplianceInstance String
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.
zeroAdvertisedRoutePriority Boolean
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
zeroCustomLearnedRoutePriority Boolean
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.
advertiseMode string
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.
advertisedGroups string[]

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

advertisedIpRanges RouterPeerAdvertisedIpRange[]
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.
advertisedRoutePriority number
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.
bfd RouterPeerBfd
BFD configuration for the BGP peering. Structure is documented below.
customLearnedIpRanges RouterPeerCustomLearnedIpRange[]
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
customLearnedRoutePriority number
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
enable boolean
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
enableIpv4 boolean
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
enableIpv6 boolean
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
exportPolicies string[]
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
importPolicies string[]
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
interface Changes to this property will trigger replacement. string
Name of the interface the BGP peer is associated with.
ipAddress string
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
ipv4NexthopAddress string
IPv4 address of the interface inside Google Cloud Platform.
ipv6NexthopAddress string
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.
isAdvertisedRoutePrioritySet boolean
An internal boolean field for provider use for zero_advertised_route_priority.
isCustomLearnedPrioritySet boolean
An internal boolean field for provider use.
managementType string
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
md5AuthenticationKey RouterPeerMd5AuthenticationKey
Configuration for MD5 authentication on the BGP session. Structure is documented below.
name Changes to this property will trigger replacement. string
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.
peerAsn number
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
peerIpAddress string
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
peerIpv4NexthopAddress string
IPv4 address of the BGP interface outside Google Cloud Platform.
peerIpv6NexthopAddress string
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.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. string
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
router Changes to this property will trigger replacement. string
The name of the Cloud Router in which this BgpPeer will be configured.


routerApplianceInstance string
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.
zeroAdvertisedRoutePriority boolean
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
zeroCustomLearnedRoutePriority boolean
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.
advertise_mode str
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.
advertised_groups Sequence[str]

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

advertised_ip_ranges Sequence[RouterPeerAdvertisedIpRangeArgs]
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.
advertised_route_priority int
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.
bfd RouterPeerBfdArgs
BFD configuration for the BGP peering. Structure is documented below.
custom_learned_ip_ranges Sequence[RouterPeerCustomLearnedIpRangeArgs]
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
custom_learned_route_priority int
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
enable bool
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
enable_ipv4 bool
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
enable_ipv6 bool
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
export_policies Sequence[str]
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
import_policies Sequence[str]
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
interface Changes to this property will trigger replacement. str
Name of the interface the BGP peer is associated with.
ip_address str
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
ipv4_nexthop_address str
IPv4 address of the interface inside Google Cloud Platform.
ipv6_nexthop_address str
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.
is_advertised_route_priority_set bool
An internal boolean field for provider use for zero_advertised_route_priority.
is_custom_learned_priority_set bool
An internal boolean field for provider use.
management_type str
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
md5_authentication_key RouterPeerMd5AuthenticationKeyArgs
Configuration for MD5 authentication on the BGP session. Structure is documented below.
name Changes to this property will trigger replacement. str
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.
peer_asn int
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
peer_ip_address str
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
peer_ipv4_nexthop_address str
IPv4 address of the BGP interface outside Google Cloud Platform.
peer_ipv6_nexthop_address str
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.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. str
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
router Changes to this property will trigger replacement. str
The name of the Cloud Router in which this BgpPeer will be configured.


router_appliance_instance str
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.
zero_advertised_route_priority bool
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
zero_custom_learned_route_priority bool
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.
advertiseMode String
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.
advertisedGroups List<String>

User-specified list of prefix groups to advertise in custom mode, which currently supports the following option:

  • ALL_SUBNETS: Advertises all of the router's own VPC subnets. This excludes any routes learned for subnets that use VPC Network Peering.

Note that this field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups.

advertisedIpRanges List<Property Map>
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.
advertisedRoutePriority Number
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.
bfd Property Map
BFD configuration for the BGP peering. Structure is documented below.
customLearnedIpRanges List<Property Map>
The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a /32 singular IP address range, and, for IPv6, /128. Structure is documented below.
customLearnedRoutePriority Number
The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from 0 to 65335. If you don't provide a value, Google Cloud assigns a priority of 100 to the ranges.
enable Boolean
The status of the BGP peer connection. If set to false, any active session with the peer is terminated and all associated routing information is removed. If set to true, the peer connection can be established with routing information. The default is true.
enableIpv4 Boolean
Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4.
enableIpv6 Boolean
Enable IPv6 traffic over BGP Peer. If not specified, it is disabled by default.
exportPolicies List<String>
routers.list of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type.
importPolicies List<String>
routers.list of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type.
interface Changes to this property will trigger replacement. String
Name of the interface the BGP peer is associated with.
ipAddress String
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported.
ipv4NexthopAddress String
IPv4 address of the interface inside Google Cloud Platform.
ipv6NexthopAddress String
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.
isAdvertisedRoutePrioritySet Boolean
An internal boolean field for provider use for zero_advertised_route_priority.
isCustomLearnedPrioritySet Boolean
An internal boolean field for provider use.
managementType String
The resource that configures and manages this BGP peer.

  • MANAGED_BY_USER is the default value and can be managed by you or other users
  • MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted.
md5AuthenticationKey Property Map
Configuration for MD5 authentication on the BGP session. Structure is documented below.
name Changes to this property will trigger replacement. String
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.
peerAsn Number
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value.
peerIpAddress String
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. Required if ip_address is set.
peerIpv4NexthopAddress String
IPv4 address of the BGP interface outside Google Cloud Platform.
peerIpv6NexthopAddress String
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.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Region where the router and BgpPeer reside. If it is not provided, the provider region is used.
router Changes to this property will trigger replacement. String
The name of the Cloud Router in which this BgpPeer will be configured.


routerApplianceInstance String
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.
zeroAdvertisedRoutePriority Boolean
The user-defined zero-advertised-route-priority for a advertised-route-priority in BGP session. This value has to be set true to force the advertised_route_priority to be 0.
zeroCustomLearnedRoutePriority Boolean
The user-defined zero-custom-learned-route-priority for a custom-learned-route-priority in BGP session. This value has to be set true to force the custom_learned_route_priority to be 0.

Supporting Types

RouterPeerAdvertisedIpRange
, RouterPeerAdvertisedIpRangeArgs

Range This property is required. string
The IP range to advertise. The value must be a CIDR-formatted string.
Description string
User-specified description for the IP range.
Range This property is required. string
The IP range to advertise. The value must be a CIDR-formatted string.
Description string
User-specified description for the IP range.
range This property is required. String
The IP range to advertise. The value must be a CIDR-formatted string.
description String
User-specified description for the IP range.
range This property is required. string
The IP range to advertise. The value must be a CIDR-formatted string.
description string
User-specified description for the IP range.
range This property is required. str
The IP range to advertise. The value must be a CIDR-formatted string.
description str
User-specified description for the IP range.
range This property is required. String
The IP range to advertise. The value must be a CIDR-formatted string.
description String
User-specified description for the IP range.

RouterPeerBfd
, RouterPeerBfdArgs

SessionInitializationMode This property is required. string
The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. Possible values are: ACTIVE, DISABLED, PASSIVE.
MinReceiveInterval int
The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000.
MinTransmitInterval int
The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000.
Multiplier int

The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16.

The md5_authentication_key block supports:

SessionInitializationMode This property is required. string
The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. Possible values are: ACTIVE, DISABLED, PASSIVE.
MinReceiveInterval int
The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000.
MinTransmitInterval int
The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000.
Multiplier int

The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16.

The md5_authentication_key block supports:

sessionInitializationMode This property is required. String
The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. Possible values are: ACTIVE, DISABLED, PASSIVE.
minReceiveInterval Integer
The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000.
minTransmitInterval Integer
The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000.
multiplier Integer

The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16.

The md5_authentication_key block supports:

sessionInitializationMode This property is required. string
The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. Possible values are: ACTIVE, DISABLED, PASSIVE.
minReceiveInterval number
The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000.
minTransmitInterval number
The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000.
multiplier number

The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16.

The md5_authentication_key block supports:

session_initialization_mode This property is required. str
The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. Possible values are: ACTIVE, DISABLED, PASSIVE.
min_receive_interval int
The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000.
min_transmit_interval int
The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000.
multiplier int

The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16.

The md5_authentication_key block supports:

sessionInitializationMode This property is required. String
The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. Possible values are: ACTIVE, DISABLED, PASSIVE.
minReceiveInterval Number
The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000.
minTransmitInterval Number
The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000.
multiplier Number

The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16.

The md5_authentication_key block supports:

RouterPeerCustomLearnedIpRange
, RouterPeerCustomLearnedIpRangeArgs

Range This property is required. string
The IP range to learn. The value must be a CIDR-formatted string.
Range This property is required. string
The IP range to learn. The value must be a CIDR-formatted string.
range This property is required. String
The IP range to learn. The value must be a CIDR-formatted string.
range This property is required. string
The IP range to learn. The value must be a CIDR-formatted string.
range This property is required. str
The IP range to learn. The value must be a CIDR-formatted string.
range This property is required. String
The IP range to learn. The value must be a CIDR-formatted string.

RouterPeerMd5AuthenticationKey
, RouterPeerMd5AuthenticationKeyArgs

Key This property is required. string
Value of the key.
Name This property is required. string
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.
Key This property is required. string
Value of the key.
Name This property is required. string
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.
key This property is required. String
Value of the key.
name This property is required. String
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.
key This property is required. string
Value of the key.
name This property is required. string
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.
key This property is required. str
Value of the key.
name This property is required. str
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.
key This property is required. String
Value of the key.
name This property is required. String
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.

Import

RouterBgpPeer can be imported using any of these accepted formats:

  • projects/{{project}}/regions/{{region}}/routers/{{router}}/{{name}}

  • {{project}}/{{region}}/{{router}}/{{name}}

  • {{region}}/{{router}}/{{name}}

  • {{router}}/{{name}}

When using the pulumi import command, RouterBgpPeer can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/routerPeer:RouterPeer default projects/{{project}}/regions/{{region}}/routers/{{router}}/{{name}}
Copy
$ pulumi import gcp:compute/routerPeer:RouterPeer default {{project}}/{{region}}/{{router}}/{{name}}
Copy
$ pulumi import gcp:compute/routerPeer:RouterPeer default {{region}}/{{router}}/{{name}}
Copy
$ pulumi import gcp:compute/routerPeer:RouterPeer default {{router}}/{{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.