Connecting 2 VPC networks
2 VPCs will have different fuctions, one as a requestor and one as an acceptor.
Establish the VPC peering connection from the acceptor VPC and add route table entries in both VPCs.
10.1.0.0/16
, Target = Peering Connection, save changesRequired commands
Note that all lines with $
is a single line command, spaced for legibility
$ aws ec2 create-vpc-peering-connection
--vpc-id VPC_ID_OF_YOUR_VPC_REQUESTOR
--peer-vpc-id VPC_ID_OF_YOUR_VPC_ACCEPTOR
--region YOUR_REGION
Naviagte to the VPC dashboard and
copy the peering connection ID for "Pending acceptance"
OR copy the peering connection ID from the response JSON
$ aws ec2 accept-vpc-peering-connection
--vpc-peering-connection-id COPIED_ID_FROM_ABOVE
--region YOUR_REGION
$ aws ec2 create-route
--route-table-id ROUTE_TABLE_ID_FOR_VPC_REQUESTOR_PRIVATE
--destination-cidr-block YOUR_CIDR (10.1.0.0/16 for this example)
--vpc-peering-connection-id PEERING_CONNECTION_ID_COPIED_ABOVE
$ aws ec2 create-route
--route-table-id ROUTE_TABLE_ID_FOR_VPC_ACCEPTOR_PRIVATE
--destination-cidr-block YOUR_CIDR (10.0.0.0/16 for this example)
--vpc-peering-connection-id PEERING_CONNECTION_ID_COPIED_ABOVE
Status
change.Stand-alone region scoped resource that can be connected to other networks
Transit Gateway
Global scoped TCP and UDP port that is dedicated to DNS
Contrary to traditional DNS, Route 53 offers
Weighted Routing: modify the amount of traffic reacing each endpoints, set weight to zero for maintainance
Latency-based Routing: depending on the region of request, DNS response is determined by lowest latency from client
Failover Routing: set primary and secondary DNS, and if there's an issue with primary, pass to secondary
Geolocation Routing: determined by physical location of client, more static than latency routing
Alias Records: Point a DNS name to an AWS service
Endpoint
for monitoringlatency graphs
This requires endpoints
Connect to aws CLI and create a script file
create_eips.sh
REGION1=$1
REGION2=$2
aws ec2 allocate-address --domain vpc
--tag-specifications 'ResourceType=elastic-ip, Tags=[{Key=route53demo, Value=true}]'
--region $REGION1 --output text --query [PublicIp, NetworkBorderGroup]
aws ec2 allocate-address --domain vpc
--tag-specifications 'ResourceType=elastic-ip, Tags=[{Key=route53demo, Value=true}]'
--region $REGION2 --output text --query [PublicIp, NetworkBorderGroup]
Run the script
$ bash ./create_eips.sh YOUR_REGION1 YOUR_REGION2
Value
will become your primary IPThis summary is made possible by Oreilly's AWS, 3rd Edition - Chad Smith.
If the above post violates any copyright permissions, please let me know!