1. Packages
  2. Flexibleengine Provider
  3. API Docs
  4. VpcPeeringConnectionV2
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

flexibleengine.VpcPeeringConnectionV2

Explore with Pulumi AI

Provides a resource to manage a VPC Peering Connection resource.

Note: If you create a VPC peering connection with another VPC of your own, the connection is created without the need for you to accept the connection.
For cross-tenant (requester’s tenant differs from the accepter’s tenant) VPC Peering Connections, use the flexibleengine.VpcPeeringConnectionV2 resource to manage the requester’s side of the connection and use the flexibleengine.VpcPeeringConnectionAccepterV2 resource to manage the accepter’s side of the connection.

Example Usage

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

const config = new pulumi.Config();
const accepterVpcId = config.requireObject("accepterVpcId");
const exampleVpc = new flexibleengine.VpcV1("exampleVpc", {cidr: "192.168.0.0/16"});
const peering = new flexibleengine.VpcPeeringConnectionV2("peering", {
    vpcId: exampleVpc.vpcV1Id,
    peerVpcId: accepterVpcId,
});
Copy
import pulumi
import pulumi_flexibleengine as flexibleengine

config = pulumi.Config()
accepter_vpc_id = config.require_object("accepterVpcId")
example_vpc = flexibleengine.VpcV1("exampleVpc", cidr="192.168.0.0/16")
peering = flexibleengine.VpcPeeringConnectionV2("peering",
    vpc_id=example_vpc.vpc_v1_id,
    peer_vpc_id=accepter_vpc_id)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		accepterVpcId := cfg.RequireObject("accepterVpcId")
		exampleVpc, err := flexibleengine.NewVpcV1(ctx, "exampleVpc", &flexibleengine.VpcV1Args{
			Cidr: pulumi.String("192.168.0.0/16"),
		})
		if err != nil {
			return err
		}
		_, err = flexibleengine.NewVpcPeeringConnectionV2(ctx, "peering", &flexibleengine.VpcPeeringConnectionV2Args{
			VpcId:     exampleVpc.VpcV1Id,
			PeerVpcId: pulumi.Any(accepterVpcId),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var accepterVpcId = config.RequireObject<dynamic>("accepterVpcId");
    var exampleVpc = new Flexibleengine.VpcV1("exampleVpc", new()
    {
        Cidr = "192.168.0.0/16",
    });

    var peering = new Flexibleengine.VpcPeeringConnectionV2("peering", new()
    {
        VpcId = exampleVpc.VpcV1Id,
        PeerVpcId = accepterVpcId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.VpcV1;
import com.pulumi.flexibleengine.VpcV1Args;
import com.pulumi.flexibleengine.VpcPeeringConnectionV2;
import com.pulumi.flexibleengine.VpcPeeringConnectionV2Args;
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 config = ctx.config();
        final var accepterVpcId = config.get("accepterVpcId");
        var exampleVpc = new VpcV1("exampleVpc", VpcV1Args.builder()
            .cidr("192.168.0.0/16")
            .build());

        var peering = new VpcPeeringConnectionV2("peering", VpcPeeringConnectionV2Args.builder()
            .vpcId(exampleVpc.vpcV1Id())
            .peerVpcId(accepterVpcId)
            .build());

    }
}
Copy
configuration:
  accepterVpcId:
    type: dynamic
resources:
  exampleVpc:
    type: flexibleengine:VpcV1
    properties:
      cidr: 192.168.0.0/16
  peering:
    type: flexibleengine:VpcPeeringConnectionV2
    properties:
      vpcId: ${exampleVpc.vpcV1Id}
      peerVpcId: ${accepterVpcId}
Copy

Create VpcPeeringConnectionV2 Resource

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

Constructor syntax

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

@overload
def VpcPeeringConnectionV2(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           peer_vpc_id: Optional[str] = None,
                           vpc_id: Optional[str] = None,
                           name: Optional[str] = None,
                           peer_tenant_id: Optional[str] = None,
                           region: Optional[str] = None,
                           timeouts: Optional[VpcPeeringConnectionV2TimeoutsArgs] = None,
                           vpc_peering_connection_v2_id: Optional[str] = None)
func NewVpcPeeringConnectionV2(ctx *Context, name string, args VpcPeeringConnectionV2Args, opts ...ResourceOption) (*VpcPeeringConnectionV2, error)
public VpcPeeringConnectionV2(string name, VpcPeeringConnectionV2Args args, CustomResourceOptions? opts = null)
public VpcPeeringConnectionV2(String name, VpcPeeringConnectionV2Args args)
public VpcPeeringConnectionV2(String name, VpcPeeringConnectionV2Args args, CustomResourceOptions options)
type: flexibleengine:VpcPeeringConnectionV2
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. VpcPeeringConnectionV2Args
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. VpcPeeringConnectionV2Args
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. VpcPeeringConnectionV2Args
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. VpcPeeringConnectionV2Args
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. VpcPeeringConnectionV2Args
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 vpcPeeringConnectionV2Resource = new Flexibleengine.VpcPeeringConnectionV2("vpcPeeringConnectionV2Resource", new()
{
    PeerVpcId = "string",
    VpcId = "string",
    Name = "string",
    PeerTenantId = "string",
    Region = "string",
    Timeouts = new Flexibleengine.Inputs.VpcPeeringConnectionV2TimeoutsArgs
    {
        Create = "string",
        Delete = "string",
    },
    VpcPeeringConnectionV2Id = "string",
});
Copy
example, err := flexibleengine.NewVpcPeeringConnectionV2(ctx, "vpcPeeringConnectionV2Resource", &flexibleengine.VpcPeeringConnectionV2Args{
PeerVpcId: pulumi.String("string"),
VpcId: pulumi.String("string"),
Name: pulumi.String("string"),
PeerTenantId: pulumi.String("string"),
Region: pulumi.String("string"),
Timeouts: &.VpcPeeringConnectionV2TimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
},
VpcPeeringConnectionV2Id: pulumi.String("string"),
})
Copy
var vpcPeeringConnectionV2Resource = new VpcPeeringConnectionV2("vpcPeeringConnectionV2Resource", VpcPeeringConnectionV2Args.builder()
    .peerVpcId("string")
    .vpcId("string")
    .name("string")
    .peerTenantId("string")
    .region("string")
    .timeouts(VpcPeeringConnectionV2TimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .build())
    .vpcPeeringConnectionV2Id("string")
    .build());
Copy
vpc_peering_connection_v2_resource = flexibleengine.VpcPeeringConnectionV2("vpcPeeringConnectionV2Resource",
    peer_vpc_id="string",
    vpc_id="string",
    name="string",
    peer_tenant_id="string",
    region="string",
    timeouts={
        "create": "string",
        "delete": "string",
    },
    vpc_peering_connection_v2_id="string")
Copy
const vpcPeeringConnectionV2Resource = new flexibleengine.VpcPeeringConnectionV2("vpcPeeringConnectionV2Resource", {
    peerVpcId: "string",
    vpcId: "string",
    name: "string",
    peerTenantId: "string",
    region: "string",
    timeouts: {
        create: "string",
        "delete": "string",
    },
    vpcPeeringConnectionV2Id: "string",
});
Copy
type: flexibleengine:VpcPeeringConnectionV2
properties:
    name: string
    peerTenantId: string
    peerVpcId: string
    region: string
    timeouts:
        create: string
        delete: string
    vpcId: string
    vpcPeeringConnectionV2Id: string
Copy

VpcPeeringConnectionV2 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 VpcPeeringConnectionV2 resource accepts the following input properties:

PeerVpcId This property is required. string
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
VpcId This property is required. string
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
Name string
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
PeerTenantId string
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
Region string
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
Timeouts VpcPeeringConnectionV2Timeouts
VpcPeeringConnectionV2Id string
The VPC peering connection ID.
PeerVpcId This property is required. string
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
VpcId This property is required. string
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
Name string
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
PeerTenantId string
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
Region string
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
Timeouts VpcPeeringConnectionV2TimeoutsArgs
VpcPeeringConnectionV2Id string
The VPC peering connection ID.
peerVpcId This property is required. String
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
vpcId This property is required. String
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
name String
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
peerTenantId String
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
region String
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
timeouts VpcPeeringConnectionV2Timeouts
vpcPeeringConnectionV2Id String
The VPC peering connection ID.
peerVpcId This property is required. string
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
vpcId This property is required. string
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
name string
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
peerTenantId string
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
region string
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
timeouts VpcPeeringConnectionV2Timeouts
vpcPeeringConnectionV2Id string
The VPC peering connection ID.
peer_vpc_id This property is required. str
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
vpc_id This property is required. str
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
name str
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
peer_tenant_id str
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
region str
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
timeouts VpcPeeringConnectionV2TimeoutsArgs
vpc_peering_connection_v2_id str
The VPC peering connection ID.
peerVpcId This property is required. String
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
vpcId This property is required. String
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
name String
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
peerTenantId String
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
region String
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
timeouts Property Map
vpcPeeringConnectionV2Id String
The VPC peering connection ID.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Status string
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.
id String
The provider-assigned unique ID for this managed resource.
status String
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.
id string
The provider-assigned unique ID for this managed resource.
status string
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.
id str
The provider-assigned unique ID for this managed resource.
status str
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.
id String
The provider-assigned unique ID for this managed resource.
status String
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.

Look up Existing VpcPeeringConnectionV2 Resource

Get an existing VpcPeeringConnectionV2 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?: VpcPeeringConnectionV2State, opts?: CustomResourceOptions): VpcPeeringConnectionV2
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        peer_tenant_id: Optional[str] = None,
        peer_vpc_id: Optional[str] = None,
        region: Optional[str] = None,
        status: Optional[str] = None,
        timeouts: Optional[VpcPeeringConnectionV2TimeoutsArgs] = None,
        vpc_id: Optional[str] = None,
        vpc_peering_connection_v2_id: Optional[str] = None) -> VpcPeeringConnectionV2
