Amazon - RDS

Monitoring disk space usage:

Read the articles on how to design for High Availability

What are the high level steps for getting started with RDS?

  1. Sign up for RDS
  2. Authorize access
  3. Launch DB Instance
  4. Connect to DB Instance

How can we sign up for RDS??

Go to and click Sign Up for Amazon RDS. Follow the on-screen instructions.

How can we create DB Security Group?

Your first task is to set up a DB Security Group that controls what IP addresses or EC2 instances have access to your DB Instance. You will use this security group when you create a DB Instance. Once created, you can reuse this security group or create new security groups for specific DB Instances.

To create a DB Security group for this example, you enter CIDR (Classless Inter-Domain Routing) notation to specify either a single IP address or a range of IP addresses that you will allow to connect to your DB Instance. Since these IP addresses will be allowed access, it is important that you grant access to the correct IP addresses.

  1. In the left column of the AWS Management Console, click DB Security Groups.
  2. In the My DB Security Groups page, click the Create DB Security Group button.
  3. In the Create DB Security Group dialog box, type the name of the security group and a brief description. Click Yes, Create to close the dialog box and show the My DB Security Groups page of the AWS Management Console.
  4. On the My DB Security Groups page, the DB Security Group you created is selected. On the Description tab at the bottom of the window, select CIDR/IP from the Connection Type drop-down list. Type your CIDR range into the CIDR text box, and click the Add button. The IP address you enter should be the public-facing address or range of addresses of the computers that will be accessing the DB Instance. If you are behind a firewall, the IP addresses could be a limited set of addresses that the firewall exposes. To help you determine your current IP address, the CIDR range for your current IP address appears on the page just below the CIDR text box. Due to how firewalls work, this value may not be the publically visible IP address you need to provide in the CIDR textbox. For information about the IP addresses you should include in the security group, consult with your network administrator.

How can we launch DB instances via the management console??

  1. Sign in to the AWS Management Console and open the Amazon RDS console at
  2. In the left column of the AWS Console, select the region in which you want to create the DB Instance. This should be the same region as the region in which you created your DB Security Group in the previous step.
  3. Click Launch DB Instance to start the Launch DB Instance Wizard. The wizard opens on the Engine Selection page.
  4. Click the Select button for the DB Engine that you want to use.
  5. Once you have selected MySQL as your DB Engine, the wizard displays the DB Instance Details page for MySQL. The most important parameters you set here are for the DB Instance Class in the DB Instance Class drop-down list and the Allocated Storage text box. The DB Instance class defines the CPU and memory capacity of your DB Instance, which can impact processing speed and responsiveness. The allocated storage value determines how much storage is allocated for this DB Instance. Note that these two values are used to calculate the cost of your DB Instance.
  6. On the DB Instance Details page, specify your DB Instance information (License Model, DB Engine Version, DB Instance Class, Multi-AZ Deployment, Auto Minor Version Upgrade, Allocated Storage, Use Provisioned IOPS, DB Instance Identifier, Master User Name, Master User Password). See
  7. On the Additional Configuration page, you provide additional information that RDS needs to launch the DB Instance for MySQL. Specify your DB Instance information as shown in the following table, then click Continue.
  8. On the Management Options page, you can specify backup and maintenance options for your DB Instance. Note that setting the Backup Retention Period to zero disables automatic backups.
  9. On the Review page, review the options for your DB Instance. If you need to correct any options, click Back to return to previous pages and make corrections. You can also modify a DB Instance from the AWS Console after you have launched a DB Instance. If all your options are entered correctly, click the Launch DB Instance button to launch your new DB Instance.
  10. On the dialog box that indicates that your DB Instance is being created, click the Close button.
  11. On the AWS Management Console, the new DB Instance appears in the list of DB Instances. The DB Instance will have a status of creating until the DB Instance is created and ready for use. Depending on the DB Instance class and store allocated, it could take several minutes for the new instance to be created. Once your DB instance changes to the available state, you can connect to it.

How can we connect to our DB instance?

