Connector Args
Serverless VPC Access connector resource. To get more information about Connector, see:
How-to Guides
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",
});
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")
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",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/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"),
})
if err != nil {
return err
}
return nil
})
}
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.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) {
var connector = new Connector("connector", ConnectorArgs.builder()
.name("vpc-con")
.ipCidrRange("10.8.0.0/28")
.network("default")
.build());
}
}
resources:
connector:
type: gcp:vpcaccess:Connector
properties:
name: vpc-con
ipCidrRange: 10.8.0.0/28
network: default
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",
});
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")
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",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v7/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"),
})
if err != nil {
return err
}
return nil
})
}
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.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) {
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")
.build());
}
}
resources:
connector:
type: gcp:vpcaccess:Connector
properties:
name: vpc-con
subnet:
name: ${customTest.name}
machineType: e2-standard-4
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 thepulumi 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
Properties
The range of internal addresses that follows RFC 4632 notation. Example: 10.132.0.0/28
.
Machine type of VM Instance underlying connector. Default is e2-micro
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.
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.
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.
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.
The subnet in which to house the connector Structure is documented below.