AWS, Terraform and Chef: Part 1 - R&D Solutions

AWS, Terraform and Chef: Part 1

terraform_chef_part_1

The current blog series will walk you through working with AWS, Terraform and Chef.
In this part in particular we are going to focus on project structure and prerequisites so we can start building our solution.
It is assumed that the reader already have some knowledge in AWS resources.

At the end of this tutorial you will have a VPC with resources being automatically created and launched. At launch EC2 instances will connect with Chef server and will get auto confugured.

 

Goals

  • Create and launch AWS resources in desired configuration using Terraform within AWS context
  • Use Chef to auto-configure instances.

 

Structure

  • VPC
  • Two public subnets in two availability zones(one for each availability zone)
  • Two private subnets in same two availability zones(one for each availability zone)
  • Internet gateway
  • Load Balancer
  • Routing Table
  • EC2 Instances provided by
  • AutoScaling Groups
  • NAT Gateway (placed in the main public subnet)
  • Two SQL Databases (one for each availability zone, master and slave, master in the same availability zone as the NAT gateway and the main public and private subnets)
  • Elastic IP (for the NAT gateway)
  • Three security groups
    • Main private subnet
    • Secondary private subnet
    • Load Balancer

 

Prerequisites

  • AWS account (access key and secret key for the account)
  • Terraform installation (https://www.terraform.io/downloads.html)
  • KeyValuePair from EC2 tab. Name is up to you. Keep it safe. This key will be used to log on to the instances. Sensitive content.

NOTE: Complete VPC structure is not eligible for free tier. Elastic IP and Load balancer are not free.

NOTE: For the purpose of this tutorial we will move the EC2 instances plus Autoscaling groups into public networks (not in private as shown above)

Talk to us now

Contact us