Skip to content

Latest commit

 

History

History
73 lines (59 loc) · 3.9 KB

README.md

File metadata and controls

73 lines (59 loc) · 3.9 KB

AWS VPC Peering Module

This module creates VPC Peering connection between two VPCs and connects VPCs to peer's Route 53 hosted zones if provided.

Example

# 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
  }
}

Requirements

Name Version
terraform < 2.0.0, >= 1.6.6
aws < 6.0, >= 5.22

Inputs

Name Description Type Default Required
requester_vpc VPC Details of the Requester
object({
id = string
name = string
account_id = string
region = string
cidr = string
route_table_ids = list(string)
vpc_domain_zone_ids = optional(list(string), [])
})
n/a yes
accepter_vpc VPC Details of the Accepter
object({
id = string
name = string
account_id = string
region = string
cidr = string
route_table_ids = list(string)
vpc_domain_zone_ids = optional(list(string), [])
})
n/a yes

Outputs

Name Description
id VPC Peering ID

Resources

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