Note:
When enabled, the DNS resolution feature requires that VPCs participating in the peering must have support for the DNS hostnames enabled. This can be done using the enable_dns_hostnames attribute in the aws_vpc resource. See Using DNS with Your VPC user guide for more information.
resource "aws_vpc_peering_connection" "foo" {
peer_owner_id = var.peer_owner_id
peer_vpc_id = aws_vpc.bar.id
vpc_id = aws_vpc.foo.id
peer_region = "us-east-1"
}
resource "aws_vpc" "foo" {
provider = aws.us-west-2
cidr_block = "10.1.0.0/16"
}
resource "aws_vpc" "bar" {
provider = aws.us-east-1
cidr_block = "10.2.0.0/16"
}
create-vpc-peering-connection
[--dry-run | --no-dry-run]
[--peer-owner-id <value>]
[--peer-vpc-id <value>]
[--vpc-id <value>]
[--peer-region <value>]
[--tag-specifications <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
aws ec2 create-vpc-peering-connection --vpc-id vpc-1a2b3c4d --peer-vpc-id vpc-11122233 --peer-region us-west-2
--
Categorized by Availability, Security & Compliance and Cost