Terraform - DSGT-DLP/Deep-Learning-Playground GitHub Wiki

Terraform

Terraform is a framework developed by Hashicorp that helps to programmatically define your cloud infrastructure. Terraform is flexible for Google Cloud Platform, AWS, Azure, and other major cloud providers.

Why even use Terraform?

To make DLP scalable, we take advantage of the cloud since we pay for what we use, no need to guess capacity, and we don't have to reinvent the wheel. We use AWS due to the various options provided and that it has good community support.

We have two ways of configuring our AWS resources:

  1. Go in the AWS Management Console and configure the resources through the website
  2. Programmatically define our resources

At first glance, it seems that option 1 is the most straightforward, but it comes with a risk. Say that something went wrong with your AWS service and you had to fix it. It would be a pain to go ahead and make those changes within the console (unless you know what you're doing :)). Also, linking AWS services together isn't necessarily the most straightforward within the AWS Management Console. With Option 2, while we have to "write more code", at least we have defined our AWS resource configurations and if something were to go wrong with our cloud services or we wanted to do a migration in the future, we can simply update the configurations in the code and run a simple deploy command (and leave the annoying stuff in AWS Management Console to AWS). This is the premise behind a paradigm called Infrastructure as Code. Terraform simply acts as a vehicle to help realize Option 2.

Where to find Terraform code example

See /dlp-terraform directory. Helpful Resource: This fantastic documentation!

How to get setup on Terraform

  1. Follow the installation instructions from Hashicorp here
  2. Configure the AWS credentials for Terraform to use. Follow instructions in the README to install AWS CLI
  3. cd ~/Deep-Learning-Playground
  4. cd dlp-terraform
  5. terraform init - this starts terraform and loads up the cache
  6. You're ready to go!

Who to contact about Terraform related inquiries

@thomaschin35, @farisdurrani, @karkir0003 and of course [email protected]