» google_compute_interconnect_attachment

Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments.

» Example Usage - Interconnect Attachment Basic

resource "google_compute_interconnect_attachment" "on_prem" {
  name         = "on-prem-attachment"
  interconnect = "my-interconnect-id"
  router       = "${google_compute_router.foobar.self_link}"

resource "google_compute_router" "foobar" {
  name    = "router"
  network = "${google_compute_network.foobar.name}"

» Argument Reference

The following arguments are supported:

  • router - (Required) URL of the cloud router to be used for dynamic routing. This router must be in the same region as this InterconnectAttachment. The InterconnectAttachment will automatically connect the Interconnect to the network & region within which the Cloud Router is configured.

  • name - (Required) Name of the resource. Provided by the client when the resource is created. 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.

  • interconnect - (Optional) URL of the underlying Interconnect object that this attachment's traffic will traverse through. Required if type is DEDICATED, must not be set if type is PARTNER.

  • description - (Optional) An optional description of this resource.

  • edge_availability_domain - (Optional) Desired availability domain for the attachment. Only available for type PARTNER, at creation time. For improved reliability, customers should configure a pair of attachments with one per availability domain. The selected availability domain will be provided to the Partner via the pairing key so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.

  • type - (Optional) The type of InterconnectAttachment you wish to create. Defaults to DEDICATED.

  • candidate_subnets - (Optional) Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space ( and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google's edge. If not supplied, Google will randomly select an unused /29 from all of link-local space.

  • vlan_tag8021q - (Optional) The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094.

  • region - (Optional) Region where the regional interconnect attachment resides.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

» Attributes Reference

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

  • cloud_router_ip_address - IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment.

  • customer_router_ip_address - IPv4 address + prefix length to be configured on the customer router subinterface for this interconnect attachment.

  • pairing_key - [Output only for type PARTNER. Not present for DEDICATED]. The opaque identifier of an PARTNER attachment used to initiate provisioning with a selected partner. Of the form "XXXXX/region/domain"

  • partner_asn - [Output only for type PARTNER. Not present for DEDICATED]. Optional BGP ASN for the router that should be supplied by a layer 3 Partner if they configured BGP on behalf of the customer.

  • private_interconnect_info - Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED. Structure is documented below.

  • state - [Output Only] The current state of this attachment's functionality.

  • google_reference_id - Google reference ID, to be used when raising support tickets with Google or otherwise to debug backend connectivity issues.

  • creation_timestamp - Creation timestamp in RFC3339 text format.

  • self_link - The URI of the created resource.

The private_interconnect_info block contains:

  • tag8021q - 802.1q encapsulation tag to be used for traffic between Google and the customer, going to and from this network and region.

» Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 4 minutes.
  • delete - Default is 4 minutes.

» Import

InterconnectAttachment can be imported using any of these accepted formats:

$ terraform import google_compute_interconnect_attachment.default projects/{{project}}/regions/{{region}}/interconnectAttachments/{{name}}
$ terraform import google_compute_interconnect_attachment.default {{project}}/{{region}}/{{name}}
$ terraform import google_compute_interconnect_attachment.default {{name}}