1. Packages
  2. Aiven Provider
  3. API Docs
  4. GcpVpcPeeringConnection
Aiven v6.36.0 published on Thursday, Mar 13, 2025 by Pulumi

aiven.GcpVpcPeeringConnection

Explore with Pulumi AI

Creates and manages a Google Cloud VPC peering connection.

Example Usage

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

const foo = new aiven.GcpVpcPeeringConnection("foo", {
    vpcId: vpc.id,
    gcpProjectId: "xxxx",
    peerVpc: "xxxx",
});
Copy
import pulumi
import pulumi_aiven as aiven

foo = aiven.GcpVpcPeeringConnection("foo",
    vpc_id=vpc["id"],
    gcp_project_id="xxxx",
    peer_vpc="xxxx")
Copy
package main

import (
	"github.com/pulumi/pulumi-aiven/sdk/v6/go/aiven"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := aiven.NewGcpVpcPeeringConnection(ctx, "foo", &aiven.GcpVpcPeeringConnectionArgs{
			VpcId:        pulumi.Any(vpc.Id),
			GcpProjectId: pulumi.String("xxxx"),
			PeerVpc:      pulumi.String("xxxx"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aiven = Pulumi.Aiven;

return await Deployment.RunAsync(() => 
{
    var foo = new Aiven.GcpVpcPeeringConnection("foo", new()
    {
        VpcId = vpc.Id,
        GcpProjectId = "xxxx",
        PeerVpc = "xxxx",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aiven.GcpVpcPeeringConnection;
import com.pulumi.aiven.GcpVpcPeeringConnectionArgs;
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 foo = new GcpVpcPeeringConnection("foo", GcpVpcPeeringConnectionArgs.builder()
            .vpcId(vpc.id())
            .gcpProjectId("xxxx")
            .peerVpc("xxxx")
            .build());

    }
}
Copy
resources:
  foo:
    type: aiven:GcpVpcPeeringConnection
    properties:
      vpcId: ${vpc.id}
      gcpProjectId: xxxx
      peerVpc: xxxx
Copy

Create GcpVpcPeeringConnection Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new GcpVpcPeeringConnection(name: string, args: GcpVpcPeeringConnectionArgs, opts?: CustomResourceOptions);
@overload
def GcpVpcPeeringConnection(resource_name: str,
                            args: GcpVpcPeeringConnectionArgs,
                            opts: Optional[ResourceOptions] = None)

@overload
def GcpVpcPeeringConnection(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            gcp_project_id: Optional[str] = None,
                            peer_vpc: Optional[str] = None,
                            vpc_id: Optional[str] = None)
func NewGcpVpcPeeringConnection(ctx *Context, name string, args GcpVpcPeeringConnectionArgs, opts ...ResourceOption) (*GcpVpcPeeringConnection, error)
public GcpVpcPeeringConnection(string name, GcpVpcPeeringConnectionArgs args, CustomResourceOptions? opts = null)
public GcpVpcPeeringConnection(String name, GcpVpcPeeringConnectionArgs args)
public GcpVpcPeeringConnection(String name, GcpVpcPeeringConnectionArgs args, CustomResourceOptions options)
type: aiven:GcpVpcPeeringConnection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. GcpVpcPeeringConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. GcpVpcPeeringConnectionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. GcpVpcPeeringConnectionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. GcpVpcPeeringConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. GcpVpcPeeringConnectionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var gcpVpcPeeringConnectionResource = new Aiven.GcpVpcPeeringConnection("gcpVpcPeeringConnectionResource", new()
{
    GcpProjectId = "string",
    PeerVpc = "string",
    VpcId = "string",
});
Copy
example, err := aiven.NewGcpVpcPeeringConnection(ctx, "gcpVpcPeeringConnectionResource", &aiven.GcpVpcPeeringConnectionArgs{
	GcpProjectId: pulumi.String("string"),
	PeerVpc:      pulumi.String("string"),
	VpcId:        pulumi.String("string"),
})
Copy
var gcpVpcPeeringConnectionResource = new GcpVpcPeeringConnection("gcpVpcPeeringConnectionResource", GcpVpcPeeringConnectionArgs.builder()
    .gcpProjectId("string")
    .peerVpc("string")
    .vpcId("string")
    .build());
Copy
gcp_vpc_peering_connection_resource = aiven.GcpVpcPeeringConnection("gcpVpcPeeringConnectionResource",
    gcp_project_id="string",
    peer_vpc="string",
    vpc_id="string")
Copy
const gcpVpcPeeringConnectionResource = new aiven.GcpVpcPeeringConnection("gcpVpcPeeringConnectionResource", {
    gcpProjectId: "string",
    peerVpc: "string",
    vpcId: "string",
});
Copy
type: aiven:GcpVpcPeeringConnection
properties:
    gcpProjectId: string
    peerVpc: string
    vpcId: string
Copy

GcpVpcPeeringConnection Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The GcpVpcPeeringConnection resource accepts the following input properties:

GcpProjectId
This property is required.
Changes to this property will trigger replacement.
string
Google Cloud project ID. Changing this property forces recreation of the resource.
PeerVpc
This property is required.
Changes to this property will trigger replacement.
string
Google Cloud VPC network name. Changing this property forces recreation of the resource.
VpcId
This property is required.
Changes to this property will trigger replacement.
string
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.
GcpProjectId
This property is required.
Changes to this property will trigger replacement.
string
Google Cloud project ID. Changing this property forces recreation of the resource.
PeerVpc
This property is required.
Changes to this property will trigger replacement.
string
Google Cloud VPC network name. Changing this property forces recreation of the resource.
VpcId
This property is required.
Changes to this property will trigger replacement.
string
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.
gcpProjectId
This property is required.
Changes to this property will trigger replacement.
String
Google Cloud project ID. Changing this property forces recreation of the resource.
peerVpc
This property is required.
Changes to this property will trigger replacement.
String
Google Cloud VPC network name. Changing this property forces recreation of the resource.
vpcId
This property is required.
Changes to this property will trigger replacement.
String
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.
gcpProjectId
This property is required.
Changes to this property will trigger replacement.
string
Google Cloud project ID. Changing this property forces recreation of the resource.
peerVpc
This property is required.
Changes to this property will trigger replacement.
string
Google Cloud VPC network name. Changing this property forces recreation of the resource.
vpcId
This property is required.
Changes to this property will trigger replacement.
string
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.
gcp_project_id
This property is required.
Changes to this property will trigger replacement.
str
Google Cloud project ID. Changing this property forces recreation of the resource.
peer_vpc
This property is required.
Changes to this property will trigger replacement.
str
Google Cloud VPC network name. Changing this property forces recreation of the resource.
vpc_id
This property is required.
Changes to this property will trigger replacement.
str
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.
gcpProjectId
This property is required.
Changes to this property will trigger replacement.
String
Google Cloud project ID. Changing this property forces recreation of the resource.
peerVpc
This property is required.
Changes to this property will trigger replacement.
String
Google Cloud VPC network name. Changing this property forces recreation of the resource.
vpcId
This property is required.
Changes to this property will trigger replacement.
String
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the GcpVpcPeeringConnection resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
SelfLink string
Computed Google Cloud network peering link.
State string
State of the peering connection.
StateInfo Dictionary<string, string>
State-specific help or error information.
Id string
The provider-assigned unique ID for this managed resource.
SelfLink string
Computed Google Cloud network peering link.
State string
State of the peering connection.
StateInfo map[string]string
State-specific help or error information.
id String
The provider-assigned unique ID for this managed resource.
selfLink String
Computed Google Cloud network peering link.
state String
State of the peering connection.
stateInfo Map<String,String>
State-specific help or error information.
id string
The provider-assigned unique ID for this managed resource.
selfLink string
Computed Google Cloud network peering link.
state string
State of the peering connection.
stateInfo {[key: string]: string}
State-specific help or error information.
id str
The provider-assigned unique ID for this managed resource.
self_link str
Computed Google Cloud network peering link.
state str
State of the peering connection.
state_info Mapping[str, str]
State-specific help or error information.
id String
The provider-assigned unique ID for this managed resource.
selfLink String
Computed Google Cloud network peering link.
state String
State of the peering connection.
stateInfo Map<String>
State-specific help or error information.

Look up Existing GcpVpcPeeringConnection Resource

Get an existing GcpVpcPeeringConnection 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?: GcpVpcPeeringConnectionState, opts?: CustomResourceOptions): GcpVpcPeeringConnection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        gcp_project_id: Optional[str] = None,
        peer_vpc: Optional[str] = None,
        self_link: Optional[str] = None,
        state: Optional[str] = None,
        state_info: Optional[Mapping[str, str]] = None,
        vpc_id: Optional[str] = None) -> GcpVpcPeeringConnection
func GetGcpVpcPeeringConnection(ctx *Context, name string, id IDInput, state *GcpVpcPeeringConnectionState, opts ...ResourceOption) (*GcpVpcPeeringConnection, error)
public static GcpVpcPeeringConnection Get(string name, Input<string> id, GcpVpcPeeringConnectionState? state, CustomResourceOptions? opts = null)
public static GcpVpcPeeringConnection get(String name, Output<String> id, GcpVpcPeeringConnectionState state, CustomResourceOptions options)
resources:  _:    type: aiven:GcpVpcPeeringConnection    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
GcpProjectId Changes to this property will trigger replacement. string
Google Cloud project ID. Changing this property forces recreation of the resource.
PeerVpc Changes to this property will trigger replacement. string
Google Cloud VPC network name. Changing this property forces recreation of the resource.
SelfLink string
Computed Google Cloud network peering link.
State string
State of the peering connection.
StateInfo Dictionary<string, string>
State-specific help or error information.
VpcId Changes to this property will trigger replacement. string
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.
GcpProjectId Changes to this property will trigger replacement. string
Google Cloud project ID. Changing this property forces recreation of the resource.
PeerVpc Changes to this property will trigger replacement. string
Google Cloud VPC network name. Changing this property forces recreation of the resource.
SelfLink string
Computed Google Cloud network peering link.
State string
State of the peering connection.
StateInfo map[string]string
State-specific help or error information.
VpcId Changes to this property will trigger replacement. string
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.
gcpProjectId Changes to this property will trigger replacement. String
Google Cloud project ID. Changing this property forces recreation of the resource.
peerVpc Changes to this property will trigger replacement. String
Google Cloud VPC network name. Changing this property forces recreation of the resource.
selfLink String
Computed Google Cloud network peering link.
state String
State of the peering connection.
stateInfo Map<String,String>
State-specific help or error information.
vpcId Changes to this property will trigger replacement. String
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.
gcpProjectId Changes to this property will trigger replacement. string
Google Cloud project ID. Changing this property forces recreation of the resource.
peerVpc Changes to this property will trigger replacement. string
Google Cloud VPC network name. Changing this property forces recreation of the resource.
selfLink string
Computed Google Cloud network peering link.
state string
State of the peering connection.
stateInfo {[key: string]: string}
State-specific help or error information.
vpcId Changes to this property will trigger replacement. string
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.
gcp_project_id Changes to this property will trigger replacement. str
Google Cloud project ID. Changing this property forces recreation of the resource.
peer_vpc Changes to this property will trigger replacement. str
Google Cloud VPC network name. Changing this property forces recreation of the resource.
self_link str
Computed Google Cloud network peering link.
state str
State of the peering connection.
state_info Mapping[str, str]
State-specific help or error information.
vpc_id Changes to this property will trigger replacement. str
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.
gcpProjectId Changes to this property will trigger replacement. String
Google Cloud project ID. Changing this property forces recreation of the resource.
peerVpc Changes to this property will trigger replacement. String
Google Cloud VPC network name. Changing this property forces recreation of the resource.
selfLink String
Computed Google Cloud network peering link.
state String
State of the peering connection.
stateInfo Map<String>
State-specific help or error information.
vpcId Changes to this property will trigger replacement. String
The VPC the peering connection belongs to. Changing this property forces recreation of the resource.

Import

$ pulumi import aiven:index/gcpVpcPeeringConnection:GcpVpcPeeringConnection foo PROJECT_NAME/VPC_ID/GCP_PROJECT_ID/PEER_VPC
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Aiven pulumi/pulumi-aiven
License
Apache-2.0
Notes
This Pulumi package is based on the aiven Terraform Provider.