VpcPeeringConnectionArgs

data class VpcPeeringConnectionArgs(val accepter: Output<VpcPeeringConnectionAccepterArgs>? = null, val autoAccept: Output<Boolean>? = null, val peerOwnerId: Output<String>? = null, val peerRegion: Output<String>? = null, val peerVpcId: Output<String>? = null, val requester: Output<VpcPeeringConnectionRequesterArgs>? = null, val tags: Output<Map<String, String>>? = null, val vpcId: Output<String>? = null) : ConvertibleToJava<VpcPeeringConnectionArgs>

Provides a resource to manage a VPC peering connection.

NOTE on VPC Peering Connections and VPC Peering Connection Options: This provider provides both a standalone VPC Peering Connection Options and a VPC Peering Connection resource with accepter and requester attributes. Do not manage options for the same VPC peering connection in both a VPC Peering Connection resource and a VPC Peering Connection Options resource. Doing so will cause a conflict of options and will overwrite the options. Using a VPC Peering Connection Options resource decouples management of the connection options from management of the VPC Peering Connection and allows options to be set correctly in cross-account scenarios. Note: For cross-account (requester's AWS account differs from the accepter's AWS account) or inter-region VPC Peering Connections use the aws.ec2.VpcPeeringConnection resource to manage the requester's side of the connection and use the aws.ec2.VpcPeeringConnectionAccepter resource to manage the accepter's side of the connection. Note: Creating multiple aws.ec2.VpcPeeringConnection resources with the same peer_vpc_id and vpc_id will not produce an error. Instead, AWS will return the connection id that already exists, resulting in multiple aws.ec2.VpcPeeringConnection resources with the same id.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.VpcPeeringConnection;
import com.pulumi.aws.ec2.VpcPeeringConnectionArgs;
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 foo = new VpcPeeringConnection("foo", VpcPeeringConnectionArgs.builder()
.peerOwnerId(var_.peer_owner_id())
.peerVpcId(aws_vpc.bar().id())
.vpcId(aws_vpc.foo().id())
.build());
}
}

Notes

If both VPCs are not in the same AWS account and region do not enable the auto_accept attribute. The accepter can manage its side of the connection using the aws.ec2.VpcPeeringConnectionAccepter resource or accept the connection manually using the AWS Management Console, AWS CLI, through SDKs, etc.

Import

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

$ pulumi import aws:ec2/vpcPeeringConnection:VpcPeeringConnection test_connection pcx-111aaa111

Constructors

Link copied to clipboard
constructor(accepter: Output<VpcPeeringConnectionAccepterArgs>? = null, autoAccept: Output<Boolean>? = null, peerOwnerId: Output<String>? = null, peerRegion: Output<String>? = null, peerVpcId: Output<String>? = null, requester: Output<VpcPeeringConnectionRequesterArgs>? = null, tags: Output<Map<String, String>>? = null, vpcId: Output<String>? = null)

Properties

Link copied to clipboard

An optional configuration block that allows for VPC Peering Connection options to be set for the VPC that accepts the peering connection (a maximum of one).

Link copied to clipboard
val autoAccept: Output<Boolean>? = null

Accept the peering (both VPCs need to be in the same AWS account and region).

Link copied to clipboard
val peerOwnerId: Output<String>? = null

The AWS account ID of the owner of the peer VPC. Defaults to the account ID the AWS provider is currently connected to.

Link copied to clipboard
val peerRegion: Output<String>? = null

The region of the accepter VPC of the VPC Peering Connection. auto_accept must be false, and use the aws.ec2.VpcPeeringConnectionAccepter to manage the accepter side.

Link copied to clipboard
val peerVpcId: Output<String>? = null

The ID of the VPC with which you are creating the VPC Peering Connection.

Link copied to clipboard

A optional configuration block that allows for VPC Peering Connection options to be set for the VPC that requests the peering connection (a maximum of one).

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val vpcId: Output<String>? = null

The ID of the requester VPC.

Functions

Link copied to clipboard
open override fun toJava(): VpcPeeringConnectionArgs