After the instance is launched and the status is available, on the My DB Instances page of the AWS management Console, select the check box next to the DB Instance. The screen will display the end-point for our DB instance (this is the public host name / IP address for our DB instance). We can connect to our DB instance using any existing software.

mysql -h -P 3306 -u mymasteruser -p

How can we terminate our DB instance?

  1. In the AWS Management Console, locate the DB Instance in your list of DB Instances on the My DB Instances page.
  2. Select the check box next to the DB Instance, and then click Delete button at the top of the My DB Instances page.
  3. Select Yes / No in the Create final snapshot? drop-down list.
  4. Click the OK button.

How can we setup the Amazon RDS command line tool?

Make sure that you have the right version of Java, and configure the JAVA_HOME environment variable. Amazon RDS command line tool requires Java version 5 or greater (either JRE or JDK will do). We must set the JAVA_HOME environment variable.

Download the command line tool. The command line tools are available as a ZIP file on the Amazon RDS web site. These tools are written in Java, and include shell scripts for Windows 2000/XP/Vista, Linux/UNIX, and Mac OSX. The ZIP file is self-contained and no installation is required; simply download the zip file and unzip it to a directory on your local machine.

Set the AWS_RDS_HOME environment variable. The command line tools depend on an environment variable (AWS_RDS_HOME) to locate supporting libraries. You need to set this environment variable before you can use the tools. Set it to the path of the directory you unzipped the command line tools into. This directory is named RDSCli-A.B.nnnn (A, B and n are version/release numbers), and contains sub-directories named bin and lib.

export AWS_RDS_HOME=<path-to-tools>

Add the tool's bin directory to your system path. To make the tools easier to use, we recommend you add the tools' BIN directory to your system PATH. The rest of this guide assumes the BIN directory is in your system path.


Paths that contain a space must be wrapped in double quotes, for example: "C:\Program Files\Java"

Override the default region. By default, Amazon RDS uses the us-east-1 region when you create DB Instances and other Amazon RDS objects. To temporarily specify a different region when entering an Amazon RDS command, you can use the —url or —region common command line options. For more information about common command line options, see the Amazon RDS Command Line Reference. To avoid having to pass the URL or region with each command, you can set the EC2_REGION environment variable to the appropriate region for your use.

export EC2_REGION=us-west-1

Provide credential for the tool. The command line tools need the AWS Access Key and Secret Access Key provided with your AWS account. You can get them using the command line or from a credential file located on your local system. The deployment includes a template file ${AWS_RDS_HOME}/credential-file-path.template that you need to edit with your information. Following are the contents of the template file:

AWSAccessKeyId=<Write your AWS access ID>
AWSSecretKey=<Write your AWS secret key>

On UNIX, limit permissions to the owner of the credential file:

chmod 600 <the file created above>

With the credentials file setup, you'll need to set the AWS_CREDENTIAL_FILE environment variable so that the Amazon RDS tools can find your information:

export AWS_CREDENTIAL_FILE=<the file created above>

Now, check to see if the tool work:

rds --help

Can we use Availability Zones with RDS?

Yes. Using a second availability zone is very similar to having a back-up data center because each availability zone is entirely separated from the other zones in the same region to ensure maximum availability of the region. AWS customers using RDS can take advantage of the Multi-AZ functionality which automatically deploy a hot standby slave instance in a different availability zone.

Can we run traditional databases on EC2?

Yes. If you are not using RDS (you run database directly on EC2), it is recommended that you use Amazon Elastic Block Storage (EBS) volumes, which is akin to network attached storage. For EC2 instances running a database, all database data and logs should be placed on EBS volumes, which will remain available even if the database host fails. This allows for a simple failover scenario where a new EC2 instance can be launched in the case of a host failure and the existing EBS volumes can simply be attached to the new instance to allow the database to pick up where it left off. Amazon EBS volumes automatically provide redundancy within the availability zone, which increases their availability over simple disks. If the performance of a single EBS volume is not sufficient for your database needs, then volumes can be stripped to increase IOPS performance for your database.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License