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

aiven.TransitGatewayVpcAttachment

Explore with Pulumi AI

The Transit Gateway VPC Attachment resource allows the creation and management Transit Gateway VPC Attachment VPC peering connection between Aiven and AWS.

Example Usage

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

const attachment = new aiven.TransitGatewayVpcAttachment("attachment", {
    vpcId: bar.id,
    peerCloudAccount: "<PEER_ACCOUNT_ID>",
    peerVpc: "google-project1",
    peerRegion: "aws-eu-west-1",
    userPeerNetworkCidrs: ["10.0.0.0/24"],
});
Copy
import pulumi
import pulumi_aiven as aiven

attachment = aiven.TransitGatewayVpcAttachment("attachment",
    vpc_id=bar["id"],
    peer_cloud_account="<PEER_ACCOUNT_ID>",
    peer_vpc="google-project1",
    peer_region="aws-eu-west-1",
    user_peer_network_cidrs=["10.0.0.0/24"])
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.NewTransitGatewayVpcAttachment(ctx, "attachment", &aiven.TransitGatewayVpcAttachmentArgs{
			VpcId:            pulumi.Any(bar.Id),
			PeerCloudAccount: pulumi.String("<PEER_ACCOUNT_ID>"),
			PeerVpc:          pulumi.String("google-project1"),
			PeerRegion:       pulumi.String("aws-eu-west-1"),
			UserPeerNetworkCidrs: pulumi.StringArray{
				pulumi.String("10.0.0.0/24"),
			},
		})
		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 attachment = new Aiven.TransitGatewayVpcAttachment("attachment", new()
    {
        VpcId = bar.Id,
        PeerCloudAccount = "<PEER_ACCOUNT_ID>",
        PeerVpc = "google-project1",
        PeerRegion = "aws-eu-west-1",
        UserPeerNetworkCidrs = new[]
        {
            "10.0.0.0/24",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aiven.TransitGatewayVpcAttachment;
import com.pulumi.aiven.TransitGatewayVpcAttachmentArgs;
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 attachment = new TransitGatewayVpcAttachment("attachment", TransitGatewayVpcAttachmentArgs.builder()
            .vpcId(bar.id())
            .peerCloudAccount("<PEER_ACCOUNT_ID>")
            .peerVpc("google-project1")
            .peerRegion("aws-eu-west-1")
            .userPeerNetworkCidrs("10.0.0.0/24")
            .build());

    }
}
Copy
resources:
  attachment:
    type: aiven:TransitGatewayVpcAttachment
    properties:
      vpcId: ${bar.id}
      peerCloudAccount: <PEER_ACCOUNT_ID>
      peerVpc: google-project1
      peerRegion: aws-eu-west-1
      userPeerNetworkCidrs:
        - 10.0.0.0/24
Copy

Create TransitGatewayVpcAttachment Resource

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

Constructor syntax

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

@overload
def TransitGatewayVpcAttachment(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                peer_cloud_account: Optional[str] = None,
                                peer_vpc: Optional[str] = None,
                                user_peer_network_cidrs: Optional[Sequence[str]] = None,
                                vpc_id: Optional[str] = None,
                                peer_region: Optional[str] = None)
func NewTransitGatewayVpcAttachment(ctx *Context, name string, args TransitGatewayVpcAttachmentArgs, opts ...ResourceOption) (*TransitGatewayVpcAttachment, error)
public TransitGatewayVpcAttachment(string name, TransitGatewayVpcAttachmentArgs args, CustomResourceOptions? opts = null)
public TransitGatewayVpcAttachment(String name, TransitGatewayVpcAttachmentArgs args)
public TransitGatewayVpcAttachment(String name, TransitGatewayVpcAttachmentArgs args, CustomResourceOptions options)
type: aiven:TransitGatewayVpcAttachment
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. TransitGatewayVpcAttachmentArgs
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. TransitGatewayVpcAttachmentArgs
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. TransitGatewayVpcAttachmentArgs
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. TransitGatewayVpcAttachmentArgs
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. TransitGatewayVpcAttachmentArgs
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 transitGatewayVpcAttachmentResource = new Aiven.TransitGatewayVpcAttachment("transitGatewayVpcAttachmentResource", new()
{
    PeerCloudAccount = "string",
    PeerVpc = "string",
    UserPeerNetworkCidrs = new[]
    {
        "string",
    },
    VpcId = "string",
    PeerRegion = "string",
});
Copy
example, err := aiven.NewTransitGatewayVpcAttachment(ctx, "transitGatewayVpcAttachmentResource", &aiven.TransitGatewayVpcAttachmentArgs{
	PeerCloudAccount: pulumi.String("string"),
	PeerVpc:          pulumi.String("string"),
	UserPeerNetworkCidrs: pulumi.StringArray{
		pulumi.String("string"),
	},
	VpcId:      pulumi.String("string"),
	PeerRegion: pulumi.String("string"),
})
Copy
var transitGatewayVpcAttachmentResource = new TransitGatewayVpcAttachment("transitGatewayVpcAttachmentResource", TransitGatewayVpcAttachmentArgs.builder()
    .peerCloudAccount("string")
    .peerVpc("string")
    .userPeerNetworkCidrs("string")
    .vpcId("string")
    .peerRegion("string")
    .build());
Copy
transit_gateway_vpc_attachment_resource = aiven.TransitGatewayVpcAttachment("transitGatewayVpcAttachmentResource",
    peer_cloud_account="string",
    peer_vpc="string",
    user_peer_network_cidrs=["string"],
    vpc_id="string",
    peer_region="string")
Copy
const transitGatewayVpcAttachmentResource = new aiven.TransitGatewayVpcAttachment("transitGatewayVpcAttachmentResource", {
    peerCloudAccount: "string",
    peerVpc: "string",
    userPeerNetworkCidrs: ["string"],
    vpcId: "string",
    peerRegion: "string",
});
Copy
type: aiven:TransitGatewayVpcAttachment
properties:
    peerCloudAccount: string
    peerRegion: string
    peerVpc: string
    userPeerNetworkCidrs:
        - string
    vpcId: string
Copy

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

PeerCloudAccount
This property is required.
Changes to this property will trigger replacement.
string
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
PeerVpc
This property is required.
Changes to this property will trigger replacement.
string
Transit gateway ID. Changing this property forces recreation of the resource.
UserPeerNetworkCidrs This property is required. List<string>
List of private IPv4 ranges to route through the peering connection
VpcId
This property is required.
Changes to this property will trigger replacement.
string
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
PeerRegion Changes to this property will trigger replacement. string
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.
PeerCloudAccount
This property is required.
Changes to this property will trigger replacement.
string
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
PeerVpc
This property is required.
Changes to this property will trigger replacement.
string
Transit gateway ID. Changing this property forces recreation of the resource.
UserPeerNetworkCidrs This property is required. []string
List of private IPv4 ranges to route through the peering connection
VpcId
This property is required.
Changes to this property will trigger replacement.
string
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
PeerRegion Changes to this property will trigger replacement. string
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.
peerCloudAccount
This property is required.
Changes to this property will trigger replacement.
String
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
peerVpc
This property is required.
Changes to this property will trigger replacement.
String
Transit gateway ID. Changing this property forces recreation of the resource.
userPeerNetworkCidrs This property is required. List<String>
List of private IPv4 ranges to route through the peering connection
vpcId
This property is required.
Changes to this property will trigger replacement.
String
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
peerRegion Changes to this property will trigger replacement. String
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.
peerCloudAccount
This property is required.
Changes to this property will trigger replacement.
string
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
peerVpc
This property is required.
Changes to this property will trigger replacement.
string
Transit gateway ID. Changing this property forces recreation of the resource.
userPeerNetworkCidrs This property is required. string[]
List of private IPv4 ranges to route through the peering connection
vpcId
This property is required.
Changes to this property will trigger replacement.
string
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
peerRegion Changes to this property will trigger replacement. string
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.
peer_cloud_account
This property is required.
Changes to this property will trigger replacement.
str
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
peer_vpc
This property is required.
Changes to this property will trigger replacement.
str
Transit gateway ID. Changing this property forces recreation of the resource.
user_peer_network_cidrs This property is required. Sequence[str]
List of private IPv4 ranges to route through the peering connection
vpc_id
This property is required.
Changes to this property will trigger replacement.
str
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
peer_region Changes to this property will trigger replacement. str
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.
peerCloudAccount
This property is required.
Changes to this property will trigger replacement.
String
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
peerVpc
This property is required.
Changes to this property will trigger replacement.
String
Transit gateway ID. Changing this property forces recreation of the resource.
userPeerNetworkCidrs This property is required. List<String>
List of private IPv4 ranges to route through the peering connection
vpcId
This property is required.
Changes to this property will trigger replacement.
String
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
peerRegion Changes to this property will trigger replacement. String
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
PeeringConnectionId string
Cloud provider identifier for the peering connection if available
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.
PeeringConnectionId string
Cloud provider identifier for the peering connection if available
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.
peeringConnectionId String
Cloud provider identifier for the peering connection if available
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.
peeringConnectionId string
Cloud provider identifier for the peering connection if available
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.
peering_connection_id str
Cloud provider identifier for the peering connection if available
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.
peeringConnectionId String
Cloud provider identifier for the peering connection if available
state String
State of the peering connection
stateInfo Map<String>
State-specific help or error information

Look up Existing TransitGatewayVpcAttachment Resource

Get an existing TransitGatewayVpcAttachment 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?: TransitGatewayVpcAttachmentState, opts?: CustomResourceOptions): TransitGatewayVpcAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        peer_cloud_account: Optional[str] = None,
        peer_region: Optional[str] = None,
        peer_vpc: Optional[str] = None,
        peering_connection_id: Optional[str] = None,
        state: Optional[str] = None,
        state_info: Optional[Mapping[str, str]] = None,
        user_peer_network_cidrs: Optional[Sequence[str]] = None,
        vpc_id: Optional[str] = None) -> TransitGatewayVpcAttachment
