Book Image

Infrastructure as Code (IAC) Cookbook

By : Stephane Jourdan, Pierre Pomès
Book Image

Infrastructure as Code (IAC) Cookbook

By: Stephane Jourdan, Pierre Pomès

Overview of this book

Para 1: Infrastructure as code is transforming the way we solve infrastructural challenges. This book will show you how to make managing servers in the cloud faster, easier and more effective than ever before. With over 90 practical recipes for success, make the very most out of IAC.
Table of Contents (18 chapters)
Infrastructure as Code (IAC) Cookbook
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

Creating a PostgreSQL RDS database with Terraform


Amazon Relational Database Service (RDS) is an on-demand, ready-to-use, and resizable EC2 instance specifically tailored and configured to run the requested database server. You can launch many different relational database servers on RDS, and we'll focus on PostgreSQL for this recipe.

Getting ready

To step through this recipe, you will need the following:

  • A working Terraform installation

  • An AWS provider configured in Terraform (refer to the previous recipes)

  • An Internet connection

How to do it…

There are many parameters at play in a database deployment, even a simple one. To be certain of what we'll deploy, we'll start by filling a simple table with the database requirements, and build on it:

Parameter

Variable name

Value

RDS Database Engine

rds_engine

postgresql

RDS Database Engine Version

rds_engine_version

9.5.2

RDS Instance Name

rds_identifier

db

RDS Instance Type

rds_instance_type

db.t2.micro

RDS Storage Size...