This module creates VPC Peering connection between two VPCs and connects VPCs to peer's Route 53 hosted zones if provided.
# main.tf
module "vpc_peering" {
source = "git::https://github.com/lpavliuk/Terraform-Modules.git//aws_vpc_peering"
providers = {
aws.requester = aws
aws.accepter = aws.accepter
}
requester_vpc = {
id = local.requester_vpc_id
name = local.requester_vpc_name
account_id = local.requester_vpc_account_id
region = local.requester_vpc_region
cidr = local.requester_vpc_cidr
route_table_ids = local.requester_subnet_groups_route_table_ids
vpc_domain_zone_ids = local.requester_vpc_domain_zone_ids
}
accepter_vpc = {
id = local.accepter_vpc_id
name = local.accepter_vpc_name
account_id = local.accepter_vpc_account_id
region = local.accepter_vpc_region
cidr = local.accepter_vpc_cidr
route_table_ids = local.accepter_subnet_groups_route_table_ids
vpc_domain_zone_ids = local.accepter_vpc_domain_zone_ids
}
}
Name | Version |
---|---|
terraform | < 2.0.0, >= 1.6.6 |
aws | < 6.0, >= 5.22 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
requester_vpc | VPC Details of the Requester | object({ |
n/a | yes |
accepter_vpc | VPC Details of the Accepter | object({ |
n/a | yes |
Name | Description |
---|---|
id | VPC Peering ID |
Name | Type |
---|---|
aws_route.accepter_vpc_route | resource |
aws_route.requester_vpc_route | resource |
aws_route53_vpc_association_authorization.accepter_auth | resource |
aws_route53_vpc_association_authorization.requester_auth | resource |
aws_route53_zone_association.accepter_connect | resource |
aws_route53_zone_association.requester_connect | resource |
aws_vpc_peering_connection.this | resource |
aws_vpc_peering_connection_accepter.this | resource |