1. Packages
  2. Aiven Provider
  3. API Docs
  4. AwsVpcPeeringConnection
Aiven v6.35.0 published on Friday, Feb 21, 2025 by Pulumi

aiven.AwsVpcPeeringConnection

Explore with Pulumi AI

Creates and manages an AWS VPC peering connection with an Aiven VPC.

Example Usage

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

const exampleVpc = new aiven.ProjectVpc("example_vpc", {
    project: exampleProject.project,
    cloudName: "aws-us-east-2",
    networkCidr: "192.168.1.0/24",
});
const awsToAivenPeering = new aiven.AwsVpcPeeringConnection("aws_to_aiven_peering", {
    vpcId: exampleVpc.id,
    awsAccountId: awsId,
    awsVpcId: "vpc-1a2b3c4d5e6f7g8h9",
    awsVpcRegion: "aws-us-east-2",
});
Copy
import pulumi
import pulumi_aiven as aiven

example_vpc = aiven.ProjectVpc("example_vpc",
    project=example_project["project"],
    cloud_name="aws-us-east-2",
    network_cidr="192.168.1.0/24")
aws_to_aiven_peering = aiven.AwsVpcPeeringConnection("aws_to_aiven_peering",
    vpc_id=example_vpc.id,
    aws_account_id=aws_id,
    aws_vpc_id="vpc-1a2b3c4d5e6f7g8h9",
    aws_vpc_region="aws-us-east-2")
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.NewProjectVpc(ctx, "example_vpc", &aiven.ProjectVpcArgs{
			Project:     pulumi.Any(exampleProject.Project),
			CloudName:   pulumi.String("aws-us-east-2"),
			NetworkCidr: pulumi.String("192.168.1.0/24"),
		})
		if err != nil {
			return err
		}
		_, err = aiven.NewAwsVpcPeeringConnection(ctx, "aws_to_aiven_peering", &aiven.AwsVpcPeeringConnectionArgs{
			VpcId:        exampleVpc.ID(),
			AwsAccountId: pulumi.Any(awsId),
			AwsVpcId:     pulumi.String("vpc-1a2b3c4d5e6f7g8h9"),
			AwsVpcRegion: pulumi.String("aws-us-east-2"),
		})
		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.ProjectVpc("example_vpc", new()
    {
        Project = exampleProject.Project,
        CloudName = "aws-us-east-2",
        NetworkCidr = "192.168.1.0/24",
    });

    var awsToAivenPeering = new Aiven.AwsVpcPeeringConnection("aws_to_aiven_peering", new()
    {
        VpcId = exampleVpc.Id,
        AwsAccountId = awsId,
        AwsVpcId = "vpc-1a2b3c4d5e6f7g8h9",
        AwsVpcRegion = "aws-us-east-2",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aiven.ProjectVpc;
import com.pulumi.aiven.ProjectVpcArgs;
import com.pulumi.aiven.AwsVpcPeeringConnection;
import com.pulumi.aiven.AwsVpcPeeringConnectionArgs;
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 ProjectVpc("exampleVpc", ProjectVpcArgs.builder()
            .project(exampleProject.project())
            .cloudName("aws-us-east-2")
            .networkCidr("192.168.1.0/24")
            .build());

        var awsToAivenPeering = new AwsVpcPeeringConnection("awsToAivenPeering", AwsVpcPeeringConnectionArgs.builder()
            .vpcId(exampleVpc.id())
            .awsAccountId(awsId)
            .awsVpcId("vpc-1a2b3c4d5e6f7g8h9")
            .awsVpcRegion("aws-us-east-2")
            .build());

    }
}
Copy
resources:
  exampleVpc:
    type: aiven:ProjectVpc
    name: example_vpc
    properties:
      project: ${exampleProject.project}
      cloudName: aws-us-east-2
      networkCidr: 192.168.1.0/24
  awsToAivenPeering:
    type: aiven:AwsVpcPeeringConnection
    name: aws_to_aiven_peering
    properties:
      vpcId: ${exampleVpc.id}
      awsAccountId: ${awsId}
      awsVpcId: vpc-1a2b3c4d5e6f7g8h9
      awsVpcRegion: aws-us-east-2
