1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. Router
Google Cloud v8.27.1 published on Friday, Apr 25, 2025 by Pulumi

gcp.compute.Router

Explore with Pulumi AI

Represents a Router resource.

To get more information about Router, see:

Example Usage

Router Basic

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

const foobarNetwork = new gcp.compute.Network("foobar", {
    name: "my-network",
    autoCreateSubnetworks: false,
});
const foobar = new gcp.compute.Router("foobar", {
    name: "my-router",
    network: foobarNetwork.name,
    bgp: {
        asn: 64514,
        advertiseMode: "CUSTOM",
        advertisedGroups: ["ALL_SUBNETS"],
        advertisedIpRanges: [
            {
                range: "1.2.3.4",
            },
            {
                range: "6.7.0.0/16",
            },
        ],
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

foobar_network = gcp.compute.Network("foobar",
    name="my-network",
    auto_create_subnetworks=False)
foobar = gcp.compute.Router("foobar",
    name="my-router",
    network=foobar_network.name,
    bgp={
        "asn": 64514,
        "advertise_mode": "CUSTOM",
        "advertised_groups": ["ALL_SUBNETS"],
        "advertised_ip_ranges": [
            {
                "range": "1.2.3.4",
            },
            {
                "range": "6.7.0.0/16",
            },
        ],
    })
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 {
		foobarNetwork, err := compute.NewNetwork(ctx, "foobar", &compute.NetworkArgs{
			Name:                  pulumi.String("my-network"),
			AutoCreateSubnetworks: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewRouter(ctx, "foobar", &compute.RouterArgs{
			Name:    pulumi.String("my-router"),
			Network: foobarNetwork.Name,
			Bgp: &compute.RouterBgpArgs{
				Asn:           pulumi.Int(64514),
				AdvertiseMode: pulumi.String("CUSTOM"),
				AdvertisedGroups: pulumi.StringArray{
					pulumi.String("ALL_SUBNETS"),
				},
				AdvertisedIpRanges: compute.RouterBgpAdvertisedIpRangeArray{
					&compute.RouterBgpAdvertisedIpRangeArgs{
						Range: pulumi.String("1.2.3.4"),
					},
					&compute.RouterBgpAdvertisedIpRangeArgs{
						Range: pulumi.String("6.7.0.0/16"),
					},
				},
			},
		})
		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 foobarNetwork = new Gcp.Compute.Network("foobar", new()
    {
        Name = "my-network",
        AutoCreateSubnetworks = false,
    });

    var foobar = new Gcp.Compute.Router("foobar", new()
    {
        Name = "my-router",
        Network = foobarNetwork.Name,
        Bgp = new Gcp.Compute.Inputs.RouterBgpArgs
        {
            Asn = 64514,
            AdvertiseMode = "CUSTOM",
            AdvertisedGroups = new[]
            {
                "ALL_SUBNETS",
            },
            AdvertisedIpRanges = new[]
            {
                new Gcp.Compute.Inputs.RouterBgpAdvertisedIpRangeArgs
                {
                    Range = "1.2.3.4",
                },
                new Gcp.Compute.Inputs.RouterBgpAdvertisedIpRangeArgs
                {
                    Range = "6.7.0.0/16",
                },
            },
        },
    });

});
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.Router;
import com.pulumi.gcp.compute.RouterArgs;
import com.pulumi.gcp.compute.inputs.RouterBgpArgs;
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 foobarNetwork = new Network("foobarNetwork", NetworkArgs.builder()
            .name("my-network")
            .autoCreateSubnetworks(false)
            .build());

        var foobar = new Router("foobar", RouterArgs.builder()
            .name("my-router")
            .network(foobarNetwork.name())
            .bgp(RouterBgpArgs.builder()
                .asn(64514)
                .advertiseMode("CUSTOM")
                .advertisedGroups("ALL_SUBNETS")
                .advertisedIpRanges(                
                    RouterBgpAdvertisedIpRangeArgs.builder()
                        .range("1.2.3.4")
                        .build(),
                    RouterBgpAdvertisedIpRangeArgs.builder()
                        .range("6.7.0.0/16")
                        .build())
                .build())
            .build());

    }
}
Copy
resources:
  foobar:
    type: gcp:compute:Router
    properties:
      name: my-router
      network: ${foobarNetwork.name}
      bgp:
        asn: 64514
        advertiseMode: CUSTOM
        advertisedGroups:
          - ALL_SUBNETS
        advertisedIpRanges:
          - range: 1.2.3.4
          - range: 6.7.0.0/16
  foobarNetwork:
    type: gcp:compute:Network
    name: foobar
    properties:
      name: my-network
      autoCreateSubnetworks: false
Copy

Compute Router Encrypted Interconnect

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

const network = new gcp.compute.Network("network", {
    name: "test-network",
    autoCreateSubnetworks: false,
});
const encrypted_interconnect_router = new gcp.compute.Router("encrypted-interconnect-router", {
    name: "test-router",
    network: network.name,
    encryptedInterconnectRouter: true,
    bgp: {
        asn: 64514,
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

network = gcp.compute.Network("network",
    name="test-network",
    auto_create_subnetworks=False)
encrypted_interconnect_router = gcp.compute.Router("encrypted-interconnect-router",
    name="test-router",
    network=network.name,
    encrypted_interconnect_router=True,
    bgp={
        "asn": 64514,
    })
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("test-network"),
			AutoCreateSubnetworks: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewRouter(ctx, "encrypted-interconnect-router", &compute.RouterArgs{
			Name:                        pulumi.String("test-router"),
			Network:                     network.Name,
			EncryptedInterconnectRouter: pulumi.Bool(true),
			Bgp: &compute.RouterBgpArgs{
				Asn: pulumi.Int(64514),
			},
		})
		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 = "test-network",
        AutoCreateSubnetworks = false,
    });

    var encrypted_interconnect_router = new Gcp.Compute.Router("encrypted-interconnect-router", new()
    {
        Name = "test-router",
        Network = network.Name,
        EncryptedInterconnectRouter = true,
        Bgp = new Gcp.Compute.Inputs.RouterBgpArgs
        {
            Asn = 64514,
        },
    });

});
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.Router;
import com.pulumi.gcp.compute.RouterArgs;
import com.pulumi.gcp.compute.inputs.RouterBgpArgs;
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("test-network")
            .autoCreateSubnetworks(false)
            .build());

        var encrypted_interconnect_router = new Router("encrypted-interconnect-router", RouterArgs.builder()
            .name("test-router")
            .network(network.name())
            .encryptedInterconnectRouter(true)
            .bgp(RouterBgpArgs.builder()
                .asn(64514)
                .build())
            .build());

    }
}
Copy
resources:
  encrypted-interconnect-router:
    type: gcp:compute:Router
    properties:
      name: test-router
      network: ${network.name}
      encryptedInterconnectRouter: true
      bgp:
        asn: 64514
  network:
    type: gcp:compute:Network
    properties:
      name: test-network
      autoCreateSubnetworks: false
