Learn how to create and configure an RDS instance in AWS, including high-availability, backup, and security features.
- [Instructor] Let's create a MySQL database using RDS. But before we do that, I first want to visit the EC2 section of the console, so we can create a security group that will allow us to connect to the database on the appropriate ports. Let's head into EC2. Along the side under Network & Security, you can see Security Groups. We'll go create a new security group. This security group name will be MySQLAccessFromWorld. Now, under normal circumstances, you would not want to do this.
I'm only allowing world access for purposes of this demo. In a real production setting, you would absolutely want to lock this down to only the ranges that should be allowed in. For now, I'm going to add a rule. Choose the predefined MYSQL/Aurora setting, which is port 3306, and allow it from anywhere. And then create. Now that that exists, I'll go back to the console home and then into RDS by typing RDS. This is our first relational database here in RDS, so we get the welcome screen and the blue Get Started Now button.
Let's click it. We're going to choose MySQL. We'll choose Community Edition. You can see how much Amazon is pushing Aurora because not only does Aurora get a tab dedicated to it, but it also appears under MySQL, with which it is compatible. For now, we'll select MySQL Community Edition and go ahead. We have the option here to choose a production deployment or a dev/test one. We'll choose the latter since we're not worried about performance. Click Next Step. On this screen, we have a few options that we need to select. The DB Engine version is already prefilled at the latest version of MySQL.
The DB Instance Class is going to be the sizing for this database instance. Db.t2.micro is the cheapest option. However, if we want to encrypt this database, we need to go to at least db.t2.small, which is the minimum required size for encryption. We can choose Multi-AZ deployment here. If we do, this database will be synchronously replicated to another availability zone. If we select No, it does allow us to use the stop option on the RDS instance. Let's choose Yes for Multi-AZ Deployment.
We can choose a general purpose storage type or Provisioned IOPS. If we choose Provisioned IOPS, we'll get another input here, where we can input the number of IOPS that we desire. For our purposes, we'll go back to General Purpose (SSD). At this point, we need to enter an identifier that RDS will use to refer to this database instance. We'll call it mysql-rds-demo. We'll giver a master username. And this can't use hyphens, so we'll call it mysql_rds_user. And a password. Click Next Step to move on.
We'll deploy into the default VPC and subnet. And we'll make this database publicly accessible, which, again, is not something that you would normally want to do in production. The security group we'll choose will be the MySQLAccessFromWorld that we created earlier. The next step is the database name. Don't confuse this with the database identifier, which RDS uses to refer to the entire instance. This will be the name of the database that RDS creates for us inside this MySQL instance. We'll call it mysql_rds_demo to match the instance identifier.
We can stick with the default DB parameter groups. Although that's something that we'll look at later to see how you can change configuration of the database. We are enabling encryption, which we can only do because we chose a db.t2.small instead of a micro. And we use the default aws/rds master key. Here, you see the backup options. As I mentioned, the default backup retention period is seven days. But we can extend this out as far as 35. If we Select Window under Backup Window, we can say exactly when we want these backups to occur.
They're going to happen every day. These defaults here specify that the backup will occur at midnight. I could change that to 1:00 a.m. We won't do enhanced monitoring for this database instance. But we would like to set preference on the window for the minor version upgrade. Let's say it's going to happen on Sundays at midnight. That's it. Let's launch DB instance. Now that this instance is being created, we can look at how we can connect to it using MySQL Workbench.
Join AWS architect Brandon Rich and learn how to configure object storage solutions and lifecycle management in Simple Storage Service (S3), a web service offered by AWS, and migrate, back up, and replicate relational data in RDS. Find out how to leverage flexible network storage with Elastic File System (EFS), and use the new AWS Glue service to move and transform data. Plus, learn how Snowball can help you transfer truckloads of data in and out of the cloud.
- What is data management?
- AWS S3 basics
- S3 bucket creation
- S3 upload and logging
- S3 event notifications
- S3 data lifecycle configuration
- Working with Amazon Elastic Block Store volumes
- Creating and mounting an EFS
- Creating an AWS RDS instance
- RDS backup and recovery
- Moving data with AWS Database Migration Service
- Moving data with Data Pipeline and Glue