Copy

Create AwsVpcPeeringConnection Resource

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

Constructor syntax

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

@overload
def AwsVpcPeeringConnection(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            aws_account_id: Optional[str] = None,
                            aws_vpc_id: Optional[str] = None,
                            aws_vpc_region: Optional[str] = None,
                            vpc_id: Optional[str] = None)
func NewAwsVpcPeeringConnection(ctx *Context, name string, args AwsVpcPeeringConnectionArgs, opts ...ResourceOption) (*AwsVpcPeeringConnection, error)
public AwsVpcPeeringConnection(string name, AwsVpcPeeringConnectionArgs args, CustomResourceOptions? opts = null)
public AwsVpcPeeringConnection(String name, AwsVpcPeeringConnectionArgs args)
public AwsVpcPeeringConnection(String name, AwsVpcPeeringConnectionArgs args, CustomResourceOptions options)
type: aiven:AwsVpcPeeringConnection
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. AwsVpcPeeringConnectionArgs
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. AwsVpcPeeringConnectionArgs
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. AwsVpcPeeringConnectionArgs
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. AwsVpcPeeringConnectionArgs
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. AwsVpcPeeringConnectionArgs
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 awsVpcPeeringConnectionResource = new Aiven.AwsVpcPeeringConnection("awsVpcPeeringConnectionResource", new()
{
    AwsAccountId = "string",
    AwsVpcId = "string",
    AwsVpcRegion = "string",
    VpcId = "string",
});
Copy
example, err := aiven.NewAwsVpcPeeringConnection(ctx, "awsVpcPeeringConnectionResource", &aiven.AwsVpcPeeringConnectionArgs{
	AwsAccountId: pulumi.String("string"),
	AwsVpcId:     pulumi.String("string"),
	AwsVpcRegion: pulumi.String("string"),
	VpcId:        pulumi.String("string"),
})
Copy
var awsVpcPeeringConnectionResource = new AwsVpcPeeringConnection("awsVpcPeeringConnectionResource", AwsVpcPeeringConnectionArgs.builder()
    .awsAccountId("string")
    .awsVpcId("string")
    .awsVpcRegion("string")
    .vpcId("string")
    .build());
Copy
aws_vpc_peering_connection_resource = aiven.AwsVpcPeeringConnection("awsVpcPeeringConnectionResource",
    aws_account_id="string",
    aws_vpc_id="string",
    aws_vpc_region="string",
    vpc_id="string")
Copy
const awsVpcPeeringConnectionResource = new aiven.AwsVpcPeeringConnection("awsVpcPeeringConnectionResource", {
    awsAccountId: "string",
    awsVpcId: "string",
    awsVpcRegion: "string",
    vpcId: "string",
});
Copy
type: aiven:AwsVpcPeeringConnection
properties:
    awsAccountId: string
    awsVpcId: string
    awsVpcRegion: string
    vpcId: string
Copy

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

