]> Amazon RDS Command Line Toolkit | MC Net Media

Amazon RDS Command Line Toolkit

mcadmin's picture

RDS brings with it the promise of MySQL on a Cloud.  When you sign up for Amazon RDS the AWS Management Console shows  the EC2 dashboard.  To understand how to use AWS then download the Getting Started Guide.

There is no GUI for Amazon RDS. 

Setting up the Command Line Interface Tools

Apparently, there is no GUI yet for RDS. The only way to go about using it is through the CLI tools. Setting up the tools, however, can be quite a pain: There are no installers per se; you have to download the archive, extract it, and set up the environment manually. Here’s how I did it on my Windows XP box:

  • Prerequisites: The CLI tools are written in Java. So you need to have either JDK or JRE installed on your system to be able to run them. I had JRE 6 installed.
  • The Environment: There are a couple of environment variables that need to be set, manually:
    • The JAVA_HOME variable, containing the path of the Java runtime installed on the system.
    • The AWS_RDS_HOME variable, containing the path to the folder containing the CLI tools.
C:\>set JAVA_HOME=E:\Java\jre6
C:\>set AWS_RDS_HOME=C:\Amazon RDS\CLI
  • The Credential File: The archive containing the CLI tools also had a file named credential-file-path.template. I copied my AWS Access and Secret Keys into the place holders in the file, and then had to set yet another environment variable:
C:\>set AWS_CREDENTIAL_FILE=C:\Amazon RDS\CLI\credential-file-path.template
  • One Last Thing: Finally, I was almost done (setting up the CLI tools, that is)! All I had to do was add the path of the CLI tools to the PATH variable:
C:\>set PATH=%PATH%;C:\Amazon RDS\CLI

Creating a Database Instance

I went on to create an Extra Large database instance, with an allocated storage of 5GB:

C:\>rds-create-db-instance --engine MySQL5.1 --master-username root --master-user-password mypass
--db-name WebyogTestData --db-instance-identifier webyogtestinstance --allocated-storage 5
--db-instance-class db.m1.xlarge –-header
DBINSTANCE  DBInstanceId        Class         Engine    Storage  Master Username
Status    Backup Retention
DBINSTANCE  webyogtestinstance  db.m1.xlarge  mysql5.1  5        root
creating  1
SECGROUP  Name     Status
SECGROUP  default  active
PARAMGRP  Group Name        Apply Status
PARAMGRP  default.mysql5.1  in-sync
C:\>

The rds-decribe-db-instances command displays all the running instances:

C:\>rds-describe-db-instances
DBINSTANCE  webyogtestinstance  2009-11-06T08:40:52.571Z  db.m1.xlarge  mysql5.1
5   root  available  webyogtestinstance.clc2ed76md1v.us-east-1.rds.amazonaws.com 3306  us-east-1d  1
SECGROUP  default  active
PARAMGRP  default.mysql5.1  in-sync
C:\>

Reference and kudos to Sayan Chaliha November 06th 2009

I keep getting "The system

I keep getting "The system cannot find the path specified" when running the rds --help command. Ive setup the variables as required and checked the paths.

Any ideas?

I'm sorry you're having path

I'm sorry you're having path trouble. At least you did a few months ago. I would move into the install directories, fully qualify program calls, basically try to figure out where I mispelled something or perhaps there's a classpath issue : )