func GetTransitGatewayVpcAttachment(ctx *Context, name string, id IDInput, state *TransitGatewayVpcAttachmentState, opts ...ResourceOption) (*TransitGatewayVpcAttachment, error)
public static TransitGatewayVpcAttachment Get(string name, Input<string> id, TransitGatewayVpcAttachmentState? state, CustomResourceOptions? opts = null)
public static TransitGatewayVpcAttachment get(String name, Output<String> id, TransitGatewayVpcAttachmentState state, CustomResourceOptions options)
resources:  _:    type: aiven:TransitGatewayVpcAttachment    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:
PeerCloudAccount Changes to this property will trigger replacement. string
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
PeerRegion Changes to this property will trigger replacement. string
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.
PeerVpc Changes to this property will trigger replacement. string
Transit gateway ID. Changing this property forces recreation of the resource.
PeeringConnectionId string
Cloud provider identifier for the peering connection if available
State string
State of the peering connection
StateInfo Dictionary<string, string>
State-specific help or error information
UserPeerNetworkCidrs List<string>
List of private IPv4 ranges to route through the peering connection
VpcId Changes to this property will trigger replacement. string
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
PeerCloudAccount Changes to this property will trigger replacement. string
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
PeerRegion Changes to this property will trigger replacement. string
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.
PeerVpc Changes to this property will trigger replacement. string
Transit gateway ID. Changing this property forces recreation of the resource.
PeeringConnectionId string
Cloud provider identifier for the peering connection if available
State string
State of the peering connection
StateInfo map[string]string
State-specific help or error information
UserPeerNetworkCidrs []string
List of private IPv4 ranges to route through the peering connection
VpcId Changes to this property will trigger replacement. string
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
peerCloudAccount Changes to this property will trigger replacement. String
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
peerRegion Changes to this property will trigger replacement. String
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.
peerVpc Changes to this property will trigger replacement. String
Transit gateway ID. Changing this property forces recreation of the resource.
peeringConnectionId String
Cloud provider identifier for the peering connection if available
state String
State of the peering connection
stateInfo Map<String,String>
State-specific help or error information
userPeerNetworkCidrs List<String>
List of private IPv4 ranges to route through the peering connection
vpcId Changes to this property will trigger replacement. String
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
peerCloudAccount Changes to this property will trigger replacement. string
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
peerRegion Changes to this property will trigger replacement. string
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.
peerVpc Changes to this property will trigger replacement. string
Transit gateway ID. Changing this property forces recreation of the resource.
peeringConnectionId string
Cloud provider identifier for the peering connection if available
state string
State of the peering connection
stateInfo {[key: string]: string}
State-specific help or error information
userPeerNetworkCidrs string[]
List of private IPv4 ranges to route through the peering connection
vpcId Changes to this property will trigger replacement. string
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
peer_cloud_account Changes to this property will trigger replacement. str
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
peer_region Changes to this property will trigger replacement. str
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.
peer_vpc Changes to this property will trigger replacement. str
Transit gateway ID. Changing this property forces recreation of the resource.
peering_connection_id str
Cloud provider identifier for the peering connection if available
state str
State of the peering connection
state_info Mapping[str, str]
State-specific help or error information
user_peer_network_cidrs Sequence[str]
List of private IPv4 ranges to route through the peering connection
vpc_id Changes to this property will trigger replacement. str
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
peerCloudAccount Changes to this property will trigger replacement. String
AWS account ID or GCP project ID of the peered VPC. Changing this property forces recreation of the resource.
peerRegion Changes to this property will trigger replacement. String
AWS region of the peered VPC (if not in the same region as Aiven VPC). This value can't be changed.
peerVpc Changes to this property will trigger replacement. String
Transit gateway ID. Changing this property forces recreation of the resource.
peeringConnectionId String
Cloud provider identifier for the peering connection if available
state String
State of the peering connection
stateInfo Map<String>
State-specific help or error information
userPeerNetworkCidrs List<String>
List of private IPv4 ranges to route through the peering connection
vpcId Changes to this property will trigger replacement. String
The VPC the peering connection belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.

Import

$ pulumi import aiven:index/transitGatewayVpcAttachment:TransitGatewayVpcAttachment attachment PROJECT/VPC_ID/PEER_CLOUD_ACCOUNT/PEER_VPC/PEER_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.