Skip to main content

Get hostname from Amazon RDS instance name

Project description

A simple command line utility, allowing you to find the hostname associated with your Amazon RDS instance name.

Also has a simple wrapper for PostgreSQL’s psql utility. If you want a similar script for MySQL or Oracle, patches are welcome.

A few examples:

# w/o arg: prints all active instances
% rds-host
mydbinstance    mydbinstance.c6ulnjwxjm.us-west-2.rds.amazonaws.com:5432
myotherdbinstance  myotherdbinstance.d5ulnswdjyf.us-west-2.rds.amazonaws.com:5432

# w/ arg: prints host name of matching instance
% rds-host mydbinstance
mydbinstance.c6ulnjwxjm.us-west-2.rds.amazonaws.com:5432

# connect to the instance with psql
% rds-psql mydbinstance -U mydbuser mydbname
Connecting to mydbinstance.c6ulnjwxjm.us-west-2.rds.amazonaws.com...
Password for user mydbuser:
psql (9.0.5, server 9.3.1)
WARNING: psql version 9.0, server version 9.3.
Some psql features might not work.
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.

mydbname=>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rds-host-0.1.2.tar.gz (3.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page