Create a MariaDB Database with AWS RDS
Discover how to create a MariaDB database on AWS RDS by configuring database subnet groups, security groups with proper ingress rules, and launching the database instance using AWS CLI commands. This lesson helps you migrate and manage WordPress databases for better scalability and reliability on AWS.
Now that the permissions are sorted, let’s create the MariaDB RDS instance.
We’re using RDS instead of Amazon Aurora because RDS offers a MariaDB-compatible database, and RDS is included in the free tier, while Amazon Aurora is not. If it wasn’t for those two considerations, Amazon Aurora would be a great choice as well. Let’s go over the steps to perform to get our MariaDB RDS instance running:
- Create a database subnet group that includes our
subnet-private-aandsubnet-private-b. - Create a security group to grant all our instances in our private VPC access to the database.
- Create the MariaDB RDS instance.
Step 1: Create a database subnet group
RDS databases behave slightly differently compared to EC2 instances. Instead of being launched into a specific subnet, RDS databases use either of the subnet in the database subnet group. If we’re creating a Multi-AZ deployment, it uses at least two different subnets to be present in two different availability zones.
For now, we will create a Single-AZ RDS database, but the same logic regarding database subnet groups applies—we need to specify at least two subnets for the database subnet group, and the RDS database picks a subnet out of the database subnet group to be launched in.
To create a database subnet group, we can use the rds create-db-subnet-group CLI command. Because we’re dealing with RDS databases, the CLI command is now rds instead of ec2. The subcommand is create-db-subnet-group.
The ...