Amazon – Web Services – RDS – Command Line Interface – Day 1

Background

This is will be first of likely many posts on Amazon Web Services, specifically RDS.

RDS stands for Relational Data Services. And, it encompasses Oracle, Microsoft SQL Server, PostgreSQL, and MySQL and its variants ( Aurora, MariaDB )

 

Introduction

As a Database Administrator needs will arise to perform administrative tasks such as reviewing existing instances, creating new ones, taking a snapshot ( so that we can a fallback in case we mess things up), create and review security groups.

Yes, these tasks can be completed via the Web Console. But, seriously, in some cases nothing beats scripting.

And, so let us see how we can access scripting functions.

 

Web Portal

Took to the web portal https://console.aws.amazon.com/console/home.

Signin

AWS-AMAZON-COM-SIGNIN

Console

Homepage

No CLI Interface Menu

There is no interface to the CLI Console.

So how to get a CLI Console ?

 

Download

Found a nice lead-in “Installing the AWS Command Line Interfacehere.

MS Windows

MSI

As my current machine is MS Windows, chose the MSI Path.

MSIInstaller

 

Installed

Installed Downloaded application.

Custom Setup

Chose to target D:\Program Files\Amazon\AWSCLI.

CustomSetup

 

Usage

Launch Command Session

Launch command session (cmd.exe)

Change Directory

Syntax

CD /D [installed-folder]

 

Sample

CD /D D:\Program Files\Amazon\AWSCLI\awscli

 

AWS Configure

We need to provide our Access ID and Key.

And, optionally a default region.


D:\Program Files\Amazon\AWSCLI\awscli\> aws configure
AWS Access Key ID [None]:
AWS Secret Access Key [None]:
Default region name [None]:
Default output format [None]:

Skipped AWS Configure

If you try to issue commands, before first setting your credentials, you will get the error pasted below.

Output


Unable to locate credentials. You can configure credentials by running "aws configure".

Sample

Describe DB Instance

Syntax


D:\Program Files\Amazon\AWSCLI\awscli>aws rds describe-db-instances

Sample


D:\Program Files\Amazon\AWSCLI\awscli>aws rds describe-db-instances --region us-east-1

Output


A client error (AccessDenied) occurred when calling the DescribeDBInstances operation: User: arn:aws:iam:1i118717:user/daniel is not authorized to perform:
 rds:DescribeDBInstances

Explanation

  1. In our case, our account has yet to be privileged to query for DB Instances

 

Command Reference

Here is a list of RDS Commands – RDS – References

Argument Explanation
describe-certificates Lists the set of CA certificates provided by Amazon RDS for this AWS account.
describe-db-engine-versions Returns a list of the available DB engines.
describe-db-instances Returns information about provisioned RDS instances.
describe-db-log-files Returns a list of log files
describe-db-parameter-groups Returns list of DB Parameter groups
describe-db-snapshots Returns list of DB Snapshots

 

References

AWS Command Line Interface

  1. Getting Help with the AWS Command Line Interface
    http://docs.aws.amazon.com/cli/latest/userguide/getting-help.html
  2. Command Structure in the AWS Command Line Interface
    http://docs.aws.amazon.com/cli/latest/userguide/command-structure.html

 

Microsoft SQL Server on Amazon RDS

  1. AWS Documentation » Amazon Relational Database Service (RDS) » User Guide » Microsoft SQL Server on Amazon RDS
    http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html

 

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s