Google Serverless VPC Access Connector
This page shows how to write Terraform for Serverless VPC Access Connector and write them securely.
google_vpc_access_connector (Terraform)
The Connector in Serverless VPC Access can be configured in Terraform with the resource name google_vpc_access_connector
. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "google_vpc_access_connector" "svl-vpc-con-10-100-1-32" {
project = var.project_id
name = "svl-vpc-con-10-100-1-32"
ip_cidr_range = "10.100.1.32/28"
network = var.vpc_name
region = var.primary_region
resource "google_vpc_access_connector" "connector" {
name = var.name
ip_cidr_range = var.ip_cidr
network = var.network
}
resource "google_vpc_access_connector" "cloud_run" {
name = "cloud-run-vpc-connector"
ip_cidr_range = "10.8.0.0/28"
network = google_compute_network.private_network.name
resource "google_vpc_access_connector" "serverless-connector" {
name = "redis-serverless-vpc"
ip_cidr_range = "10.8.0.0/28"
region = var.region
network = google_compute_network.redis-network.name
min_throughput = 200
Parameters
-
id
optional computed - string -
ip_cidr_range
optional - string
The range of internal addresses that follows RFC 4632 notation. Example: '10.132.0.0/28'.
-
max_throughput
optional - number
Maximum throughput of the connector in Mbps, must be greater than 'min_throughput'. Default is 1000.
-
min_throughput
optional - number
Minimum throughput of the connector in Mbps. Default and min is 200.
-
name
required - string
The name of the resource (Max 25 characters).
-
network
optional - string
Name of the VPC network. Required if 'ip_cidr_range' is set.
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
-
self_link
optional computed - string
The fully qualified name of this VPC connector
-
state
optional computed - string
State of the VPC access connector.
Explanation in Terraform Registry
Serverless VPC Access connector resource. To get more information about Connector, see:
- API documentation
- How-to Guides
Frequently asked questions
What is Google Serverless VPC Access Connector?
Google Serverless VPC Access Connector is a resource for Serverless VPC Access of Google Cloud Platform. Settings can be wrote in Terraform.
Where can I find the example code for the Google Serverless VPC Access Connector?
For Terraform, the skymars-cloud/terraform-gcp, c2pig/virtual-waiting-room and randrusiak/daftacademy-gcp-terraform source code examples are useful. See the Terraform Example section for further details.