DEV Community

GargeeBhatnagar for AWS Community Builders

Posted on

Deployment of PostgreSQL RDS and its Replica through Stack

“ I have checked the various documents to automate the creation of postgresql rds and its replica. Using cloudformation it's very easy to create rds parameters. Pricing of rds based on db instance type and its storage cost.”

AWS CloudFormation is a service that helps you model and set up your AWS resources so that you can spend less time managing those resources and more time focusing on your applications that run in AWS. You create a template that describes all the AWS resources that you want (like Amazon EC2 instances or Amazon RDS DB instances).

CloudFormation takes care of provisioning and configuring those resources for you. You don't need to individually create and configure AWS resources and figure out what's dependent on what; CloudFormation handles that.

In this post, you will get to know how to do the deployment of postgresql rds and its replica through stack. Here I have used a cloudformation stack which creates the customized parameters for postgresql primary rds and read replica rds.

Architecture Overview

Image description
The architecture diagram shows the overall deployment architecture with data flow, cloudformation, rds db instance, rds db instance read replica .

Solution overview

The blog post consists of the following phases:

  1. Launch of Stack for Postgres RDS
  2. Cloudwatch Log Group for Postgresql

Phase 1: Launch of Stack for Postgres RDS

  1. Open the cloudformation console, create a stack for rds primary and read replica as template.yaml file. This creates customized configuration parameters for primary rds and its replica rds. Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description Image description

Phase 2: Cloudwatch Log Group for Postgresql

  1. Open the cloudwatch console, check the log streams for postgresql log group. Image description Image description

Clean-up

Image description
Image description

Pricing

I review the pricing and estimated cost of this example.

Cost of RDS (Service for PostgreSQL+Service for backup storage+Service for Provisioned gp2 storage) = $0.04

Cost of Cloudwatch = $0

Total Cost = $(0.04+0) = $0.04

Summary

In this post, I showed “how to do the deployment of postgresql rds and its replica through stack”.

For more details on CloudFormation, Checkout Get started CloudFormation, open the CloudFormation console. To learn more, read the CloudFormation documentation.

Thanks for reading!

Connect with me: Linkedin
Image description

Top comments (0)