Connector class

Serverless VPC Access connector resource.

To get more information about Connector, see:

Example Usage

Vpc Access Connector

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

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

connector = gcp.vpcaccess.Connector("connector",
    name="vpc-con",
    ip_cidr_range="10.8.0.0/28",
    network="default",
    min_instances=2,
    max_instances=3)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var connector = new Gcp.VpcAccess.Connector("connector", new()
    {
        Name = "vpc-con",
        IpCidrRange = "10.8.0.0/28",
        Network = "default",
        MinInstances = 2,
        MaxInstances = 3,
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vpcaccess.NewConnector(ctx, "connector", &vpcaccess.ConnectorArgs{
			Name:         pulumi.String("vpc-con"),
			IpCidrRange:  pulumi.String("10.8.0.0/28"),
			Network:      pulumi.String("default"),
			MinInstances: pulumi.Int(2),
			MaxInstances: pulumi.Int(3),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_vpcaccess_connector" "connector" {
  name          = "vpc-con"
  ip_cidr_range = "10.8.0.0/28"
  network       = "default"
  min_instances = 2
  max_instances = 3
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.vpcaccess.Connector;
import com.pulumi.gcp.vpcaccess.ConnectorArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var connector = new Connector("connector", ConnectorArgs.builder()
            .name("vpc-con")
            .ipCidrRange("10.8.0.0/28")
            .network("default")
            .minInstances(2)
            .maxInstances(3)
            .build());

    }
}
resources:
  connector:
    type: gcp:vpcaccess:Connector
    properties:
      name: vpc-con
      ipCidrRange: 10.8.0.0/28
      network: default
      minInstances: 2
      maxInstances: 3

Vpc Access Connector Shared Vpc

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

const customTest = new gcp.compute.Subnetwork("custom_test", {
    name: "vpc-con",
    ipCidrRange: "10.2.0.0/28",
    region: "us-central1",
    network: "default",
});
const connector = new gcp.vpcaccess.Connector("connector", {
    name: "vpc-con",
    subnet: {
        name: customTest.name,
    },
    machineType: "e2-standard-4",
    minInstances: 2,
    maxInstances: 3,
});
import pulumi
import pulumi_gcp as gcp

custom_test = gcp.compute.Subnetwork("custom_test",
    name="vpc-con",
    ip_cidr_range="10.2.0.0/28",
    region="us-central1",
    network="default")
connector = gcp.vpcaccess.Connector("connector",
    name="vpc-con",
    subnet={
        "name": custom_test.name,
    },
    machine_type="e2-standard-4",
    min_instances=2,
    max_instances=3)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var customTest = new Gcp.Compute.Subnetwork("custom_test", new()
    {
        Name = "vpc-con",
        IpCidrRange = "10.2.0.0/28",
        Region = "us-central1",
        Network = "default",
    });

    var connector = new Gcp.VpcAccess.Connector("connector", new()
    {
        Name = "vpc-con",
        Subnet = new Gcp.VpcAccess.Inputs.ConnectorSubnetArgs
        {
            Name = customTest.Name,
        },
        MachineType = "e2-standard-4",
        MinInstances = 2,
        MaxInstances = 3,
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		customTest, err := compute.NewSubnetwork(ctx, "custom_test", &compute.SubnetworkArgs{
			Name:        pulumi.String("vpc-con"),
			IpCidrRange: pulumi.String("10.2.0.0/28"),
			Region:      pulumi.String("us-central1"),
			Network:     pulumi.String("default"),
		})
		if err != nil {
			return err
		}
		_, err = vpcaccess.NewConnector(ctx, "connector", &vpcaccess.ConnectorArgs{
			Name: pulumi.String("vpc-con"),
			Subnet: &vpcaccess.ConnectorSubnetArgs{
				Name: customTest.Name,
			},
			MachineType:  pulumi.String("e2-standard-4"),
			MinInstances: pulumi.Int(2),
			MaxInstances: pulumi.Int(3),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_vpcaccess_connector" "connector" {
  name = "vpc-con"
  subnet = {
    name = gcp_compute_subnetwork.custom_test.name
  }
  machine_type  = "e2-standard-4"
  min_instances = 2
  max_instances = 3
}
resource "gcp_compute_subnetwork" "custom_test" {
  name          = "vpc-con"
  ip_cidr_range = "10.2.0.0/28"
  region        = "us-central1"
  network       = "default"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.vpcaccess.Connector;
import com.pulumi.gcp.vpcaccess.ConnectorArgs;
import com.pulumi.gcp.vpcaccess.inputs.ConnectorSubnetArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        var customTest = new Subnetwork("customTest", SubnetworkArgs.builder()
            .name("vpc-con")
            .ipCidrRange("10.2.0.0/28")
            .region("us-central1")
            .network("default")
            .build());

        var connector = new Connector("connector", ConnectorArgs.builder()
            .name("vpc-con")
            .subnet(ConnectorSubnetArgs.builder()
                .name(customTest.name())
                .build())
            .machineType("e2-standard-4")
            .minInstances(2)
            .maxInstances(3)
            .build());

    }
}
resources:
  connector:
    type: gcp:vpcaccess:Connector
    properties:
      name: vpc-con
      subnet:
        name: ${customTest.name}
      machineType: e2-standard-4
      minInstances: 2
      maxInstances: 3
  customTest:
    type: gcp:compute:Subnetwork
    name: custom_test
    properties:
      name: vpc-con
      ipCidrRange: 10.2.0.0/28
      region: us-central1
      network: default

Import

Connector can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{region}}/connectors/{{name}}
  • {{project}}/{{region}}/{{name}}
  • {{region}}/{{name}}
  • {{name}}

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

$ pulumi import gcp:vpcaccess/connector:Connector default projects/{{project}}/locations/{{region}}/connectors/{{name}}
$ pulumi import gcp:vpcaccess/connector:Connector default {{project}}/{{region}}/{{name}}
$ pulumi import gcp:vpcaccess/connector:Connector default {{region}}/{{name}}
$ pulumi import gcp:vpcaccess/connector:Connector default {{name}}

Constructors

Connector(String name, {ConnectorArgs? args, CustomResourceOptions? options})
Creates a new Connector. name The Pulumi resource name. args Arguments used to configure this Connector. The set of arguments for Connector. options Resource options controlling this resource's behavior.
Connector.reference(String urn)
Creates a typed reference to an existing Connector resource.

Properties

childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
connectedProjects ↔ Output<List<String>>
List of projects using the connector.
latefinal
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
ipCidrRange ↔ Output<String?>
The range of internal addresses that follows RFC 4632 notation. Example: 10.132.0.0/28.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
machineType ↔ Output<String?>
Machine type of VM Instance underlying connector. Default is e2-micro
latefinal
maxInstances ↔ Output<int>
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. Required alongside minInstances if not using minThroughput/maxThroughput.
latefinal
maxThroughput ↔ Output<int>
Maximum throughput of the connector in Mbps, must be greater than minThroughput. 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. Only one of maxThroughput and maxInstances can be specified. The use of maxThroughput is discouraged in favor of max_instances.
latefinal
minInstances ↔ Output<int>
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. Required alongside maxInstances if not using minThroughput/maxThroughput.
latefinal
minThroughput ↔ Output<int>
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. Only one of minThroughput and minInstances can be specified. The use of minThroughput is discouraged in favor of min_instances.
latefinal
name ↔ Output<String>
The name of the resource (Max 25 characters).
latefinal
network ↔ Output<String>
Name or selfLink of the VPC network. Required if ipCidrRange is set.
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
region ↔ Output<String>
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
The fully qualified name of this VPC connector
latefinal
state ↔ Output<String>
State of the VPC access connector.
latefinal
subnet ↔ Output<ConnectorSubnet?>
The subnet in which to house the connector Structure is documented below.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ConnectorState? state, CustomResourceOptions? options}) → Connector
Gets an existing Connector resource's state with the given name and id.