Copy

Create Router Resource

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

Constructor syntax

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

@overload
def Router(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           network: Optional[str] = None,
           bgp: Optional[RouterBgpArgs] = None,
           description: Optional[str] = None,
           encrypted_interconnect_router: Optional[bool] = None,
           md5_authentication_keys: Optional[RouterMd5AuthenticationKeysArgs] = None,
           name: Optional[str] = None,
           project: Optional[str] = None,
           region: Optional[str] = None)
func NewRouter(ctx *Context, name string, args RouterArgs, opts ...ResourceOption) (*Router, error)
public Router(string name, RouterArgs args, CustomResourceOptions? opts = null)
public Router(String name, RouterArgs args)
public Router(String name, RouterArgs args, CustomResourceOptions options)
type: gcp:compute:Router
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. RouterArgs
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. RouterArgs
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. RouterArgs
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. RouterArgs
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. RouterArgs
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 routerResource = new Gcp.Compute.Router("routerResource", new()
{
    Network = "string",
    Bgp = new Gcp.Compute.Inputs.RouterBgpArgs
    {
        Asn = 0,
        AdvertiseMode = "string",
        AdvertisedGroups = new[]
        {
            "string",
        },
        AdvertisedIpRanges = new[]
        {
            new Gcp.Compute.Inputs.RouterBgpAdvertisedIpRangeArgs
            {
                Range = "string",
                Description = "string",
            },
        },
        IdentifierRange = "string",
        KeepaliveInterval = 0,
    },
    Description = "string",
    EncryptedInterconnectRouter = false,
    Md5AuthenticationKeys = new Gcp.Compute.Inputs.RouterMd5AuthenticationKeysArgs
    {
        Key = "string",
        Name = "string",
    },
    Name = "string",
    Project = "string",
    Region = "string",
});
Copy
example, err := compute.NewRouter(ctx, "routerResource", &compute.RouterArgs{
	Network: pulumi.String("string"),
	Bgp: &compute.RouterBgpArgs{
		Asn:           pulumi.Int(0),
		AdvertiseMode: pulumi.String("string"),
		AdvertisedGroups: pulumi.StringArray{
			pulumi.String("string"),
		},
		AdvertisedIpRanges: compute.RouterBgpAdvertisedIpRangeArray{
			&compute.RouterBgpAdvertisedIpRangeArgs{
				Range:       pulumi.String("string"),
				Description: pulumi.String("string"),
			},
		},
		IdentifierRange:   pulumi.String("string"),
		KeepaliveInterval: pulumi.Int(0),
	},
	Description:                 pulumi.String("string"),
	EncryptedInterconnectRouter: pulumi.Bool(false),
	Md5AuthenticationKeys: &compute.RouterMd5AuthenticationKeysArgs{
		Key:  pulumi.String("string"),
		Name: pulumi.String("string"),
	},
	Name:    pulumi.String("string"),
	Project: pulumi.String("string"),
	Region:  pulumi.String("string"),
})
Copy
var routerResource = new Router("routerResource", RouterArgs.builder()
    .network("string")
    .bgp(RouterBgpArgs.builder()
        .asn(0)
        .advertiseMode("string")
        .advertisedGroups("string")
        .advertisedIpRanges(RouterBgpAdvertisedIpRangeArgs.builder()
            .range("string")
            .description("string")
            .build())
        .identifierRange("string")
        .keepaliveInterval(0)
        .build())
    .description("string")
    .encryptedInterconnectRouter(false)
    .md5AuthenticationKeys(RouterMd5AuthenticationKeysArgs.builder()
        .key("string")
        .name("string")
        .build())
    .name("string")
    .project("string")
    .region("string")
    .build());