AwsAccountId
This property is required.
Changes to this property will trigger replacement.
string
AWS account ID. Changing this property forces recreation of the resource.
AwsVpcId
This property is required.
Changes to this property will trigger replacement.
string
AWS VPC ID. Changing this property forces recreation of the resource.
AwsVpcRegion
This property is required.
Changes to this property will trigger replacement.
string
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
VpcId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Aiven VPC. Changing this property forces recreation of the resource.
AwsAccountId
This property is required.
Changes to this property will trigger replacement.
string
AWS account ID. Changing this property forces recreation of the resource.
AwsVpcId
This property is required.
Changes to this property will trigger replacement.
string
AWS VPC ID. Changing this property forces recreation of the resource.
AwsVpcRegion
This property is required.
Changes to this property will trigger replacement.
string
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
VpcId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Aiven VPC. Changing this property forces recreation of the resource.
awsAccountId
This property is required.
Changes to this property will trigger replacement.
String
AWS account ID. Changing this property forces recreation of the resource.
awsVpcId
This property is required.
Changes to this property will trigger replacement.
String
AWS VPC ID. Changing this property forces recreation of the resource.
awsVpcRegion
This property is required.
Changes to this property will trigger replacement.
String
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
vpcId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Aiven VPC. Changing this property forces recreation of the resource.
awsAccountId
This property is required.
Changes to this property will trigger replacement.
string
AWS account ID. Changing this property forces recreation of the resource.
awsVpcId
This property is required.
Changes to this property will trigger replacement.
string
AWS VPC ID. Changing this property forces recreation of the resource.
awsVpcRegion
This property is required.
Changes to this property will trigger replacement.
string
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
vpcId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Aiven VPC. Changing this property forces recreation of the resource.
aws_account_id
This property is required.
Changes to this property will trigger replacement.
str
AWS account ID. Changing this property forces recreation of the resource.
aws_vpc_id
This property is required.
Changes to this property will trigger replacement.
str
AWS VPC ID. Changing this property forces recreation of the resource.
aws_vpc_region
This property is required.
Changes to this property will trigger replacement.
str
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
vpc_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Aiven VPC. Changing this property forces recreation of the resource.
awsAccountId
This property is required.
Changes to this property will trigger replacement.
String
AWS account ID. Changing this property forces recreation of the resource.
awsVpcId
This property is required.
Changes to this property will trigger replacement.
String
AWS VPC ID. Changing this property forces recreation of the resource.
awsVpcRegion
This property is required.
Changes to this property will trigger replacement.
String
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
vpcId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Aiven VPC. Changing this property forces recreation of the resource.

Outputs

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

AwsVpcPeeringConnectionId string
The ID of the AWS VPC peering connection.
Id string
The provider-assigned unique ID for this managed resource.
State string
The state of the peering connection.
StateInfo Dictionary<string, string>
State-specific help or error information.
AwsVpcPeeringConnectionId string
The ID of the AWS VPC peering connection.
Id string
The provider-assigned unique ID for this managed resource.
State string
The state of the peering connection.
StateInfo map[string]string
State-specific help or error information.
awsVpcPeeringConnectionId String
The ID of the AWS VPC peering connection.
id String
The provider-assigned unique ID for this managed resource.
state String
The state of the peering connection.
stateInfo Map<String,String>
State-specific help or error information.
awsVpcPeeringConnectionId string
The ID of the AWS VPC peering connection.
id string
The provider-assigned unique ID for this managed resource.
state string
The state of the peering connection.
stateInfo {[key: string]: string}
State-specific help or error information.
aws_vpc_peering_connection_id str
The ID of the AWS VPC peering connection.
id str
The provider-assigned unique ID for this managed resource.
state str
The state of the peering connection.
state_info Mapping[str, str]
State-specific help or error information.
awsVpcPeeringConnectionId String
The ID of the AWS VPC peering connection.
id String
The provider-assigned unique ID for this managed resource.
state String
The state of the peering connection.
stateInfo Map<String>
State-specific help or error information.

Look up Existing AwsVpcPeeringConnection Resource

Get an existing AwsVpcPeeringConnection 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?: AwsVpcPeeringConnectionState, opts?: CustomResourceOptions): AwsVpcPeeringConnection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        aws_account_id: Optional[str] = None,
        aws_vpc_id: Optional[str] = None,
        aws_vpc_peering_connection_id: Optional[str] = None,
        aws_vpc_region: Optional[str] = None,
        state: Optional[str] = None,
        state_info: Optional[Mapping[str, str]] = None,
        vpc_id: Optional[str] = None) -> AwsVpcPeeringConnection
