Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi
gcp.vpcaccess.getConnector
Explore with Pulumi AI
Get a Serverless VPC Access connector.
To get more information about Connector, see:
- API documentation
- How-to Guides
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,
});
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)
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
})
}
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,
});
});
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());
}
}
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
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>
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]
func LookupConnector(ctx *Context, args *LookupConnectorArgs, opts ...InvokeOption) (*LookupConnectorResult, error)
func LookupConnectorOutput(ctx *Context, args *LookupConnectorOutputArgs, opts ...InvokeOption) LookupConnectorResultOutput
> 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)
}
public static CompletableFuture<GetConnectorResult> getConnector(GetConnectorArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:vpcaccess/getConnector:getConnector
arguments:
# arguments dictionary
The following arguments are supported:
getConnector Result
The following output properties are available:
- Connected
Projects List<string> - Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Cidr stringRange - Machine
Type string - Max
Instances int - Max
Throughput int - Min
Instances int - Min
Throughput int - Name string
- Network string
- Self
Link string - State string
- Subnets
List<Get
Connector Subnet> - Project string
- Region string
- Connected
Projects []string - Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Cidr stringRange - Machine
Type string - Max
Instances int - Max
Throughput int - Min
Instances int - Min
Throughput int - Name string
- Network string
- Self
Link string - State string
- Subnets
[]Get
Connector Subnet - Project string
- Region string
- connected
Projects List<String> - id String
- The provider-assigned unique ID for this managed resource.
- ip
Cidr StringRange - machine
Type String - max
Instances Integer - max
Throughput Integer - min
Instances Integer - min
Throughput Integer - name String
- network String
- self
Link String - state String
- subnets
List<Get
Connector Subnet> - project String
- region String
- connected
Projects string[] - id string
- The provider-assigned unique ID for this managed resource.
- ip
Cidr stringRange - machine
Type string - max
Instances number - max
Throughput number - min
Instances number - min
Throughput number - name string
- network string
- self
Link string - state string
- subnets
Get
Connector Subnet[] - project string
- region string
- connected_
projects Sequence[str] - id str
- The provider-assigned unique ID for this managed resource.
- ip_
cidr_ strrange - 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[Get
Connector Subnet] - project str
- region str
- connected
Projects List<String> - id String
- The provider-assigned unique ID for this managed resource.
- ip
Cidr StringRange - machine
Type String - max
Instances Number - max
Throughput Number - min
Instances Number - min
Throughput Number - name String
- network String
- self
Link String - state String
- subnets List<Property Map>
- project String
- region String
Supporting Types
GetConnectorSubnet
- name str
- Name of the resource.
- 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.
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.