1. Packages
  2. Aiven Provider
  3. API Docs
  4. GcpOrgVpcPeeringConnection
Aiven v6.37.0 published on Thursday, Apr 10, 2025 by Pulumi

aiven.GcpOrgVpcPeeringConnection

Explore with Pulumi AI

Creates and manages a Google Cloud VPC peering connection.

This resource is in the beta stage and may change without notice. Set the PROVIDER_AIVEN_ENABLE_BETA environment variable to use the resource.

Example Usage

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

const exampleVpc = new aiven.OrganizationVpc("example_vpc", {
    organizationId: exampleAivenOrganization.id,
    cloudName: "google-europe-west10",
    networkCidr: "10.0.0.0/24",
});
const example = new aiven.GcpOrgVpcPeeringConnection("example", {
    organizationId: exampleVpc.organizationId,
    organizationVpcId: exampleVpc.organizationVpcId,
    gcpProjectId: "my-gcp-project-123",
    peerVpc: "my-vpc-network",
});
Copy
import pulumi
import pulumi_aiven as aiven

example_vpc = aiven.OrganizationVpc("example_vpc",
    organization_id=example_aiven_organization["id"],
    cloud_name="google-europe-west10",
    network_cidr="10.0.0.0/24")
example = aiven.GcpOrgVpcPeeringConnection("example",
    organization_id=example_vpc.organization_id,
    organization_vpc_id=example_vpc.organization_vpc_id,
    gcp_project_id="my-gcp-project-123",
    peer_vpc="my-vpc-network")
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 {
		exampleVpc, err := aiven.NewOrganizationVpc(ctx, "example_vpc", &aiven.OrganizationVpcArgs{
			OrganizationId: pulumi.Any(exampleAivenOrganization.Id),
			CloudName:      pulumi.String("google-europe-west10"),
			NetworkCidr:    pulumi.String("10.0.0.0/24"),
		})
		if err != nil {
			return err
		}
		_, err = aiven.NewGcpOrgVpcPeeringConnection(ctx, "example", &aiven.GcpOrgVpcPeeringConnectionArgs{
			OrganizationId:    exampleVpc.OrganizationId,
			OrganizationVpcId: exampleVpc.OrganizationVpcId,
			GcpProjectId:      pulumi.String("my-gcp-project-123"),
			PeerVpc:           pulumi.String("my-vpc-network"),
		})
		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 exampleVpc = new Aiven.OrganizationVpc("example_vpc", new()
    {
        OrganizationId = exampleAivenOrganization.Id,
        CloudName = "google-europe-west10",
        NetworkCidr = "10.0.0.0/24",
    });

    var example = new Aiven.GcpOrgVpcPeeringConnection("example", new()
    {
        OrganizationId = exampleVpc.OrganizationId,
        OrganizationVpcId = exampleVpc.OrganizationVpcId,
        GcpProjectId = "my-gcp-project-123",
        PeerVpc = "my-vpc-network",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aiven.OrganizationVpc;
import com.pulumi.aiven.OrganizationVpcArgs;
import com.pulumi.aiven.GcpOrgVpcPeeringConnection;
import com.pulumi.aiven.GcpOrgVpcPeeringConnectionArgs;
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 exampleVpc = new OrganizationVpc("exampleVpc", OrganizationVpcArgs.builder()
            .organizationId(exampleAivenOrganization.id())
            .cloudName("google-europe-west10")
            .networkCidr("10.0.0.0/24")
            .build());

        var example = new GcpOrgVpcPeeringConnection("example", GcpOrgVpcPeeringConnectionArgs.builder()
            .organizationId(exampleVpc.organizationId())
            .organizationVpcId(exampleVpc.organizationVpcId())
            .gcpProjectId("my-gcp-project-123")
            .peerVpc("my-vpc-network")
            .build());

    }
}
Copy
resources:
  exampleVpc:
    type: aiven:OrganizationVpc
    name: example_vpc
    properties:
      organizationId: ${exampleAivenOrganization.id}
      cloudName: google-europe-west10
      networkCidr: 10.0.0.0/24
  example:
    type: aiven:GcpOrgVpcPeeringConnection
    properties:
      organizationId: ${exampleVpc.organizationId}
      organizationVpcId: ${exampleVpc.organizationVpcId}
      gcpProjectId: my-gcp-project-123
      peerVpc: my-vpc-network
Copy

Create GcpOrgVpcPeeringConnection Resource

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

Constructor syntax

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

@overload
def GcpOrgVpcPeeringConnection(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               gcp_project_id: Optional[str] = None,
                               organization_id: Optional[str] = None,
                               organization_vpc_id: Optional[str] = None,
                               peer_vpc: Optional[str] = None)
func NewGcpOrgVpcPeeringConnection(ctx *Context, name string, args GcpOrgVpcPeeringConnectionArgs, opts ...ResourceOption) (*GcpOrgVpcPeeringConnection, error)
public GcpOrgVpcPeeringConnection(string name, GcpOrgVpcPeeringConnectionArgs args, CustomResourceOptions? opts = null)
public GcpOrgVpcPeeringConnection(String name, GcpOrgVpcPeeringConnectionArgs args)
public GcpOrgVpcPeeringConnection(String name, GcpOrgVpcPeeringConnectionArgs args, CustomResourceOptions options)
type: aiven:GcpOrgVpcPeeringConnection
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. GcpOrgVpcPeeringConnectionArgs
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. GcpOrgVpcPeeringConnectionArgs
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. GcpOrgVpcPeeringConnectionArgs
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. GcpOrgVpcPeeringConnectionArgs
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. GcpOrgVpcPeeringConnectionArgs
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 gcpOrgVpcPeeringConnectionResource = new Aiven.GcpOrgVpcPeeringConnection("gcpOrgVpcPeeringConnectionResource", new()
{
    GcpProjectId = "string",
    OrganizationId = "string",
    OrganizationVpcId = "string",
    PeerVpc = "string",
});
Copy
example, err := aiven.NewGcpOrgVpcPeeringConnection(ctx, "gcpOrgVpcPeeringConnectionResource", &aiven.GcpOrgVpcPeeringConnectionArgs{
	GcpProjectId:      pulumi.String("string"),
	OrganizationId:    pulumi.String("string"),
	OrganizationVpcId: pulumi.String("string"),
	PeerVpc:           pulumi.String("string"),
})
Copy
var gcpOrgVpcPeeringConnectionResource = new GcpOrgVpcPeeringConnection("gcpOrgVpcPeeringConnectionResource", GcpOrgVpcPeeringConnectionArgs.builder()
    .gcpProjectId("string")
    .organizationId("string")
    .organizationVpcId("string")
    .peerVpc("string")
    .build());
Copy
gcp_org_vpc_peering_connection_resource = aiven.GcpOrgVpcPeeringConnection("gcpOrgVpcPeeringConnectionResource",
    gcp_project_id="string",
    organization_id="string",
    organization_vpc_id="string",
    peer_vpc="string")
Copy
const gcpOrgVpcPeeringConnectionResource = new aiven.GcpOrgVpcPeeringConnection("gcpOrgVpcPeeringConnectionResource", {
    gcpProjectId: "string",
    organizationId: "string",
    organizationVpcId: "string",
    peerVpc: "string",
});
Copy
type: aiven:GcpOrgVpcPeeringConnection
properties:
    gcpProjectId: string
    organizationId: string
    organizationVpcId: string
    peerVpc: string
Copy

GcpOrgVpcPeeringConnection 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 GcpOrgVpcPeeringConnection 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.
OrganizationId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the organization.
OrganizationVpcId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the organization VPC.
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.
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.
OrganizationId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the organization.
OrganizationVpcId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the organization VPC.
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.
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.
organizationId
This property is required.
Changes to this property will trigger replacement.
String
Identifier of the organization.
organizationVpcId
This property is required.
Changes to this property will trigger replacement.
String
Identifier of the organization VPC.
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.
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.
organizationId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the organization.
organizationVpcId
This property is required.
Changes to this property will trigger replacement.
string
Identifier of the organization VPC.
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.
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.
organization_id
This property is required.
Changes to this property will trigger replacement.
str
Identifier of the organization.
organization_vpc_id
This property is required.
Changes to this property will trigger replacement.
str
Identifier of the organization VPC.
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.
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.
organizationId
This property is required.
Changes to this property will trigger replacement.
String
Identifier of the organization.
organizationVpcId
This property is required.
Changes to this property will trigger replacement.
String
Identifier of the organization VPC.
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.

Outputs

All input properties are implicitly available as output properties. Additionally, the GcpOrgVpcPeeringConnection 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.
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.
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.
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.
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.
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.

Look up Existing GcpOrgVpcPeeringConnection Resource

Get an existing GcpOrgVpcPeeringConnection 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?: GcpOrgVpcPeeringConnectionState, opts?: CustomResourceOptions): GcpOrgVpcPeeringConnection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        gcp_project_id: Optional[str] = None,
        organization_id: Optional[str] = None,
        organization_vpc_id: Optional[str] = None,
        peer_vpc: Optional[str] = None,
        self_link: Optional[str] = None,
        state: Optional[str] = None) -> GcpOrgVpcPeeringConnection
