Networks and VPC peering
Create the network your databases run in, and peer it with a VPC in your AWS account.
A network is a cloud, a region, and a Classless Inter-Domain Routing (CIDR) block that your databases run in. All the projects in your account share it. To reach your databases from a virtual private cloud (VPC) in your Amazon Web Services (AWS) account, peer the network with that VPC.
Your account can have up to two networks during the preview.
Create a network
The console creates a network for you the first time you create a database. To create one yourself:
- In the Ultra console, select Networking, then select Create network.
- Select a Cloud vendor and Region.
- Under Allowed availability zones, keep No preference, or select Manual selection and select the Zone IDs.
- Optional: enter a Network name. Use up to 64 letters, digits, spaces, hyphens, or underscores, starting and ending with a letter or digit.
- Optional: enter a Deployment CIDR. Leave it empty to have one assigned.
- Select Create network.
A network with an assigned CIDR block is usually ready in seconds. A custom CIDR block takes 10 to 20 minutes to set up.
Deployment CIDR rules
A custom Deployment CIDR must be:
- A /18 block, such as
10.0.0.0/18. When you create the network from the database create page, enter the address only: the console adds/18. - In a private IPv4 range.
- Aligned to its first address, such as
10.0.0.0.
You can't change the CIDR block after the network is created. Choose one that doesn't overlap the VPCs you plan to peer with. The CIDR column on the Networking page shows the block a network uses.
Set up VPC peering
VPC peering connects the network to a VPC in your AWS account, so your applications can reach your databases' private endpoints. You can add VPC peering when the network's status is Active.
Before you begin, make sure your VPC has the enableDnsHostnames and enableDnsSupport attributes turned on, and that its CIDR block doesn't overlap the network's.
-
Select Networking, then select the network.
-
Select the Attachments tab, then select Add VPC peering.
-
Enter your 12-digit AWS account ID.
-
Enter the VPC ID, such as
vpc-0123456789abcdef0. -
If the console shows VPC region, select your VPC's region.
-
Enter the VPC CIDR: an IPv4 block from /16 to /28.
-
Select Add peering.
-
In your AWS account, accept the VPC peering request from Redis. The attachment shows Provisioning until you accept it and Active once the peering is up. If you reject the request or let it expire, the attachment fails.
-
In your VPC's route tables, add a route to the network's CIDR block through the peering connection.
-
Associate the database's private hosted zone with your VPC. Copy the Private DNS hosted-zone ID from the database's Connectivity tab, then run:
aws route53 associate-vpc-with-hosted-zone \ --hosted-zone-id <hosted-zone-id> \ --vpc VPCRegion=<your-vpc-region>,VPCId=<your-vpc-id>Until you associate the zone, the private endpoint's name doesn't resolve from your VPC.
You can also set up VPC peering from the database's page: select Set up VPC peering in the database header. The console offers it when the database's AWS network has no VPC peering yet, and opens it for you after you create a database.
Remove VPC peering
- On the network's Attachments tab, open the menu on the peering's row and select Remove.
- Select Remove to confirm. Applications that use the peering lose access to the network's databases.
You can't remove VPC peering while the network has databases. Delete the databases first.
Rename or delete a network
To rename a network, select Rename from its menu on the Networking page.
To delete a network, select Delete from its menu. You can't delete a network that still has databases. Delete them first.