Google Compute Engine Interconnect Attachment

This page shows how to write Terraform for Compute Engine Interconnect Attachment and write them securely.

google_compute_interconnect_attachment (Terraform)

The Interconnect Attachment in Compute Engine can be configured in Terraform with the resource name google_compute_interconnect_attachment. The following sections describe 2 examples of how to use the resource and its parameters.

Example Usage from GitHub

interconnect.tf#L15
resource "google_compute_interconnect_attachment" "on_prem_1" {
  name                     = "on-prem-attachment"
  edge_availability_domain = "AVAILABILITY_DOMAIN_1"
  type                     = "PARTNER"
  router                   = google_compute_router.foobar.id
}
gcp_compute_interconnects.tf#L1
resource "google_compute_interconnect_attachment" "gcp_compute_interconnects_interconnect" {
  name                     = "on-prem-attachment"
  edge_availability_domain = "AVAILABILITY_DOMAIN_1"
  type                     = "PARTNER"
  router                   = google_compute_router.gcp_compute_interconnects_router.id
  mtu                      = 1500

Parameters

  • admin_enabled optional - bool
    • Whether the VLAN attachment is enabled or disabled. When using PARTNER type this will Pre-Activate the interconnect attachment

  • bandwidth optionalcomputed - string
    • Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, Defaults to BPS_10G Possible values: ["BPS_50M", "BPS_100M", "BPS_200M", "BPS_300M", "BPS_400M", "BPS_500M", "BPS_1G", "BPS_2G", "BPS_5G", "BPS_10G", "BPS_20G", "BPS_50G"]

  • candidate_subnets optional - list / string
    • 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 (169.254.0.0/16) 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.

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

  • creation_timestamp requiredcomputed - string
    • Creation timestamp in RFC3339 text format.

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

  • description optional - string
    • An optional description of this resource.

  • edge_availability_domain optionalcomputed - string
    • 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.

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

  • id optionalcomputed - string
  • interconnect optional - string
    • 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.

  • mtu optionalcomputed - string
    • Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. Currently, only 1440 and 1500 are allowed. If not specified, the value will default to 1440.

  • name required - string
    • 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?' 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.

  • pairing_key requiredcomputed - string
    • [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 requiredcomputed - string
    • [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 requiredcomputed - list / object
    • Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED.

  • project optionalcomputed - string
  • region optionalcomputed - string
    • Region where the regional interconnect attachment resides.

  • router required - string
    • 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.

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

  • type optionalcomputed - string
    • The type of InterconnectAttachment you wish to create. Defaults to DEDICATED. Possible values: ["DEDICATED", "PARTNER", "PARTNER_PROVIDER"]

  • vlan_tag8021q optionalcomputed - number
    • The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. When using PARTNER type this will be managed upstream.

Explanation in Terraform Registry

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

Frequently asked questions

What is Google Compute Engine Interconnect Attachment?

Google Compute Engine Interconnect Attachment is a resource for Compute Engine of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Compute Engine Interconnect Attachment?

For Terraform, the anaik91/tfe and cloudquery/cq-provider-gcp source code examples are useful. See the Terraform Example section for further details.

security-icon

Scan your IaC problem in 3 minutes for free

You can keep your IaC security for free. No credit card required.