func GetGcpOrgVpcPeeringConnection(ctx *Context, name string, id IDInput, state *GcpOrgVpcPeeringConnectionState, opts ...ResourceOption) (*GcpOrgVpcPeeringConnection, error)
public static GcpOrgVpcPeeringConnection Get(string name, Input<string> id, GcpOrgVpcPeeringConnectionState? state, CustomResourceOptions? opts = null)
public static GcpOrgVpcPeeringConnection get(String name, Output<String> id, GcpOrgVpcPeeringConnectionState state, CustomResourceOptions options)
resources:  _:    type: aiven:GcpOrgVpcPeeringConnection    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.
OrganizationId Changes to this property will trigger replacement. string
Identifier of the organization.
OrganizationVpcId Changes to this property will trigger replacement. string
Identifier of the organization VPC.
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.
GcpProjectId Changes to this property will trigger replacement. string
Google Cloud project ID. Changing this property forces recreation of the resource.
OrganizationId Changes to this property will trigger replacement. string
Identifier of the organization.
OrganizationVpcId Changes to this property will trigger replacement. string
Identifier of the organization VPC.
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.
gcpProjectId Changes to this property will trigger replacement. String
Google Cloud project ID. Changing this property forces recreation of the resource.
organizationId Changes to this property will trigger replacement. String
Identifier of the organization.
organizationVpcId Changes to this property will trigger replacement. String
Identifier of the organization VPC.
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.
gcpProjectId Changes to this property will trigger replacement. string
Google Cloud project ID. Changing this property forces recreation of the resource.
organizationId Changes to this property will trigger replacement. string
Identifier of the organization.
organizationVpcId Changes to this property will trigger replacement. string
Identifier of the organization VPC.
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.
gcp_project_id Changes to this property will trigger replacement. str
Google Cloud project ID. Changing this property forces recreation of the resource.
organization_id Changes to this property will trigger replacement. str
Identifier of the organization.
organization_vpc_id Changes to this property will trigger replacement. str
Identifier of the organization VPC.
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.
gcpProjectId Changes to this property will trigger replacement. String
Google Cloud project ID. Changing this property forces recreation of the resource.
organizationId Changes to this property will trigger replacement. String
Identifier of the organization.
organizationVpcId Changes to this property will trigger replacement. String
Identifier of the organization VPC.
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.

Import

$ pulumi import aiven:index/gcpOrgVpcPeeringConnection:GcpOrgVpcPeeringConnection example ORGANIZATION_ID/ORGANIZATION_VPC_ID/GCP_PROJECT_ID/VPC_NAME
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.