GithubHelp home page GithubHelp logo

terraform-workshop's Introduction

AWS - Terraform Workshop

In this repository you will find all the things you need to understand Terraform and how to deploy infrastructure to AWS.

Considerations

This workshop is based on:

  • Terraform >= v1.0.4
  • AWS provider for Terraform >= v2.0

Pre-requisits

Terraform

To install Terraform cli for your system, you can follow their official documentation


Understanding Terraform

Terraform is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage hundreds of cloud services. Terraform codifies cloud APIs into declarative configuration files.

Key features

Infrastructure as Code

You describe your infrastructure using Terraform's high-level configuration language in human-readable, declarative configuration files. This allows you to create a blueprint that you can version, share, and reuse.

Execution Plans

Terraform generates an execution plan describing what it will do and asks for your approval before making any infrastructure changes. This allows you to review changes before Terraform creates, updates, or destroys infrastructure.

Resource Graph

Terraform builds a resource graph and creates or modifies non-dependent resources in parallel. This allows Terraform to build resources as efficiently as possible and gives you greater insight into your infrastructure.

Change Automation

Terraform can apply complex changesets to your infrastructure with minimal human interaction. When you update configuration files, Terraform determines what changed and creates incremental execution plans that respect dependencies.

How it works

Terraform uses "providers" as a plugin component that provide single units of infrastructure called resources, like Compute Engine instances or Network configuration, even DNS configurations or SaaS subscriptions.

Terraform keeps track of your real infrastructure in a state file, which acts as a source of truth for your environment.

Terraform uses the state file to determine the changes to make to your infrastructure so that it will match your configuration.

For a deeper understanding of the tool, I recommended you visit the tutorial Introduction to Infrastructure as Code with Terraform


Workshop

This workshop is intended to understand a simple flow to create infrastructure as code using Terraform CLI and AWS as the cloud provider.

We are going to deploy a serverless application with all the infrastructure components necessary for its execution, like AWS Lambda as our backend layer, Amazon API Gateway to expose our service, Amazon Dynamo DB as our data layer and Amazon Cognito for user administration and authentication.

Use case

Deploy and simple hello world API on AWS in a secure, reliable and replayed way.

High level architecture

Modules

This workshop has 3 modules, each module describes a step on the path to deploying infrastructure as code using Terraform:

Module Description
Provider configuration Configure Terraform project and AWS provider with valid credentials
Build infrastructure Set all the components need it to run our use case
Deploy infrastructure Apply all the configuration and change some ones to play with state and outputs

Disclaimer: This workshop is based on the repo from Hadock using CDKTF From zero to hero and is authorized by him. If you are interested in CDKTF I recommend you to visit his workshop.

Happy coding ❤️

terraform-workshop's People

Watchers

James Cloos avatar Rodrigo Navarro 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.