google::router

Creates a router.

Example

google::router router-example
    name: "router-example"
    description: "example description"
    network: $(google::compute-network network-example-subnet)
    region: "us-east1"

    router-bgp
        asn: 64512
        advertise-mode: "CUSTOM"

        advertised-groups: [
            "ALL_SUBNETS"
        ]

        ip-range
            range: "192.168.1.0/24"
            description: "example ip range updated"
        end
    end

    router-bgp-peer
        name: "ex-2"
        interface-name: "if-ex-2"
        peer-ip-address: "169.254.0.2"
        peer-asn: 64513
        advertise-mode: "DEFAULT"
        advertised-route-priority: 1
    end

    router-interface
        name: "if-ex-2"
        ip-range: "169.254.0.1/30"
    end

    router-nat
        icmp-idle-timeout-sec: 35

        log-config
            enable: true
            filter: "ALL"
        end

        min-ports-per-vm: 32
        name: "nats-example"
        ip-allocation-option: "AUTO_ONLY"

        source-subnetwork-ip-ranges-to-nat: [
            "LIST_OF_SUBNETWORKS"
        ]

        subnet
            subnet: $(google::compute-subnet subnet-example)

            source-ip-ranges-to-nat: [
                "ALL_IP_RANGES"
            ]
        end
    end
end

Attributes

Attribute Description
name The name of the router. Must be a string starting with a lowercase letter, followed by hyphens, lowercase letters, or digits, except the last character, which cannot be a hyphen. (Required)
description The description of the router.
region The region where the router resides. (Required)
network The network to which this router belongs. (Required)
router-bgp The Border Gateway Protocol (BGP) information specific to the router.
router-nat list subresource

The list of Network Address Translation (NAT) gateway configuration to be created in this router.

asn
Local BGP Autonomous System Number (ASN). Valid values belong in between 64512 to 65534 for a 16-bit ASN or between 4200000000 to 4294967294 for a 32-bit ASN. (Required)
advertise-mode
The mode to use for advertisement. Valid values are DEFAULT or CUSTOM.
advertised-groups list
The list of prefix groups when advertise-mode is set to CUSTOM. Valid values are ALL_SUBNETS, ALL_VPC_SUBNETS or ALL_PEER_VPC_SUBNETS.
ip-range list subresource

The list of individual IP ranges when advertise-mode is set to CUSTOM.

range
The IP range to advertise. (Required)
description
The description for the IP range.
router-interface list subresource

The list of router interfaces.

name
The name of the router interface. Must be a string starting with a lowercase letter, followed by hyphens, lowercase letters, or digits, except the last character, which cannot be a hyphen. (Required)
linked-vpn-tunnel
The Url of the linked VPN tunnel.
linked-interconnect-attachment
The Url of the linked Interconnect attachment.
ip-range
The IP address and range of the interface.
router-bgp-peer list subresource

The BGP information that must be configured to establish BGP peering.

name
The name of the BGP peer. Must be a string starting with a lowercase letter, followed by hyphens, lowercase letters, or digits, except the last character, which cannot be a hyphen. (Required)
interface-name
The name of the interface the BGP peer is associated with.
ip-address
The IP address of the interface.
peer-ip-address
The IP address of the peer BGP interface.
peer-asn
Peer BGP Autonomous System Number (ASN). Valid values belong in between 64512 to 65534 for a 16-bit ASN or between 4200000000 to 4294967294 for a 32-bit ASN. (Required)
advertised-route-priority
The priority of routes advertised to this BGP peer.
advertise-mode
The mode to use for advertisement. Valid values are DEFAULT or CUSTOM.
advertised-groups list
The list of prefix groups when advertise-mode is set to CUSTOM. Valid values are ALL_SUBNETS, ALL_VPC_SUBNETS or ALL_PEER_VPC_SUBNETS.
ip-range list subresource

The list of individual IP ranges when advertise-mode is set to CUSTOM.

range
The IP range to advertise. (Required)
description
The description for the IP range.

Outputs

Attribute Description
self-link The URL of the router.