1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. vpcaccess
  5. getConnector
Google Cloud v8.35.0 published on Wednesday, Jun 18, 2025 by Pulumi

gcp.vpcaccess.getConnector

Explore with Pulumi AI

Google Cloud v8.35.0 published on Wednesday, Jun 18, 2025 by Pulumi

Get a Serverless VPC Access connector.

To get more information about Connector, see:

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const sample = gcp.vpcaccess.getConnector({
    name: "vpc-con",
});
const connector = new gcp.vpcaccess.Connector("connector", {
    name: "vpc-con",
    ipCidrRange: "10.8.0.0/28",
    network: "default",
    region: "us-central1",
    minInstances: 2,
    maxInstances: 3,
});
Copy
import pulumi
import pulumi_gcp as gcp

sample = gcp.vpcaccess.get_connector(name="vpc-con")
connector = gcp.vpcaccess.Connector("connector",
    name="vpc-con",
    ip_cidr_range="10.8.0.0/28",
    network="default",
    region="us-central1",
    min_instances=2,
    max_instances=3)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/vpcaccess"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vpcaccess.LookupConnector(ctx, &vpcaccess.LookupConnectorArgs{
			Name: "vpc-con",
		}, nil)
		if err != nil {
			return err
		}
		_, err = vpcaccess.NewConnector(ctx, "connector", &vpcaccess.ConnectorArgs{
			Name:         pulumi.String("vpc-con"),
			IpCidrRange:  pulumi.String("10.8.0.0/28"),
			Network:      pulumi.String("default"),
			Region:       pulumi.String("us-central1"),
			MinInstances: pulumi.Int(2),
			MaxInstances: pulumi.Int(3),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var sample = Gcp.VpcAccess.GetConnector.Invoke(new()
    {
        Name = "vpc-con",
    });

    var connector = new Gcp.VpcAccess.Connector("connector", new()
    {
        Name = "vpc-con",
        IpCidrRange = "10.8.0.0/28",
        Network = "default",
        Region = "us-central1",
        MinInstances = 2,
        MaxInstances = 3,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.vpcaccess.VpcaccessFunctions;
import com.pulumi.gcp.vpcaccess.inputs.GetConnectorArgs;
import com.pulumi.gcp.vpcaccess.Connector;
import com.pulumi.gcp.vpcaccess.ConnectorArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var sample = VpcaccessFunctions.getConnector(GetConnectorArgs.builder()
            .name("vpc-con")
            .build());

        var connector = new Connector("connector", ConnectorArgs.builder()
            .name("vpc-con")
            .ipCidrRange("10.8.0.0/28")
            .network("default")
            .region("us-central1")
            .minInstances(2)
            .maxInstances(3)
            .build());

    }
}
Copy
resources:
  connector:
    type: gcp:vpcaccess:Connector
    properties:
      name: vpc-con
      ipCidrRange: 10.8.0.0/28
      network: default
      region: us-central1
      minInstances: 2
      maxInstances: 3
variables:
  sample:
    fn::invoke:
      function: gcp:vpcaccess:getConnector
      arguments:
        name: vpc-con
Copy

Using getConnector

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getConnector(args: GetConnectorArgs, opts?: InvokeOptions): Promise<GetConnectorResult>
function getConnectorOutput(args: GetConnectorOutputArgs, opts?: InvokeOptions): Output<GetConnectorResult>
Copy
def get_connector(name: Optional[str] = None,
                  project: Optional[str] = None,
                  region: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetConnectorResult
def get_connector_output(name: Optional[pulumi.Input[str]] = None,
                  project: Optional[pulumi.Input[str]] = None,
                  region: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetConnectorResult]
Copy
func LookupConnector(ctx *Context, args *LookupConnectorArgs, opts ...InvokeOption) (*LookupConnectorResult, error)
func LookupConnectorOutput(ctx *Context, args *LookupConnectorOutputArgs, opts ...InvokeOption) LookupConnectorResultOutput
Copy

> Note: This function is named LookupConnector in the Go SDK.

public static class GetConnector 
{
    public static Task<GetConnectorResult> InvokeAsync(GetConnectorArgs args, InvokeOptions? opts = null)
    public static Output<GetConnectorResult> Invoke(GetConnectorInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetConnectorResult> getConnector(GetConnectorArgs args, InvokeOptions options)
public static Output<GetConnectorResult> getConnector(GetConnectorArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:vpcaccess/getConnector:getConnector
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Name of the resource.


Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region string
The region in which the resource belongs. If it is not provided, the provider region is used.
Name This property is required. string
Name of the resource.


Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region string
The region in which the resource belongs. If it is not provided, the provider region is used.
name This property is required. String
Name of the resource.


project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region String
The region in which the resource belongs. If it is not provided, the provider region is used.
name This property is required. string
Name of the resource.


project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region string
The region in which the resource belongs. If it is not provided, the provider region is used.
name This property is required. str
Name of the resource.


project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region str
The region in which the resource belongs. If it is not provided, the provider region is used.
name This property is required. String
Name of the resource.


project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region String
The region in which the resource belongs. If it is not provided, the provider region is used.

getConnector Result

The following output properties are available:

ConnectedProjects List<string>
Id string
The provider-assigned unique ID for this managed resource.
IpCidrRange string
MachineType string
MaxInstances int
MaxThroughput int
MinInstances int
MinThroughput int
Name string
Network string
SelfLink string
State string
Subnets List<GetConnectorSubnet>
Project string
Region string
ConnectedProjects []string
Id string
The provider-assigned unique ID for this managed resource.
IpCidrRange string
MachineType string
MaxInstances int
MaxThroughput int
MinInstances int
MinThroughput int
Name string
Network string
SelfLink string
State string
Subnets []GetConnectorSubnet
Project string
Region string
connectedProjects List<String>
id String
The provider-assigned unique ID for this managed resource.
ipCidrRange String
machineType String
maxInstances Integer
maxThroughput Integer
minInstances Integer
minThroughput Integer
name String
network String
selfLink String
state String
subnets List<GetConnectorSubnet>
project String
region String
connectedProjects string[]
id string
The provider-assigned unique ID for this managed resource.
ipCidrRange string
machineType string
maxInstances number
maxThroughput number
minInstances number
minThroughput number
name string
network string
selfLink string
state string
subnets GetConnectorSubnet[]
project string
region string
connected_projects Sequence[str]
id str
The provider-assigned unique ID for this managed resource.
ip_cidr_range str
machine_type str
max_instances int
max_throughput int
min_instances int
min_throughput int
name str
network str
self_link str
state str
subnets Sequence[GetConnectorSubnet]
project str
region str
connectedProjects List<String>
id String
The provider-assigned unique ID for this managed resource.
ipCidrRange String
machineType String
maxInstances Number
maxThroughput Number
minInstances Number
minThroughput Number
name String
network String
selfLink String
state String
subnets List<Property Map>
project String
region String

Supporting Types

GetConnectorSubnet

Name This property is required. string
Name of the resource.


ProjectId This property is required. string
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.
Name This property is required. string
Name of the resource.


ProjectId This property is required. string
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.
name This property is required. String
Name of the resource.


projectId This property is required. String
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.
name This property is required. string
Name of the resource.


projectId This property is required. string
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.
name This property is required. str
Name of the resource.


project_id This property is required. str
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.
name This property is required. String
Name of the resource.


projectId This property is required. String
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.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.
Google Cloud v8.35.0 published on Wednesday, Jun 18, 2025 by Pulumi