mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-09-08 18:16:44 +00:00
176 lines
5.4 KiB
Markdown
176 lines
5.4 KiB
Markdown
---
|
|
# ----------------------------------------------------------------------------
|
|
#
|
|
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
|
|
#
|
|
# ----------------------------------------------------------------------------
|
|
#
|
|
# This file is automatically generated by Magic Modules and manual
|
|
# changes will be clobbered when the file is regenerated.
|
|
#
|
|
# Please read more about how to change this file in
|
|
# .github/CONTRIBUTING.md.
|
|
#
|
|
# ----------------------------------------------------------------------------
|
|
layout: "google"
|
|
page_title: "Google: google_compute_router"
|
|
sidebar_current: "docs-google-compute-router"
|
|
description: |-
|
|
Represents a Router resource.
|
|
---
|
|
|
|
# google\_compute\_router
|
|
|
|
Represents a Router resource.
|
|
|
|
|
|
To get more information about Router, see:
|
|
|
|
* [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/routers)
|
|
* How-to Guides
|
|
* [Google Cloud Router](https://cloud.google.com/router/docs/)
|
|
|
|
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
|
|
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=router_basic&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
|
|
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
|
|
</a>
|
|
</div>
|
|
## Example Usage - Router Basic
|
|
|
|
|
|
```hcl
|
|
resource "google_compute_router" "foobar" {
|
|
name = "my-router"
|
|
network = "${google_compute_network.foobar.name}"
|
|
bgp {
|
|
asn = 64514
|
|
advertise_mode = "CUSTOM"
|
|
advertised_groups = ["ALL_SUBNETS"]
|
|
advertised_ip_ranges {
|
|
range = "1.2.3.4"
|
|
}
|
|
advertised_ip_ranges {
|
|
range = "6.7.0.0/16"
|
|
}
|
|
}
|
|
}
|
|
|
|
resource "google_compute_network" "foobar" {
|
|
name = "my-network"
|
|
auto_create_subnetworks = false
|
|
}
|
|
```
|
|
|
|
## Argument Reference
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
* `name` -
|
|
(Required)
|
|
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]([-a-z0-9]*[a-z0-9])?`
|
|
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` -
|
|
(Required)
|
|
A reference to the network to which this router belongs.
|
|
|
|
|
|
- - -
|
|
|
|
|
|
* `description` -
|
|
(Optional)
|
|
An optional description of this resource.
|
|
|
|
* `bgp` -
|
|
(Optional)
|
|
BGP information specific to this router. Structure is documented below.
|
|
|
|
* `region` -
|
|
(Optional)
|
|
Region where the router resides.
|
|
* `project` - (Optional) The ID of the project in which the resource belongs.
|
|
If it is not provided, the provider project is used.
|
|
|
|
|
|
The `bgp` block supports:
|
|
|
|
* `asn` -
|
|
(Required)
|
|
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.
|
|
|
|
* `advertise_mode` -
|
|
(Optional)
|
|
User-specified flag to indicate which mode to use for advertisement.
|
|
Valid values of this enum field are: DEFAULT, CUSTOM
|
|
|
|
* `advertised_groups` -
|
|
(Optional)
|
|
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` -
|
|
(Optional)
|
|
User-specified list of individual IP ranges to advertise in
|
|
custom mode. This field can only be populated if advertiseMode
|
|
is CUSTOM and is advertised to all peers of the router. These IP
|
|
ranges will be advertised in addition to any specified groups.
|
|
Leave this field blank to advertise no custom IP ranges. Structure is documented below.
|
|
|
|
|
|
The `advertised_ip_ranges` block supports:
|
|
|
|
* `range` -
|
|
(Optional)
|
|
The IP range to advertise. The value must be a
|
|
CIDR-formatted string.
|
|
|
|
* `description` -
|
|
(Optional)
|
|
User-specified description for the IP range.
|
|
|
|
## Attributes Reference
|
|
|
|
In addition to the arguments listed above, the following computed attributes are exported:
|
|
|
|
|
|
* `creation_timestamp` -
|
|
Creation timestamp in RFC3339 text format.
|
|
* `self_link` - The URI of the created resource.
|
|
|
|
|
|
## Timeouts
|
|
|
|
This resource provides the following
|
|
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
|
|
|
|
- `create` - Default is 4 minutes.
|
|
- `update` - Default is 4 minutes.
|
|
- `delete` - Default is 4 minutes.
|
|
|
|
## Import
|
|
|
|
Router can be imported using any of these accepted formats:
|
|
|
|
```
|
|
$ terraform import google_compute_router.default projects/{{project}}/regions/{{region}}/routers/{{name}}
|
|
$ terraform import google_compute_router.default {{region}}/{{name}}
|
|
$ terraform import google_compute_router.default {{project}}/{{region}}/{{name}}
|
|
$ terraform import google_compute_router.default {{name}}
|
|
```
|
|
|
|
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
|
|
as an argument so that Terraform uses the correct provider to import your resource.
|