Google Cloud (GCP) Classic
Connector
Serverless VPC Access connector resource.
To get more information about Connector, see:
- API documentation
- How-to Guides
Example Usage
VPC Access Connector
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var connector = new Gcp.VpcAccess.Connector("connector", new Gcp.VpcAccess.ConnectorArgs
{
IpCidrRange = "10.8.0.0/28",
Network = "default",
});
}
}
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/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{
IpCidrRange: pulumi.String("10.8.0.0/28"),
Network: pulumi.String("default"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
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()
.ipCidrRange("10.8.0.0/28")
.network("default")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
connector = gcp.vpcaccess.Connector("connector",
ip_cidr_range="10.8.0.0/28",
network="default")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const connector = new gcp.vpcaccess.Connector("connector", {
ipCidrRange: "10.8.0.0/28",
network: "default",
});
resources:
connector:
type: gcp:vpcaccess:Connector
properties:
ipCidrRange: 10.8.0.0/28
network: default
VPC Access Connector Shared VPC
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var customTestNetwork = new Gcp.Compute.Network("customTestNetwork", new Gcp.Compute.NetworkArgs
{
AutoCreateSubnetworks = false,
}, new CustomResourceOptions
{
Provider = google_beta,
});
var customTestSubnetwork = new Gcp.Compute.Subnetwork("customTestSubnetwork", new Gcp.Compute.SubnetworkArgs
{
IpCidrRange = "10.2.0.0/28",
Region = "us-central1",
Network = customTestNetwork.Id,
}, new CustomResourceOptions
{
Provider = google_beta,
});
var connector = new Gcp.VpcAccess.Connector("connector", new Gcp.VpcAccess.ConnectorArgs
{
Subnet = new Gcp.VpcAccess.Inputs.ConnectorSubnetArgs
{
Name = customTestSubnetwork.Name,
},
MachineType = "e2-standard-4",
}, new CustomResourceOptions
{
Provider = google_beta,
});
}
}
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/vpcaccess"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
customTestNetwork, err := compute.NewNetwork(ctx, "customTestNetwork", &compute.NetworkArgs{
AutoCreateSubnetworks: pulumi.Bool(false),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
customTestSubnetwork, err := compute.NewSubnetwork(ctx, "customTestSubnetwork", &compute.SubnetworkArgs{
IpCidrRange: pulumi.String("10.2.0.0/28"),
Region: pulumi.String("us-central1"),
Network: customTestNetwork.ID(),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
_, err = vpcaccess.NewConnector(ctx, "connector", &vpcaccess.ConnectorArgs{
Subnet: &vpcaccess.ConnectorSubnetArgs{
Name: customTestSubnetwork.Name,
},
MachineType: pulumi.String("e2-standard-4"),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
import com.pulumi.resources.CustomResourceOptions;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var customTestNetwork = new Network("customTestNetwork", NetworkArgs.builder()
.autoCreateSubnetworks(false)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var customTestSubnetwork = new Subnetwork("customTestSubnetwork", SubnetworkArgs.builder()
.ipCidrRange("10.2.0.0/28")
.region("us-central1")
.network(customTestNetwork.id())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var connector = new Connector("connector", ConnectorArgs.builder()
.subnet(ConnectorSubnetArgs.builder()
.name(customTestSubnetwork.name())
.build())
.machineType("e2-standard-4")
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
}
}
import pulumi
import pulumi_gcp as gcp
custom_test_network = gcp.compute.Network("customTestNetwork", auto_create_subnetworks=False,
opts=pulumi.ResourceOptions(provider=google_beta))
custom_test_subnetwork = gcp.compute.Subnetwork("customTestSubnetwork",
ip_cidr_range="10.2.0.0/28",
region="us-central1",
network=custom_test_network.id,
opts=pulumi.ResourceOptions(provider=google_beta))
connector = gcp.vpcaccess.Connector("connector",
subnet=gcp.vpcaccess.ConnectorSubnetArgs(
name=custom_test_subnetwork.name,
),
machine_type="e2-standard-4",
opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const customTestNetwork = new gcp.compute.Network("customTestNetwork", {autoCreateSubnetworks: false}, {
provider: google_beta,
});
const customTestSubnetwork = new gcp.compute.Subnetwork("customTestSubnetwork", {
ipCidrRange: "10.2.0.0/28",
region: "us-central1",
network: customTestNetwork.id,
}, {
provider: google_beta,
});
const connector = new gcp.vpcaccess.Connector("connector", {
subnet: {
name: customTestSubnetwork.name,
},
machineType: "e2-standard-4",
}, {
provider: google_beta,
});
resources:
connector:
type: gcp:vpcaccess:Connector
properties:
subnet:
name: ${customTestSubnetwork.name}
machineType: e2-standard-4
options:
provider: ${["google-beta"]}
customTestSubnetwork:
type: gcp:compute:Subnetwork
properties:
ipCidrRange: 10.2.0.0/28
region: us-central1
network: ${customTestNetwork.id}
options:
provider: ${["google-beta"]}
customTestNetwork:
type: gcp:compute:Network
properties:
autoCreateSubnetworks: false
options:
provider: ${["google-beta"]}
Cloudrun VPC Access Connector
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var vpcaccessApi = new Gcp.Projects.Service("vpcaccessApi", new Gcp.Projects.ServiceArgs
{
Service = "vpcaccess.googleapis.com",
DisableOnDestroy = false,
}, new CustomResourceOptions
{
Provider = google_beta,
});
// VPC
var @default = new Gcp.Compute.Network("default", new Gcp.Compute.NetworkArgs
{
AutoCreateSubnetworks = false,
}, new CustomResourceOptions
{
Provider = google_beta,
});
// VPC access connector
var connector = new Gcp.VpcAccess.Connector("connector", new Gcp.VpcAccess.ConnectorArgs
{
Region = "us-west1",
IpCidrRange = "10.8.0.0/28",
MaxThroughput = 300,
Network = @default.Name,
}, new CustomResourceOptions
{
Provider = google_beta,
DependsOn =
{
vpcaccessApi,
},
});
// Cloud Router
var router = new Gcp.Compute.Router("router", new Gcp.Compute.RouterArgs
{
Region = "us-west1",
Network = @default.Id,
}, new CustomResourceOptions
{
Provider = google_beta,
});
// NAT configuration
var routerNat = new Gcp.Compute.RouterNat("routerNat", new Gcp.Compute.RouterNatArgs
{
Region = "us-west1",
Router = router.Name,
SourceSubnetworkIpRangesToNat = "ALL_SUBNETWORKS_ALL_IP_RANGES",
NatIpAllocateOption = "AUTO_ONLY",
}, new CustomResourceOptions
{
Provider = google_beta,
});
// Cloud Run service
var gcrService = new Gcp.CloudRun.Service("gcrService", new Gcp.CloudRun.ServiceArgs
{
Location = "us-west1",
Template = new Gcp.CloudRun.Inputs.ServiceTemplateArgs
{
Spec = new Gcp.CloudRun.Inputs.ServiceTemplateSpecArgs
{
Containers =
{
new Gcp.CloudRun.Inputs.ServiceTemplateSpecContainerArgs
{
Image = "us-docker.pkg.dev/cloudrun/container/hello",
Resources = new Gcp.CloudRun.Inputs.ServiceTemplateSpecContainerResourcesArgs
{
Limits =
{
{ "cpu", "1000m" },
{ "memory", "512M" },
},
},
},
},
},
Metadata = new Gcp.CloudRun.Inputs.ServiceTemplateMetadataArgs
{
Annotations =
{
{ "autoscaling.knative.dev/maxScale", "5" },
{ "run.googleapis.com/vpc-access-connector", connector.Name },
{ "run.googleapis.com/vpc-access-egress", "all-traffic" },
},
},
},
AutogenerateRevisionName = true,
}, new CustomResourceOptions
{
Provider = google_beta,
});
}
}
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/cloudrun"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/projects"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/vpcaccess"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
vpcaccessApi, err := projects.NewService(ctx, "vpcaccessApi", &projects.ServiceArgs{
Service: pulumi.String("vpcaccess.googleapis.com"),
DisableOnDestroy: pulumi.Bool(false),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
_, err = compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
AutoCreateSubnetworks: pulumi.Bool(false),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
connector, err := vpcaccess.NewConnector(ctx, "connector", &vpcaccess.ConnectorArgs{
Region: pulumi.String("us-west1"),
IpCidrRange: pulumi.String("10.8.0.0/28"),
MaxThroughput: pulumi.Int(300),
Network: _default.Name,
}, pulumi.Provider(google_beta), pulumi.DependsOn([]pulumi.Resource{
vpcaccessApi,
}))
if err != nil {
return err
}
router, err := compute.NewRouter(ctx, "router", &compute.RouterArgs{
Region: pulumi.String("us-west1"),
Network: _default.ID(),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
_, err = compute.NewRouterNat(ctx, "routerNat", &compute.RouterNatArgs{
Region: pulumi.String("us-west1"),
Router: router.Name,
SourceSubnetworkIpRangesToNat: pulumi.String("ALL_SUBNETWORKS_ALL_IP_RANGES"),
NatIpAllocateOption: pulumi.String("AUTO_ONLY"),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
_, err = cloudrun.NewService(ctx, "gcrService", &cloudrun.ServiceArgs{
Location: pulumi.String("us-west1"),
Template: &cloudrun.ServiceTemplateArgs{
Spec: &cloudrun.ServiceTemplateSpecArgs{
Containers: cloudrun.ServiceTemplateSpecContainerArray{
&cloudrun.ServiceTemplateSpecContainerArgs{
Image: pulumi.String("us-docker.pkg.dev/cloudrun/container/hello"),
Resources: &cloudrun.ServiceTemplateSpecContainerResourcesArgs{
Limits: pulumi.StringMap{
"cpu": pulumi.String("1000m"),
"memory": pulumi.String("512M"),
},
},
},
},
},
Metadata: &cloudrun.ServiceTemplateMetadataArgs{
Annotations: pulumi.StringMap{
"autoscaling.knative.dev/maxScale": pulumi.String("5"),
"run.googleapis.com/vpc-access-connector": connector.Name,
"run.googleapis.com/vpc-access-egress": pulumi.String("all-traffic"),
},
},
},
AutogenerateRevisionName: pulumi.Bool(true),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
import com.pulumi.resources.CustomResourceOptions;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var vpcaccessApi = new Service("vpcaccessApi", ServiceArgs.builder()
.service("vpcaccess.googleapis.com")
.disableOnDestroy(false)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var default_ = new Network("default", NetworkArgs.builder()
.autoCreateSubnetworks(false)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var connector = new Connector("connector", ConnectorArgs.builder()
.region("us-west1")
.ipCidrRange("10.8.0.0/28")
.maxThroughput(300)
.network(default_.name())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.dependsOn(vpcaccessApi)
.build());
var router = new Router("router", RouterArgs.builder()
.region("us-west1")
.network(default_.id())
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var routerNat = new RouterNat("routerNat", RouterNatArgs.builder()
.region("us-west1")
.router(router.name())
.sourceSubnetworkIpRangesToNat("ALL_SUBNETWORKS_ALL_IP_RANGES")
.natIpAllocateOption("AUTO_ONLY")
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var gcrService = new Service("gcrService", ServiceArgs.builder()
.location("us-west1")
.template(ServiceTemplateArgs.builder()
.spec(ServiceTemplateSpecArgs.builder()
.containers(ServiceTemplateSpecContainerArgs.builder()
.image("us-docker.pkg.dev/cloudrun/container/hello")
.resources(ServiceTemplateSpecContainerResourcesArgs.builder()
.limits(Map.ofEntries(
Map.entry("cpu", "1000m"),
Map.entry("memory", "512M")
))
.build())
.build())
.build())
.metadata(ServiceTemplateMetadataArgs.builder()
.annotations(Map.ofEntries(
Map.entry("autoscaling.knative.dev/maxScale", "5"),
Map.entry("run.googleapis.com/vpc-access-connector", connector.name()),
Map.entry("run.googleapis.com/vpc-access-egress", "all-traffic")
))
.build())
.build())
.autogenerateRevisionName(true)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
}
}
import pulumi
import pulumi_gcp as gcp
vpcaccess_api = gcp.projects.Service("vpcaccessApi",
service="vpcaccess.googleapis.com",
disable_on_destroy=False,
opts=pulumi.ResourceOptions(provider=google_beta))
# VPC
default = gcp.compute.Network("default", auto_create_subnetworks=False,
opts=pulumi.ResourceOptions(provider=google_beta))
# VPC access connector
connector = gcp.vpcaccess.Connector("connector",
region="us-west1",
ip_cidr_range="10.8.0.0/28",
max_throughput=300,
network=default.name,
opts=pulumi.ResourceOptions(provider=google_beta,
depends_on=[vpcaccess_api]))
# Cloud Router
router = gcp.compute.Router("router",
region="us-west1",
network=default.id,
opts=pulumi.ResourceOptions(provider=google_beta))
# NAT configuration
router_nat = gcp.compute.RouterNat("routerNat",
region="us-west1",
router=router.name,
source_subnetwork_ip_ranges_to_nat="ALL_SUBNETWORKS_ALL_IP_RANGES",
nat_ip_allocate_option="AUTO_ONLY",
opts=pulumi.ResourceOptions(provider=google_beta))
# Cloud Run service
gcr_service = gcp.cloudrun.Service("gcrService",
location="us-west1",
template=gcp.cloudrun.ServiceTemplateArgs(
spec=gcp.cloudrun.ServiceTemplateSpecArgs(
containers=[gcp.cloudrun.ServiceTemplateSpecContainerArgs(
image="us-docker.pkg.dev/cloudrun/container/hello",
resources=gcp.cloudrun.ServiceTemplateSpecContainerResourcesArgs(
limits={
"cpu": "1000m",
"memory": "512M",
},
),
)],
),
metadata=gcp.cloudrun.ServiceTemplateMetadataArgs(
annotations={
"autoscaling.knative.dev/maxScale": "5",
"run.googleapis.com/vpc-access-connector": connector.name,
"run.googleapis.com/vpc-access-egress": "all-traffic",
},
),
),
autogenerate_revision_name=True,
opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const vpcaccessApi = new gcp.projects.Service("vpcaccessApi", {
service: "vpcaccess.googleapis.com",
disableOnDestroy: false,
}, {
provider: google_beta,
});
// VPC
const _default = new gcp.compute.Network("default", {autoCreateSubnetworks: false}, {
provider: google_beta,
});
// VPC access connector
const connector = new gcp.vpcaccess.Connector("connector", {
region: "us-west1",
ipCidrRange: "10.8.0.0/28",
maxThroughput: 300,
network: _default.name,
}, {
provider: google_beta,
dependsOn: [vpcaccessApi],
});
// Cloud Router
const router = new gcp.compute.Router("router", {
region: "us-west1",
network: _default.id,
}, {
provider: google_beta,
});
// NAT configuration
const routerNat = new gcp.compute.RouterNat("routerNat", {
region: "us-west1",
router: router.name,
sourceSubnetworkIpRangesToNat: "ALL_SUBNETWORKS_ALL_IP_RANGES",
natIpAllocateOption: "AUTO_ONLY",
}, {
provider: google_beta,
});
// Cloud Run service
const gcrService = new gcp.cloudrun.Service("gcrService", {
location: "us-west1",
template: {
spec: {
containers: [{
image: "us-docker.pkg.dev/cloudrun/container/hello",
resources: {
limits: {
cpu: "1000m",
memory: "512M",
},
},
}],
},
metadata: {
annotations: {
"autoscaling.knative.dev/maxScale": "5",
"run.googleapis.com/vpc-access-connector": connector.name,
"run.googleapis.com/vpc-access-egress": "all-traffic",
},
},
},
autogenerateRevisionName: true,
}, {
provider: google_beta,
});
resources:
vpcaccessApi:
type: gcp:projects:Service
properties:
service: vpcaccess.googleapis.com
disableOnDestroy: false
options:
provider: ${["google-beta"]}
default:
type: gcp:compute:Network
properties:
autoCreateSubnetworks: false
options:
provider: ${["google-beta"]}
connector:
type: gcp:vpcaccess:Connector
properties:
region: us-west1
ipCidrRange: 10.8.0.0/28
maxThroughput: 300
network: ${default.name}
options:
provider: ${["google-beta"]}
dependson:
- ${vpcaccessApi}
router:
type: gcp:compute:Router
properties:
region: us-west1
network: ${default.id}
options:
provider: ${["google-beta"]}
routerNat:
type: gcp:compute:RouterNat
properties:
region: us-west1
router: ${router.name}
sourceSubnetworkIpRangesToNat: ALL_SUBNETWORKS_ALL_IP_RANGES
natIpAllocateOption: AUTO_ONLY
options:
provider: ${["google-beta"]}
gcrService:
type: gcp:cloudrun:Service
properties:
location: us-west1
template:
spec:
containers:
- image: us-docker.pkg.dev/cloudrun/container/hello
resources:
limits:
cpu: 1000m
memory: 512M
metadata:
annotations:
autoscaling.knative.dev/maxScale: 5
run.googleapis.com/vpc-access-connector: ${connector.name}
run.googleapis.com/vpc-access-egress: all-traffic
autogenerateRevisionName: true
options:
provider: ${["google-beta"]}
Create a Connector Resource
new Connector(name: string, args?: ConnectorArgs, opts?: CustomResourceOptions);
@overload
def Connector(resource_name: str,
opts: Optional[ResourceOptions] = None,
ip_cidr_range: Optional[str] = None,
machine_type: Optional[str] = None,
max_instances: Optional[int] = None,
max_throughput: Optional[int] = None,
min_instances: Optional[int] = None,
min_throughput: Optional[int] = None,
name: Optional[str] = None,
network: Optional[str] = None,
project: Optional[str] = None,
region: Optional[str] = None,
subnet: Optional[ConnectorSubnetArgs] = None)
@overload
def Connector(resource_name: str,
args: Optional[ConnectorArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewConnector(ctx *Context, name string, args *ConnectorArgs, opts ...ResourceOption) (*Connector, error)
public Connector(string name, ConnectorArgs? args = null, CustomResourceOptions? opts = null)
public Connector(String name, ConnectorArgs args)
public Connector(String name, ConnectorArgs args, CustomResourceOptions options)
type: gcp:vpcaccess:Connector
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ConnectorArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ConnectorArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ConnectorArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ConnectorArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ConnectorArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Connector Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Connector resource accepts the following input properties:
- Ip
Cidr stringRange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- Machine
Type string Machine type of VM Instance underlying connector. Default is e2-micro
- Max
Instances int Maximum value of instances in autoscaling group underlying the connector.
- Max
Throughput int Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- Min
Instances int Minimum value of instances in autoscaling group underlying the connector.
- Min
Throughput int Minimum throughput of the connector in Mbps. Default and min is 200.
- Name string
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}"
- Network string
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- Subnet
Connector
Subnet Args The subnet in which to house the connector Structure is documented below.
- Ip
Cidr stringRange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- Machine
Type string Machine type of VM Instance underlying connector. Default is e2-micro
- Max
Instances int Maximum value of instances in autoscaling group underlying the connector.
- Max
Throughput int Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- Min
Instances int Minimum value of instances in autoscaling group underlying the connector.
- Min
Throughput int Minimum throughput of the connector in Mbps. Default and min is 200.
- Name string
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}"
- Network string
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- Subnet
Connector
Subnet Args The subnet in which to house the connector Structure is documented below.
- ip
Cidr StringRange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- machine
Type String Machine type of VM Instance underlying connector. Default is e2-micro
- max
Instances Integer Maximum value of instances in autoscaling group underlying the connector.
- max
Throughput Integer Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- min
Instances Integer Minimum value of instances in autoscaling group underlying the connector.
- min
Throughput Integer Minimum throughput of the connector in Mbps. Default and min is 200.
- name String
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}"
- network String
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- subnet
Connector
Subnet Args The subnet in which to house the connector Structure is documented below.
- ip
Cidr stringRange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- machine
Type string Machine type of VM Instance underlying connector. Default is e2-micro
- max
Instances number Maximum value of instances in autoscaling group underlying the connector.
- max
Throughput number Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- min
Instances number Minimum value of instances in autoscaling group underlying the connector.
- min
Throughput number Minimum throughput of the connector in Mbps. Default and min is 200.
- name string
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}"
- network string
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- subnet
Connector
Subnet Args The subnet in which to house the connector Structure is documented below.
- ip_
cidr_ strrange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- machine_
type str Machine type of VM Instance underlying connector. Default is e2-micro
- max_
instances int Maximum value of instances in autoscaling group underlying the connector.
- max_
throughput int Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- min_
instances int Minimum value of instances in autoscaling group underlying the connector.
- min_
throughput int Minimum throughput of the connector in Mbps. Default and min is 200.
- name str
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}"
- network str
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region str
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- subnet
Connector
Subnet Args The subnet in which to house the connector Structure is documented below.
- ip
Cidr StringRange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- machine
Type String Machine type of VM Instance underlying connector. Default is e2-micro
- max
Instances Number Maximum value of instances in autoscaling group underlying the connector.
- max
Throughput Number Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- min
Instances Number Minimum value of instances in autoscaling group underlying the connector.
- min
Throughput Number Minimum throughput of the connector in Mbps. Default and min is 200.
- name String
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}"
- network String
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- subnet Property Map
The subnet in which to house the connector Structure is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the Connector resource produces the following output properties:
Look up an Existing Connector Resource
Get an existing Connector resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ConnectorState, opts?: CustomResourceOptions): Connector
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
ip_cidr_range: Optional[str] = None,
machine_type: Optional[str] = None,
max_instances: Optional[int] = None,
max_throughput: Optional[int] = None,
min_instances: Optional[int] = None,
min_throughput: Optional[int] = None,
name: Optional[str] = None,
network: Optional[str] = None,
project: Optional[str] = None,
region: Optional[str] = None,
self_link: Optional[str] = None,
state: Optional[str] = None,
subnet: Optional[ConnectorSubnetArgs] = None) -> Connector
func GetConnector(ctx *Context, name string, id IDInput, state *ConnectorState, opts ...ResourceOption) (*Connector, error)
public static Connector Get(string name, Input<string> id, ConnectorState? state, CustomResourceOptions? opts = null)
public static Connector get(String name, Output<String> id, ConnectorState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Ip
Cidr stringRange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- Machine
Type string Machine type of VM Instance underlying connector. Default is e2-micro
- Max
Instances int Maximum value of instances in autoscaling group underlying the connector.
- Max
Throughput int Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- Min
Instances int Minimum value of instances in autoscaling group underlying the connector.
- Min
Throughput int Minimum throughput of the connector in Mbps. Default and min is 200.
- Name string
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}"
- Network string
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- Self
Link string The fully qualified name of this VPC connector
- State string
State of the VPC access connector.
- Subnet
Connector
Subnet Args The subnet in which to house the connector Structure is documented below.
- Ip
Cidr stringRange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- Machine
Type string Machine type of VM Instance underlying connector. Default is e2-micro
- Max
Instances int Maximum value of instances in autoscaling group underlying the connector.
- Max
Throughput int Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- Min
Instances int Minimum value of instances in autoscaling group underlying the connector.
- Min
Throughput int Minimum throughput of the connector in Mbps. Default and min is 200.
- Name string
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}"
- Network string
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- Self
Link string The fully qualified name of this VPC connector
- State string
State of the VPC access connector.
- Subnet
Connector
Subnet Args The subnet in which to house the connector Structure is documented below.
- ip
Cidr StringRange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- machine
Type String Machine type of VM Instance underlying connector. Default is e2-micro
- max
Instances Integer Maximum value of instances in autoscaling group underlying the connector.
- max
Throughput Integer Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- min
Instances Integer Minimum value of instances in autoscaling group underlying the connector.
- min
Throughput Integer Minimum throughput of the connector in Mbps. Default and min is 200.
- name String
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}"
- network String
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- self
Link String The fully qualified name of this VPC connector
- state String
State of the VPC access connector.
- subnet
Connector
Subnet Args The subnet in which to house the connector Structure is documented below.
- ip
Cidr stringRange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- machine
Type string Machine type of VM Instance underlying connector. Default is e2-micro
- max
Instances number Maximum value of instances in autoscaling group underlying the connector.
- max
Throughput number Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- min
Instances number Minimum value of instances in autoscaling group underlying the connector.
- min
Throughput number Minimum throughput of the connector in Mbps. Default and min is 200.
- name string
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}"
- network string
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- self
Link string The fully qualified name of this VPC connector
- state string
State of the VPC access connector.
- subnet
Connector
Subnet Args The subnet in which to house the connector Structure is documented below.
- ip_
cidr_ strrange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- machine_
type str Machine type of VM Instance underlying connector. Default is e2-micro
- max_
instances int Maximum value of instances in autoscaling group underlying the connector.
- max_
throughput int Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- min_
instances int Minimum value of instances in autoscaling group underlying the connector.
- min_
throughput int Minimum throughput of the connector in Mbps. Default and min is 200.
- name str
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}"
- network str
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region str
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- self_
link str The fully qualified name of this VPC connector
- state str
State of the VPC access connector.
- subnet
Connector
Subnet Args The subnet in which to house the connector Structure is documented below.
- ip
Cidr StringRange The range of internal addresses that follows RFC 4632 notation. Example:
10.132.0.0/28
.- machine
Type String Machine type of VM Instance underlying connector. Default is e2-micro
- max
Instances Number Maximum value of instances in autoscaling group underlying the connector.
- max
Throughput Number Maximum throughput of the connector in Mbps, must be greater than
min_throughput
. Default is 300.- min
Instances Number Minimum value of instances in autoscaling group underlying the connector.
- min
Throughput Number Minimum throughput of the connector in Mbps. Default and min is 200.
- name String
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}"
- network String
Name or self_link of the VPC network. Required if
ip_cidr_range
is set.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
Region where the VPC Access connector resides. If it is not provided, the provider region is used.
- self
Link String The fully qualified name of this VPC connector
- state String
State of the VPC access connector.
- subnet Property Map
The subnet in which to house the connector Structure is documented below.
Supporting Types
ConnectorSubnet
- Name string
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 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 string
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 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 String
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 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 string
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 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 str
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 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 String
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 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.
Import
Connector can be imported using any of these accepted formats
$ 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}}
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.