Copy
router_resource = gcp.compute.Router("routerResource",
    network="string",
    bgp={
        "asn": 0,
        "advertise_mode": "string",
        "advertised_groups": ["string"],
        "advertised_ip_ranges": [{
            "range": "string",
            "description": "string",
        }],
        "identifier_range": "string",
        "keepalive_interval": 0,
    },
    description="string",
    encrypted_interconnect_router=False,
    md5_authentication_keys={
        "key": "string",
        "name": "string",
    },
    name="string",
    project="string",
    region="string")
Copy
const routerResource = new gcp.compute.Router("routerResource", {
    network: "string",
    bgp: {
        asn: 0,
        advertiseMode: "string",
        advertisedGroups: ["string"],
        advertisedIpRanges: [{
            range: "string",
            description: "string",
        }],
        identifierRange: "string",
        keepaliveInterval: 0,
    },
    description: "string",
    encryptedInterconnectRouter: false,
    md5AuthenticationKeys: {
        key: "string",
        name: "string",
    },
    name: "string",
    project: "string",
    region: "string",
});
Copy
type: gcp:compute:Router
properties:
    bgp:
        advertiseMode: string
        advertisedGroups:
            - string
        advertisedIpRanges:
            - description: string
              range: string
        asn: 0
        identifierRange: string
        keepaliveInterval: 0
    description: string
    encryptedInterconnectRouter: false
    md5AuthenticationKeys:
        key: string
        name: string
    name: string
    network: string
    project: string
    region: string
