GithubHelp home page GithubHelp logo

terratest-example's Introduction

Terratest Example

This repo contains a Terratest example where Terraform provisions a small Ubuntu 16.04 instance and checks to verify that the outputted instance id matches with the instance id asserted through Terratest. For the sake of simplicity, we are using AWS as the targeted cloud provider.

Terraform.tfvars file

The variable for creating the resource in AWS can be found in the terraform.tfvars file. The variable definitions are located in variables.tf.

Variables.tf and Terraform.tfvars files

The definition of the variables are as follows:

variable "creds" {
    type = string
}

variable "region" {
    type = string
    default = "us-east-1"
}

variable "ami" {
    type = string
}

variable "instance" {
    type = string
    default = "t2.micro"
}

These defined variable types are used in the terraform.tfvars file as follows:

# Specify path to AWS credentials
creds = "/home/hugh/.aws/credentials"

# Define the AWS region to deploy the test instance to
region = "us-west-2"


# Define the AMI and size of the instance
ami = "ami-08d70e59c07c61a3a"
instance = "t3.micro"

NOTE

It is recommended that you change creds in terraform.tfvars to the location of your AWS credentials (AWS_ACCESS_KEY and AWS_SECRET_KEY)

terratest-example's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.