1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. Router
Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi

gcp.compute.Router

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi

    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",
                },
            ],
        },
    });
    
    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=gcp.compute.RouterBgpArgs(
            asn=64514,
            advertise_mode="CUSTOM",
            advertised_groups=["ALL_SUBNETS"],
            advertised_ip_ranges=[
                gcp.compute.RouterBgpAdvertisedIpRangeArgs(
                    range="1.2.3.4",
                ),
                gcp.compute.RouterBgpAdvertisedIpRangeArgs(
                    range="6.7.0.0/16",
                ),
            ],
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/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
    	})
    }
    
    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",
                    },
                },
            },
        });
    
    });
    
    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());
    
        }
    }
    
    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
    

    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,
        },
    });
    
    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=gcp.compute.RouterBgpArgs(
            asn=64514,
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/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
    	})
    }
    
    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,
            },
        });
    
    });
    
    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());
    
        }
    }
    
    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
    

    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,
               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 string
    The unique name of the resource.
    args RouterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args RouterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RouterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RouterArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    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,
        Name = "string",
        Project = "string",
        Region = "string",
    });
    
    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),
    	Name:                        pulumi.String("string"),
    	Project:                     pulumi.String("string"),
    	Region:                      pulumi.String("string"),
    })
    
    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)
        .name("string")
        .project("string")
        .region("string")
        .build());
    
    router_resource = gcp.compute.Router("routerResource",
        network="string",
        bgp=gcp.compute.RouterBgpArgs(
            asn=0,
            advertise_mode="string",
            advertised_groups=["string"],
            advertised_ip_ranges=[gcp.compute.RouterBgpAdvertisedIpRangeArgs(
                range="string",
                description="string",
            )],
            identifier_range="string",
            keepalive_interval=0,
        ),
        description="string",
        encrypted_interconnect_router=False,
        name="string",
        project="string",
        region="string")
    
    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,
        name: "string",
        project: "string",
        region: "string",
    });
    
    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
        name: string
        network: string
        project: string
        region: string
    

    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

    The Router resource accepts the following input properties:

    Network 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 bool
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    Name 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 string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    Region where the router resides.
    Network 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 bool
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    Name 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 string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    Region where the router resides.
    network 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 Boolean
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    name 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 String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    Region where the router resides.
    network 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 boolean
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    name 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 string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    Region where the router resides.
    network 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 bool
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    name 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 str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    Region where the router resides.
    network 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 Boolean
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    name 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 String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region 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,
            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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    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 bool
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    Name 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 string
    A reference to the network to which this router belongs.


    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region 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 bool
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    Name 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 string
    A reference to the network to which this router belongs.


    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region 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 Boolean
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    name 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 String
    A reference to the network to which this router belongs.


    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region 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 boolean
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    name 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 string
    A reference to the network to which this router belongs.


    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region 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 bool
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    name 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 str
    A reference to the network to which this router belongs.


    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region 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 Boolean
    Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
    name 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 String
    A reference to the network to which this router belongs.


    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    Region where the router resides.
    selfLink String
    The URI of the created resource.

    Supporting Types

    RouterBgp, RouterBgpArgs

    Asn 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 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 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 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 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 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 string
    The IP range to advertise. The value must be a CIDR-formatted string.
    Description string
    User-specified description for the IP range.
    Range string
    The IP range to advertise. The value must be a CIDR-formatted string.
    Description string
    User-specified description for the IP range.
    range String
    The IP range to advertise. The value must be a CIDR-formatted string.
    description String
    User-specified description for the IP range.
    range string
    The IP range to advertise. The value must be a CIDR-formatted string.
    description string
    User-specified description for the IP range.
    range str
    The IP range to advertise. The value must be a CIDR-formatted string.
    description str
    User-specified description for the IP range.
    range String
    The IP range to advertise. The value must be a CIDR-formatted string.
    description String
    User-specified description for the IP range.

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

    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.
    gcp logo
    Google Cloud Classic v7.27.0 published on Thursday, Jun 13, 2024 by Pulumi