google_vpc_access_connector

Serverless VPC Access connector resource.

To get more information about Connector, see:

Open in Cloud Shell

Example Usage - Vpc Access Connector

resource "google_vpc_access_connector" "connector" {
  name          = "vpc-con"
  ip_cidr_range = "10.8.0.0/28"
  network       = "default"
}
Open in Cloud Shell

Example Usage - Vpc Access Connector Shared Vpc

resource "google_vpc_access_connector" "connector" {
  name          = "vpc-con"
  subnet {
    name = google_compute_subnetwork.custom_test.name
  }
  machine_type = "e2-standard-4"
}

resource "google_compute_subnetwork" "custom_test" {
  name          = "vpc-con"
  ip_cidr_range = "10.2.0.0/28"
  region        = "us-central1"
  network       = google_compute_network.custom_test.id
}

resource "google_compute_network" "custom_test" {
  name                    = "vpc-con"
  auto_create_subnetworks = false
}

Argument Reference

The following arguments are supported:


The subnet block supports:

Attributes Reference

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

Timeouts

This resource provides the following Timeouts configuration options:

Import

Connector can be imported using any of these accepted formats:

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

import {
  id = "projects/{{project}}/locations/{{region}}/connectors/{{name}}"
  to = google_vpc_access_connector.default
}

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

$ terraform import google_vpc_access_connector.default projects/{{project}}/locations/{{region}}/connectors/{{name}}
$ terraform import google_vpc_access_connector.default {{project}}/{{region}}/{{name}}
$ terraform import google_vpc_access_connector.default {{region}}/{{name}}
$ terraform import google_vpc_access_connector.default {{name}}

User Project Overrides

This resource supports User Project Overrides.