Code Monkey home page Code Monkey logo

learnterraform's Introduction

Motivation

I had heard about Terraform as a good solution to infrastructure as code approach. I have been using idempotent powershell scripts as a way to achieve that objective which is imperative (procedural) rather than declarative (as Terraform is). And that too, once the infrastructure (virtual machunes) were already provisioned. However, as I moved further and further into infrastructure as code process, I started realizing that there should be an efficient way of also provisioning the underlying infrastructure (virtual machines in this case). This repository is to capture my learning using terraform. My objective is to be able to run a few use cases, e.g. how to provision a VM in Azure and AWS and also be able to remote (for windows OS) into it. As I learn more I will add more use cases to this repository.

Approach

To begin with, most of my hands on learnings are going to be following tutorials/getting started docs available at:
Get Started - Azure
Get Started - AWS

Prerequistes

Installation is available as part of getting stated documentations at https://www.terraform.io/

Usage:

-start with terraform init in the folder where the .tf file exists
-followed by terraform plan -out ${PlanFileName}.tfplan
-next terraform apply ${PlanFileName}.tfplan
-and lastly, once the resource is provisioned and verified, the command to destroy is terraform destroy
-in-order to not be prompted for each terraform apply and terraform destroy command, add --auto-approve at the end. But do not use this the first time to provision an instance, since that might result in incorrect provisioning and without the review, it might take longer to identify and correct the error.

Notes:

-when creating a new repository for terraform please be careful what kind of files are being commited (we do not want sensetive files like state and tfvars to be commited at all). Use .gitignore effectively in this case.

learnterraform's People

Contributors

kunduso avatar

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.