Copy

Router 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 Router resource accepts the following input properties:

Network
This property is required.
Changes to this property will trigger replacement.
string
A reference to the network to which this router belongs.


Bgp RouterBgp
BGP information specific to this router. Structure is documented below.
Description string
An optional description of this resource.
EncryptedInterconnectRouter Changes to this property will trigger replacement. bool
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
Md5AuthenticationKeys RouterMd5AuthenticationKeys
Keys used for MD5 authentication. Structure is documented below.
Name Changes to this property will trigger replacement. string
Name of the resource. 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.
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 resides.
Network
This property is required.
Changes to this property will trigger replacement.
string
A reference to the network to which this router belongs.


Bgp RouterBgpArgs
BGP information specific to this router. Structure is documented below.
Description string
An optional description of this resource.
EncryptedInterconnectRouter Changes to this property will trigger replacement. bool
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
Md5AuthenticationKeys RouterMd5AuthenticationKeysArgs
Keys used for MD5 authentication. Structure is documented below.
Name Changes to this property will trigger replacement. string
Name of the resource. 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.
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 resides.
network
This property is required.
Changes to this property will trigger replacement.
String
A reference to the network to which this router belongs.


bgp RouterBgp
BGP information specific to this router. Structure is documented below.
description String
An optional description of this resource.
encryptedInterconnectRouter Changes to this property will trigger replacement. Boolean
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
md5AuthenticationKeys RouterMd5AuthenticationKeys
Keys used for MD5 authentication. Structure is documented below.
name Changes to this property will trigger replacement. String
Name of the resource. 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.
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 resides.
network
This property is required.
Changes to this property will trigger replacement.
string
A reference to the network to which this router belongs.


bgp RouterBgp
BGP information specific to this router. Structure is documented below.
description string
An optional description of this resource.
encryptedInterconnectRouter Changes to this property will trigger replacement. boolean
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
md5AuthenticationKeys RouterMd5AuthenticationKeys
Keys used for MD5 authentication. Structure is documented below.
name Changes to this property will trigger replacement. string
Name of the resource. 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.
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 resides.
network
This property is required.
Changes to this property will trigger replacement.
str
A reference to the network to which this router belongs.


bgp RouterBgpArgs
BGP information specific to this router. Structure is documented below.
description str
An optional description of this resource.
encrypted_interconnect_router Changes to this property will trigger replacement. bool
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
md5_authentication_keys RouterMd5AuthenticationKeysArgs
Keys used for MD5 authentication. Structure is documented below.
name Changes to this property will trigger replacement. str
Name of the resource. 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.
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 resides.
network
This property is required.
Changes to this property will trigger replacement.
String
A reference to the network to which this router belongs.


bgp Property Map
BGP information specific to this router. Structure is documented below.
description String
An optional description of this resource.
encryptedInterconnectRouter Changes to this property will trigger replacement. Boolean
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
md5AuthenticationKeys Property Map
Keys used for MD5 authentication. Structure is documented below.
name Changes to this property will trigger replacement. String
Name of the resource. 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.
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 resides.

Outputs

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

CreationTimestamp string
Creation timestamp in RFC3339 text format.
Id string
The provider-assigned unique ID for this managed resource.
SelfLink string
The URI of the created resource.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Id string
The provider-assigned unique ID for this managed resource.
SelfLink string
The URI of the created resource.
creationTimestamp String
Creation timestamp in RFC3339 text format.
id String
The provider-assigned unique ID for this managed resource.
selfLink String
The URI of the created resource.
creationTimestamp string
Creation timestamp in RFC3339 text format.
id string
The provider-assigned unique ID for this managed resource.
selfLink string
The URI of the created resource.
creation_timestamp str
Creation timestamp in RFC3339 text format.
id str
The provider-assigned unique ID for this managed resource.
self_link str
The URI of the created resource.
creationTimestamp String
Creation timestamp in RFC3339 text format.
id String
The provider-assigned unique ID for this managed resource.
selfLink String
The URI of the created resource.

