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 theflexibleengine.VpcPeeringConnectionV2
resource to manage the requester’s side of the connection and use theflexibleengine.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,
});
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)
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
})
}
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,
});
});
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());
}
}
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}
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 string
- The unique name of the resource.
- args VpcPeeringConnectionV2Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args VpcPeeringConnectionV2Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcPeeringConnectionV2Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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: &flexibleengine.VpcPeeringConnectionV2TimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
},
VpcPeeringConnectionV2Id: pulumi.String("string"),
})
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());
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")
const vpcPeeringConnectionV2Resource = new flexibleengine.VpcPeeringConnectionV2("vpcPeeringConnectionV2Resource", {
peerVpcId: "string",
vpcId: "string",
name: "string",
peerTenantId: "string",
region: "string",
timeouts: {
create: "string",
"delete": "string",
},
vpcPeeringConnectionV2Id: "string",
});
type: flexibleengine:VpcPeeringConnectionV2
properties:
name: string
peerTenantId: string
peerVpcId: string
region: string
timeouts:
create: string
delete: string
vpcId: string
vpcPeeringConnectionV2Id: string
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:
- Peer
Vpc stringId - Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
- Vpc
Id 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.
- Peer
Tenant stringId - 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
Vpc
Peering Connection V2Timeouts - Vpc
Peering stringConnection V2Id - The VPC peering connection ID.
- Peer
Vpc stringId - Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
- Vpc
Id 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.
- Peer
Tenant stringId - 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
Vpc
Peering Connection V2Timeouts Args - Vpc
Peering stringConnection V2Id - The VPC peering connection ID.
- peer
Vpc StringId - Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
- vpc
Id 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.
- peer
Tenant StringId - 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
Vpc
Peering Connection V2Timeouts - vpc
Peering StringConnection V2Id - The VPC peering connection ID.
- peer
Vpc stringId - Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
- vpc
Id 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.
- peer
Tenant stringId - 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
Vpc
Peering Connection V2Timeouts - vpc
Peering stringConnection V2Id - The VPC peering connection ID.
- peer_
vpc_ strid - Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
- vpc_
id 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_ strid - 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
Vpc
Peering Connection V2Timeouts Args - vpc_
peering_ strconnection_ v2_ id - The VPC peering connection ID.
- peer
Vpc StringId - Specifies the VPC ID of the accepter tenant. Changing this creates a new VPC peering connection.
- vpc
Id 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.
- peer
Tenant StringId - 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
- vpc
Peering StringConnection V2Id - The VPC peering connection ID.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcPeeringConnectionV2 resource produces the following output properties:
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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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 string
- Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
- Peer
Tenant stringId - Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
- Peer
Vpc stringId - 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
Vpc
Peering Connection V2Timeouts - Vpc
Id string - Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
- Vpc
Peering stringConnection V2Id - The VPC peering connection ID.
- Name string
- Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
- Peer
Tenant stringId - Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
- Peer
Vpc stringId - 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
Vpc
Peering Connection V2Timeouts Args - Vpc
Id string - Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
- Vpc
Peering stringConnection V2Id - The VPC peering connection ID.
- name String
- Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
- peer
Tenant StringId - Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
- peer
Vpc StringId - 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
Vpc
Peering Connection V2Timeouts - vpc
Id String - Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
- vpc
Peering StringConnection V2Id - The VPC peering connection ID.
- name string
- Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
- peer
Tenant stringId - Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
- peer
Vpc stringId - 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
Vpc
Peering Connection V2Timeouts - vpc
Id string - Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
- vpc
Peering stringConnection V2Id - 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_ strid - Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
- peer_
vpc_ strid - 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
Vpc
Peering Connection V2Timeouts Args - 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_ strconnection_ v2_ id - The VPC peering connection ID.
- name String
- Specifies the name of the VPC peering connection. The value can contain 1 to 64 characters.
- peer
Tenant StringId - Specified the Tenant Id of the accepter tenant. Changing this creates a new VPC peering connection.
- peer
Vpc StringId - 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
- vpc
Id String - Specifies the ID of a VPC involved in a VPC peering connection. Changing this creates a new VPC peering connection.
- vpc
Peering StringConnection V2Id - The VPC peering connection ID.
Supporting Types
VpcPeeringConnectionV2Timeouts, VpcPeeringConnectionV2TimeoutsArgs
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
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.