func GetAwsVpcPeeringConnection(ctx *Context, name string, id IDInput, state *AwsVpcPeeringConnectionState, opts ...ResourceOption) (*AwsVpcPeeringConnection, error)
public static AwsVpcPeeringConnection Get(string name, Input<string> id, AwsVpcPeeringConnectionState? state, CustomResourceOptions? opts = null)
public static AwsVpcPeeringConnection get(String name, Output<String> id, AwsVpcPeeringConnectionState state, CustomResourceOptions options)
resources:  _:    type: aiven:AwsVpcPeeringConnection    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:
AwsAccountId Changes to this property will trigger replacement. string
AWS account ID. Changing this property forces recreation of the resource.
AwsVpcId Changes to this property will trigger replacement. string
AWS VPC ID. Changing this property forces recreation of the resource.
AwsVpcPeeringConnectionId string
The ID of the AWS VPC peering connection.
AwsVpcRegion Changes to this property will trigger replacement. string
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
State string
The 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 ID of the Aiven VPC. Changing this property forces recreation of the resource.
AwsAccountId Changes to this property will trigger replacement. string
AWS account ID. Changing this property forces recreation of the resource.
AwsVpcId Changes to this property will trigger replacement. string
AWS VPC ID. Changing this property forces recreation of the resource.
AwsVpcPeeringConnectionId string
The ID of the AWS VPC peering connection.
AwsVpcRegion Changes to this property will trigger replacement. string
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
State string
The 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 ID of the Aiven VPC. Changing this property forces recreation of the resource.
awsAccountId Changes to this property will trigger replacement. String
AWS account ID. Changing this property forces recreation of the resource.
awsVpcId Changes to this property will trigger replacement. String
AWS VPC ID. Changing this property forces recreation of the resource.
awsVpcPeeringConnectionId String
The ID of the AWS VPC peering connection.
awsVpcRegion Changes to this property will trigger replacement. String
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
state String
The 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 ID of the Aiven VPC. Changing this property forces recreation of the resource.
awsAccountId Changes to this property will trigger replacement. string
AWS account ID. Changing this property forces recreation of the resource.
awsVpcId Changes to this property will trigger replacement. string
AWS VPC ID. Changing this property forces recreation of the resource.
awsVpcPeeringConnectionId string
The ID of the AWS VPC peering connection.
awsVpcRegion Changes to this property will trigger replacement. string
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
state string
The 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 ID of the Aiven VPC. Changing this property forces recreation of the resource.
aws_account_id Changes to this property will trigger replacement. str
AWS account ID. Changing this property forces recreation of the resource.
aws_vpc_id Changes to this property will trigger replacement. str
AWS VPC ID. Changing this property forces recreation of the resource.
aws_vpc_peering_connection_id str
The ID of the AWS VPC peering connection.
aws_vpc_region Changes to this property will trigger replacement. str
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
state str
The 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 ID of the Aiven VPC. Changing this property forces recreation of the resource.
awsAccountId Changes to this property will trigger replacement. String
AWS account ID. Changing this property forces recreation of the resource.
awsVpcId Changes to this property will trigger replacement. String
AWS VPC ID. Changing this property forces recreation of the resource.
awsVpcPeeringConnectionId String
The ID of the AWS VPC peering connection.
awsVpcRegion Changes to this property will trigger replacement. String
The AWS region of the peered VPC, if different from the Aiven VPC region. Changing this property forces recreation of the resource.
state String
The state of the peering connection.
stateInfo Map<String>
State-specific help or error information.
vpcId Changes to this property will trigger replacement. String
The ID of the Aiven VPC. Changing this property forces recreation of the resource.

Import

$ pulumi import aiven:index/awsVpcPeeringConnection:AwsVpcPeeringConnection aws_to_aiven_peering PROJECT/VPC_ID/AWS_ACCOUNT_ID/AWS_VPC_ID/AWS_VPC_REGION
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.