Look up Existing Router Resource

Get an existing Router 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?: RouterState, opts?: CustomResourceOptions): Router
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bgp: Optional[RouterBgpArgs] = None,
        creation_timestamp: Optional[str] = None,
        description: Optional[str] = None,
        encrypted_interconnect_router: Optional[bool] = None,
        md5_authentication_keys: Optional[RouterMd5AuthenticationKeysArgs] = None,
        name: Optional[str] = None,
        network: Optional[str] = None,
        project: Optional[str] = None,
        region: Optional[str] = None,
        self_link: Optional[str] = None) -> Router
func GetRouter(ctx *Context, name string, id IDInput, state *RouterState, opts ...ResourceOption) (*Router, error)
public static Router Get(string name, Input<string> id, RouterState? state, CustomResourceOptions? opts = null)
public static Router get(String name, Output<String> id, RouterState state, CustomResourceOptions options)
resources:  _:    type: gcp:compute:Router    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:
Bgp RouterBgp
BGP information specific to this router. Structure is documented below.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Description string
An optional description of this resource.
EncryptedInterconnectRouter Changes to this property will trigger replacement. bool
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
Md5AuthenticationKeys RouterMd5AuthenticationKeys
Keys used for MD5 authentication. Structure is documented below.
Name Changes to this property will trigger replacement. string
Name of the resource. 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.
Network Changes to this property will trigger replacement. string
A reference to the network to which this router belongs.


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 resides.
SelfLink string
The URI of the created resource.
Bgp RouterBgpArgs
BGP information specific to this router. Structure is documented below.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Description string
An optional description of this resource.
EncryptedInterconnectRouter Changes to this property will trigger replacement. bool
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
Md5AuthenticationKeys RouterMd5AuthenticationKeysArgs
Keys used for MD5 authentication. Structure is documented below.
Name Changes to this property will trigger replacement. string
Name of the resource. 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.
Network Changes to this property will trigger replacement. string
A reference to the network to which this router belongs.


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 resides.
SelfLink string
The URI of the created resource.
bgp RouterBgp
BGP information specific to this router. Structure is documented below.
creationTimestamp String
Creation timestamp in RFC3339 text format.
description String
An optional description of this resource.
encryptedInterconnectRouter Changes to this property will trigger replacement. Boolean
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
md5AuthenticationKeys RouterMd5AuthenticationKeys
Keys used for MD5 authentication. Structure is documented below.
name Changes to this property will trigger replacement. String
Name of the resource. 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.
network Changes to this property will trigger replacement. String
A reference to the network to which this router belongs.


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 resides.
selfLink String
The URI of the created resource.
bgp RouterBgp
BGP information specific to this router. Structure is documented below.
creationTimestamp string
Creation timestamp in RFC3339 text format.
description string
An optional description of this resource.
encryptedInterconnectRouter Changes to this property will trigger replacement. boolean
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
md5AuthenticationKeys RouterMd5AuthenticationKeys
Keys used for MD5 authentication. Structure is documented below.
name Changes to this property will trigger replacement. string
Name of the resource. 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.
network Changes to this property will trigger replacement. string
A reference to the network to which this router belongs.


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 resides.
selfLink string
The URI of the created resource.
bgp RouterBgpArgs
BGP information specific to this router. Structure is documented below.
creation_timestamp str
Creation timestamp in RFC3339 text format.
description str
An optional description of this resource.
encrypted_interconnect_router Changes to this property will trigger replacement. bool
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
md5_authentication_keys RouterMd5AuthenticationKeysArgs
Keys used for MD5 authentication. Structure is documented below.
name Changes to this property will trigger replacement. str
Name of the resource. 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.
network Changes to this property will trigger replacement. str
A reference to the network to which this router belongs.


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 resides.
self_link str
The URI of the created resource.
bgp Property Map
BGP information specific to this router. Structure is documented below.
creationTimestamp String
Creation timestamp in RFC3339 text format.
description String
An optional description of this resource.
encryptedInterconnectRouter Changes to this property will trigger replacement. Boolean
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
md5AuthenticationKeys Property Map
Keys used for MD5 authentication. Structure is documented below.
name Changes to this property will trigger replacement. String
Name of the resource. 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.
network Changes to this property will trigger replacement. String
A reference to the network to which this router belongs.


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 resides.
selfLink String
The URI of the created resource.

