google_compute_router_interface

Manages a Cloud Router interface. For more information see the official documentation and API.

Example Usage

resource "google_compute_router_interface" "foobar" {
  name       = "interface-1"
  router     = "router-1"
  region     = "us-central1"
  ip_range   = "169.254.1.1/30"
  vpn_tunnel = "tunnel-1"
}

Argument Reference

The following arguments are supported:

In addition to the above required fields, a router interface must have specified either ip_range or exactly one of vpn_tunnel, interconnect_attachment or subnetwork, or both.


Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options: configuration options:

Import

Router interfaces can be imported using the project (optional), region, router, and name, e.g.

In Terraform v1.5.0 and later, use an import block to import router interfaces using one of the formats above. For example:

import {
  id = "{{project_id}}/{{region}}/{{router}}/{{name}}"
  to = google_compute_router_interface.default
}

When using the terraform import command, router interfaces can be imported using one of the formats above. For example:

$ terraform import google_compute_router_interface.default {{project_id}}/{{region}}/{{router}}/{{name}}
$ terraform import google_compute_router_interface.default {{region}}/{{router}}/{{name}}