Simple PostgreSQL RDS CloudFormation Template

I’ve been working with the Amazon RDS offerings lately and used a few of the services and tools. Here’s a simple cloudformation sample to create a PostgreSQL RDS.

The template creates a security group allowing access on port 5432 to subnet 10.0.0.0/16. It also creates a database parameter group with the pg_stat_statements module as coming from an Oracle background I like to have executions stats of my sql.

Lets validate the template to make sure our json is well formed.

In this test I’ll use the aws cli to run the cloudformation template but the CloudFormation Management console is another option.

We can see how its going by describing the stack events.

After about 10 minutes we should have our database created. As this database lives in our private subnet and is not open to the world we need to test connectivity by going to a server in our public subnet and running our psql command from there.

So thats pretty much it for our simple cloudformation RDS test. There are a lot more options and parameters out there and this all can be done on the AWS free tier.

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA * Time limit is exhausted. Please reload CAPTCHA.