Supporting Types

RouterBgp
, RouterBgpArgs

Asn This property is required. int
Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
AdvertiseMode string
User-specified flag to indicate which mode to use for advertisement. Default value is DEFAULT. Possible values are: DEFAULT, CUSTOM.
AdvertisedGroups List<string>
User-specified list of prefix groups 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 groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. This enum field has the one valid value: ALL_SUBNETS
AdvertisedIpRanges List<RouterBgpAdvertisedIpRange>
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.
IdentifierRange string
Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
KeepaliveInterval int
The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.
Asn This property is required. int
Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
AdvertiseMode string
User-specified flag to indicate which mode to use for advertisement. Default value is DEFAULT. Possible values are: DEFAULT, CUSTOM.
AdvertisedGroups []string
User-specified list of prefix groups 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 groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. This enum field has the one valid value: ALL_SUBNETS
AdvertisedIpRanges []RouterBgpAdvertisedIpRange
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.
IdentifierRange string
Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
KeepaliveInterval int
The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.
asn This property is required. Integer
Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
advertiseMode String
User-specified flag to indicate which mode to use for advertisement. Default value is DEFAULT. Possible values are: DEFAULT, CUSTOM.
advertisedGroups List<String>
User-specified list of prefix groups 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 groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. This enum field has the one valid value: ALL_SUBNETS
advertisedIpRanges List<RouterBgpAdvertisedIpRange>
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.
identifierRange String
Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
keepaliveInterval Integer
The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.
asn This property is required. number
Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
advertiseMode string
User-specified flag to indicate which mode to use for advertisement. Default value is DEFAULT. Possible values are: DEFAULT, CUSTOM.
advertisedGroups string[]
User-specified list of prefix groups 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 groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. This enum field has the one valid value: ALL_SUBNETS
advertisedIpRanges RouterBgpAdvertisedIpRange[]
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.
identifierRange string
Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
keepaliveInterval number
The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.
asn This property is required. int
Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
str
User-specified flag to indicate which mode to use for advertisement. Default value is DEFAULT. Possible values are: DEFAULT, CUSTOM.
advertised_groups Sequence[str]
User-specified list of prefix groups 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 groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. This enum field has the one valid value: ALL_SUBNETS
advertised_ip_ranges Sequence[RouterBgpAdvertisedIpRange]
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.
identifier_range str
Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
keepalive_interval int
The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.
asn This property is required. Number
Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN.
advertiseMode String
User-specified flag to indicate which mode to use for advertisement. Default value is DEFAULT. Possible values are: DEFAULT, CUSTOM.
advertisedGroups List<String>
User-specified list of prefix groups 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 groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. This enum field has the one valid value: ALL_SUBNETS
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.
identifierRange String
Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this router ID.
keepaliveInterval Number
The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20.

RouterBgpAdvertisedIpRange
, RouterBgpAdvertisedIpRangeArgs

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.

The md5_authentication_keys block supports:

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.

The md5_authentication_keys block supports:

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.

The md5_authentication_keys block supports:

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.

The md5_authentication_keys block supports:

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.

The md5_authentication_keys block supports:

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.

The md5_authentication_keys block supports:

RouterMd5AuthenticationKeys
, RouterMd5AuthenticationKeysArgs

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

Router can be imported using any of these accepted formats:

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

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

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

  • {{name}}

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

$ pulumi import gcp:compute/router:Router default projects/{{project}}/regions/{{region}}/routers/{{name}}
Copy
$ pulumi import gcp:compute/router:Router default {{project}}/{{region}}/{{name}}
Copy
$ pulumi import gcp:compute/router:Router default {{region}}/{{name}}
Copy
$ pulumi import gcp:compute/router:Router default {{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.