Skip to main content

Module: vpc-peering

Terraform module to create a peering connection between two VPCs

Screenshots

vpc-peering VPC Peering Connection in the AWS Web Console

Usage

For a complete example, see examples/complete.

For automated tests of the complete example using bats and Terratest (which tests and deploys the example on AWS), see test.

Using VPC IDs

module "vpc_peering" {
source = "cloudposse/vpc-peering/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
namespace = "eg"
stage = "dev"
name = "cluster"
requestor_vpc_id = "vpc-XXXXXXXX"
acceptor_vpc_id = "vpc-YYYYYYYY"
}

Using VPC tags

module "vpc_peering" {
source = "cloudposse/vpc-peering/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
namespace = "eg"
stage = "dev"
name = "cluster"
requestor_vpc_tags = {
"kubernetes.io/cluster/my-k8s" = "owned"
}
acceptor_vpc_tags = {
Name = "legacy-vpc"
}
}