Serverless VPC Access connector resource.
To get more information about Connector, see:
resource "google_vpc_access_connector" "connector" {
name = "vpc-con"
ip_cidr_range = "10.8.0.0/28"
network = "default"
}
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
}
The following arguments are supported:
name
-
(Required)
The name of the resource (Max 25 characters).network
-
(Optional)
Name or self_link of the VPC network. Required if ip_cidr_range
is set.
ip_cidr_range
-
(Optional)
The range of internal addresses that follows RFC 4632 notation. Example: 10.132.0.0/28
.
machine_type
-
(Optional)
Machine type of VM Instance underlying connector. Default is e2-micro
min_throughput
-
(Optional)
Minimum throughput of the connector in Mbps. Default and min is 200. Refers to the expected throughput when using an e2-micro machine type.
Value must be a multiple of 100 from 200 through 900. Must be lower than the value specified by max_throughput. If both min_throughput and
min_instances are provided, min_instances takes precedence over min_throughput. The use of min_throughput is discouraged in favor of min_instances.
min_instances
-
(Optional)
Minimum value of instances in autoscaling group underlying the connector. Value must be between 2 and 9, inclusive. Must be
lower than the value specified by max_instances.
max_instances
-
(Optional)
Maximum value of instances in autoscaling group underlying the connector. Value must be between 3 and 10, inclusive. Must be
higher than the value specified by min_instances.
max_throughput
-
(Optional)
Maximum throughput of the connector in Mbps, must be greater than min_throughput
. Default is 300. Refers to the expected throughput
when using an e2-micro machine type. Value must be a multiple of 100 from 300 through 1000. Must be higher than the value specified by
min_throughput. If both max_throughput and max_instances are provided, max_instances takes precedence over max_throughput. The use of
max_throughput is discouraged in favor of max_instances.
subnet
-
(Optional)
The subnet in which to house the connector
Structure is documented below.
region
-
(Optional)
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
name
-
(Optional)
Subnet name (relative, not fully qualified). E.g. if the full subnet selfLink is
https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetName} the correct input for this field would be {subnetName}"
project_id
-
(Optional)
Project in which the subnet exists. If not set, this project is assumed to be the project for which the connector create request was issued.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/locations/{{region}}/connectors/{{name}}
state
-
State of the VPC access connector.
self_link
-
The fully qualified name of this VPC connector
connected_projects
-
List of projects using the connector.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.delete
- Default is 20 minutes.Connector can be imported using any of these accepted formats:
projects/{{project}}/locations/{{region}}/connectors/{{name}}
{{project}}/{{region}}/{{name}}
{{region}}/{{name}}
{{name}}
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}}
This resource supports User Project Overrides.