Skip to main content

Create and Configure an Aurora MySQL Database Cluster

Hands-On Lab

 

Photo of Julie  Elkins

Julie Elkins

AWS Training Architect I in Content

Length

00:45:00

Difficulty

Beginner

In this hands-on lab, we will create an Aurora MySQL database cluster. First, we will verify that the security groups and network ACLs (NACLs)s are all configured correctly, then create a new security group, and finally create an Aurora MySQL database in a private subnet.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Create and Configure an Aurora MySQL Database Cluster

Introduction

In this hands-on lab, we will create an Aurora MySQL database cluster. First, we will verify that the security groups and network ACLs (NACLs)s are all configured correctly, then create a new security group, and finally create an Aurora MySQL database in a private subnet.

The Scenario

Our company is considering using an Aurora MySQL database for our production workload. We have been tasked with creating and configuring an Aurora MySQL database for the development team. They will then test to see if Aurora would be the perfect fit for our production workload.

Logging In

Log in to the live AWS environment using the credentials provided, and let's make sure we are in the us-east-1 region.

Verify the Security Groups and NACLs

Navigate to the VPC Dashboard, then get into Subnets. Click on one of the private ones, then look at the Route Table tab in the lower part of the screen. We want to make sure that the Target is local. Check the Network ACL tab, and confirm that the inbound and outbound rules are both allowing ALL TCP traffic on ports 0-65535.

Check the other private subnet to make sure those settings are the same.

Create an Aurora MySQL Database Security Group

Navigate to Security Groups in the left-hand menu, click Create security group, and set the following values:

  • Security group name: DatabaseSG
  • Description: DatabaseSG
  • VPC: Choose ours from the dropdown

Click Create once those are set.

Check the box next to that security group on the next screen, then go down to the Inbound Rules tab. Click the Edit rules button, then *Add Rule** on the next page to actually add one. In the web form that shows up, set these values:

  • Type: MYSQL/Aurora
  • Protocol and Port Range are populated automatically (with TCP and 3306)
  • Source: Custom
    • In the next text input box, start typing sg and we'll see the security group we just created pop up that we can select.
  • Description: We can leave this blank

Click Save rules, and now we can go to the Outbound Rules tab. All traffic is allowed, on all protocols, on any port, and to any destination. This is fine.

Allow SSH Traffic on the Default Security Group

Back out on the main Security Groups page, click the box next to the default one, and get into the Inbound Rules tab. Click the Edit rules button, then we're going to change the one that's there already. Set these values:

  • Type: SSH
  • Protocol and Port Range are populated automatically (with TCP and 22)
  • Source: Anywhere
  • Description: We can leave this blank

Click Save rules.

Create an Aurora MySQL Database Cluster

Navigate to the RDS Dashboard, and click Create database. Scroll down to make sure we've got Amazon Aurora selected in the Engine options. And we want the Edition to be Amazon Aurora with MySQL compatibility. We can skip a bit, leaving defaults, until we get to Templates. Set it to Dev/Test. Scroll a bit farther to set and confirm a Master password. Set the DB instance size to Burstable classes, and set the dropdown below it to db.t2.small.

Scroll down and click on Additional connectivity configuration. In the Publicly accessible section, we want to select No. In the VPC security group section, set it to Choose existing and select the DatabaseSG one that we created a little while ago.

There is an Additionial configuration link. Click that and set the Initial database name to auroramysql. It's a good idea in general to check the Enable Backtrack box, but for this situation we don't need to. Another good idea is to leave Enable Enhanced monitoring checked, but it will take longer for the database to spin up, so we're going to uncheck it here. Deletion protection is another box we'd normally want to check, but we'll leave it alone for now.

Those are all the settings we have to worry about, so let's click Create database.

Conclusion

That will take a little while to spin up, but we've gotten it done at this point. We've got a new Aurora MySQL database for the development team to play with. Congratulations!