A DB Subnet Group in Amazon DocumentDB is a collection of subnets within a VPC, used to define which subnets the DocumentDB cluster can be deployed in. Each DB Subnet Group must contain at least two subnets in different Availability Zones (AZs) to ensure high availability and redundancy.
Supports Deployment in a VPC: A DB Subnet Group allows you to specify a VPC and designated subnets for deploying an Amazon DocumentDB cluster, improving network control and security.
Ensures High Availability & Redundancy: Amazon DocumentDB requires at least two subnets across different Availability Zones (AZs) to provide fault tolerance. If one AZ fails, the cluster can continue operating in the remaining AZ.
Automatic Failover Handling: If the primary instance fails, DocumentDB can automatically promote a replica instance in another subnet as the new primary. A new replica is then created in the previous subnet to maintain the required number of nodes.
Follow these steps to create a DB Subnet Group on AWS:
Go to the AWS Management Console.
Search for and select the Amazon DocumentDB service.
In the navigation menu, select Subnet groups.

In Subnet groups, click Create.
In the Create DB Subnet Group page:
nextjs-db-subnet-group.nextjs-db-subnet-group.
Click Create to complete the DB Subnet Group setup.
