GithubHelp home page GithubHelp logo

igorgrin / terraform-lessons Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.47 MB

Terraform code, How to

HCL 23.91% Python 0.97% Shell 0.29% Dockerfile 0.12% CSS 21.62% JavaScript 12.86% SCSS 31.22% HTML 9.01%

terraform-lessons's Introduction

Terraform lessons

Terraform became de facto the default language for managing Public Clouds. Here are some examples in setting up AWS environment using terraform code.

  1. Create State file bucket
    - Why?
    - State file is critical to Terraform infrastructure. By default, Terraform creates a state file in your local directory. If you have multiple people managing the code, they would overlap and overwrite each other's changes. The best practice is to keep the state file in the remote location with a locking mechanism during the terraform run.

  2. Create VPC
    - Why?
    - Amazon gives you the default VPC where you can create resources. The problem with using the default VPC is that you can't reference existing resources without hard-coding their values, since Terraform has no knowledge of them. For example, if you create an ec2 instance, you have to reference a subnet, so you'd have to put something like subnet-0da478ea6a3b241c0 in your code. Also you'd have more granular control over your Infrastructure.

  3. Create VPC using a module
    - Why?
    - As you can see in the previous code, the code is very long because you have to specify every resource needed for VPC creation. There are many public Terraform modules available, where people have pre-built all the necessary components.

terraform-lessons's People

Contributors

igorgrin 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.