func GetVpcPeeringConnectionV2(ctx *Context, name string, id IDInput, state *VpcPeeringConnectionV2State, opts ...ResourceOption) (*VpcPeeringConnectionV2, error)
public static VpcPeeringConnectionV2 Get(string name, Input<string> id, VpcPeeringConnectionV2State? state, CustomResourceOptions? opts = null)
public static VpcPeeringConnectionV2 get(String name, Output<String> id, VpcPeeringConnectionV2State state, CustomResourceOptions options)
resources:  _:    type: flexibleengine:VpcPeeringConnectionV2    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:
Name string
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
PeerTenantId string
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
PeerVpcId string
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
Region string
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
Status string
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.
Timeouts VpcPeeringConnectionV2Timeouts
VpcId string
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
VpcPeeringConnectionV2Id string
The VPC peering connection ID.
Name string
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
PeerTenantId string
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
PeerVpcId string
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
Region string
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
Status string
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.
Timeouts VpcPeeringConnectionV2TimeoutsArgs
VpcId string
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
VpcPeeringConnectionV2Id string
The VPC peering connection ID.
name String
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
peerTenantId String
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
peerVpcId String
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
region String
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
status String
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.
timeouts VpcPeeringConnectionV2Timeouts
vpcId String
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
vpcPeeringConnectionV2Id String
The VPC peering connection ID.
name string
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
peerTenantId string
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
peerVpcId string
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
region string
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
status string
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.
timeouts VpcPeeringConnectionV2Timeouts
vpcId string
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
vpcPeeringConnectionV2Id string
The VPC peering connection ID.
name str
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
peer_tenant_id str
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
peer_vpc_id str
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
region str
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
status str
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.
timeouts VpcPeeringConnectionV2TimeoutsArgs
vpc_id str
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
vpc_peering_connection_v2_id str
The VPC peering connection ID.
name String
Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
peerTenantId String
Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
peerVpcId String
Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
region String
Specifies the region in which to create the VPC peering connection. If omitted, the provider-level region will be used. Changing this creates a new VPC peering connection.
status String
The VPC peering connection status. The value can be PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, or ACTIVE.
timeouts Property Map
vpcId String
Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
vpcPeeringConnectionV2Id String
The VPC peering connection ID.

Supporting Types

VpcPeeringConnectionV2Timeouts
, VpcPeeringConnectionV2TimeoutsArgs

Create string
Delete string
Create string
Delete string
create String
delete String
create string
delete string
create str
delete str
create String
delete String

Import

VPC Peering resources can be imported using the vpc peering id, e.g.

$ pulumi import flexibleengine:index/vpcPeeringConnectionV2:VpcPeeringConnectionV2 test_connection 22b76469-08e3-4937-8c1d-7aad34892be1
Copy

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

Package Details

Repository
flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
License
Notes
This Pulumi package is based on the flexibleengine Terraform Provider.