Presented By: Nitin Mishra
Terratest with Terraform
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Respect Knolx session timings, you
are requested not to join sessions
after a 5 minutes threshold post
the session start time.
Feedback
Make sure to submit a constructive
feedback for all sessions as it is
very helpful for the presenter.
Silent Mode
Keep your mobile devices in silent
mode, feel free to move out of
session in case you need to attend
an urgent call.
Avoid Disturbance
Avoid unwanted chit chat during
the session.
Our Agenda
01
01
Introduction to Terraform
02
03
04
Introduction to Terratest
Setup
Demo
What is an Infrastructure?
WHAT is Terraform?
● Terraform is an infrastructure as code (IaC) tool that allows you to build, change and version infrastructure safely and efficiently.
● This includes low-level components such as compute instances, storage, and networking, as well as high-level components such
as DNS entries, SaaS features, etc.
● Terraform can manage both existing service providers and custom in-house solutions.
● For writing configuration in terraform we use HCL.
Key Components of Cloud Infrastructure
● Compute
○ EC2
● Network and Content Delivery
○ VPC
● Storage
○ S3 Bucket
● Security, Identity and Compliance
○ IAM
WHY Terraform?
● Terraform is a provisioning tool.
● It follows a declarative Infrastructure as a Code approach.
● It is the best fit for orchestrating cloud services and setup cloud infrastructure from scratch.
WHAT is Terratest
● Terratest is a Go library developed at Gruntwork, that makes it easier to write automated tests for our infrastructure code.
● It provides a variety of helper functions and patterns for common infrastructure testing tasks but here we will be discussing about
Testing Terraform code.
● It is used to perform end to end testing for our IaC.
○ E2E testing is typically a three-step process.
1. A configuration is applied to a test environment.
2. Code is run to verify the results.
3. The test environment is either reinitialized or taken down (such as deallocating a virtual machine).
Go Language
● Go is an open source programming language supported by Google.
● Built in concurrency and a robust library.
● Easy to learn and get started with.
Use Cases of Go
WHY Terratest?
● Deploy a Terraform configuration.
● Enables you to write a test using the Go language to validate what has been deployed.
● Orchestrate the tests into stages.
● Tear down the deployed infrastructure
Setting up the Environment
1. Terraform
Setting up the Environment
2. Terratest
Demo
Thank You !

Terratest with Terraform

  • 1.
    Presented By: NitinMishra Terratest with Terraform
  • 2.
    Lack of etiquetteand manners is a huge turn off. KnolX Etiquettes Punctuality Respect Knolx session timings, you are requested not to join sessions after a 5 minutes threshold post the session start time. Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter. Silent Mode Keep your mobile devices in silent mode, feel free to move out of session in case you need to attend an urgent call. Avoid Disturbance Avoid unwanted chit chat during the session.
  • 3.
    Our Agenda 01 01 Introduction toTerraform 02 03 04 Introduction to Terratest Setup Demo
  • 4.
    What is anInfrastructure?
  • 5.
    WHAT is Terraform? ●Terraform is an infrastructure as code (IaC) tool that allows you to build, change and version infrastructure safely and efficiently. ● This includes low-level components such as compute instances, storage, and networking, as well as high-level components such as DNS entries, SaaS features, etc. ● Terraform can manage both existing service providers and custom in-house solutions. ● For writing configuration in terraform we use HCL. Key Components of Cloud Infrastructure ● Compute ○ EC2 ● Network and Content Delivery ○ VPC ● Storage ○ S3 Bucket ● Security, Identity and Compliance ○ IAM
  • 6.
    WHY Terraform? ● Terraformis a provisioning tool. ● It follows a declarative Infrastructure as a Code approach. ● It is the best fit for orchestrating cloud services and setup cloud infrastructure from scratch.
  • 7.
    WHAT is Terratest ●Terratest is a Go library developed at Gruntwork, that makes it easier to write automated tests for our infrastructure code. ● It provides a variety of helper functions and patterns for common infrastructure testing tasks but here we will be discussing about Testing Terraform code. ● It is used to perform end to end testing for our IaC. ○ E2E testing is typically a three-step process. 1. A configuration is applied to a test environment. 2. Code is run to verify the results. 3. The test environment is either reinitialized or taken down (such as deallocating a virtual machine).
  • 8.
    Go Language ● Gois an open source programming language supported by Google. ● Built in concurrency and a robust library. ● Easy to learn and get started with. Use Cases of Go
  • 9.
    WHY Terratest? ● Deploya Terraform configuration. ● Enables you to write a test using the Go language to validate what has been deployed. ● Orchestrate the tests into stages. ● Tear down the deployed infrastructure
  • 10.
    Setting up theEnvironment 1. Terraform
  • 11.
    Setting up theEnvironment 2. Terratest
  • 12.
  • 13.