Giter VIP home page Giter VIP logo

terraform-beginner-bootcamp-2023's Introduction

Terraform Beginner Bootcamp 2023

Install the Terraform CLI

Install Terraform CLI

Understanding and implementing Shebang

Shebang

Understanding Unix perfmissions

Linux permissions

AWS CLI Installation

AWS CLI is installed for the project via the bash script [./bin/install_aws_cli]

Getting started install aws cli

AWS CLI ENV Vars

We can check if our AWS crdentials is configuerd correctly by running the folloring AWS CLI command:

sh
aws sts get-caller-identity

If it is successful you should see a JSON payload return that looks like this:

{
    "UserId": "AIDA56YXAESMPZLN42HO4",
    "Account": "1234567891012,
    "Arn": "arn:aws:iam::959436563608:user/terraform-user"
}

We will need to generate AWS CLI credits from IAM User in order to use AWS CLI

Terraform Basics

Terraform Registry

Terraform sources their providers and modules from the Terraform registry which located at registry.terraform.io

  • Provideers are interfaces to APIs that will allow you to create resources in terraform.

  • Modules are a way to make large amounts of terraform code modular, portable and shareable.

Terraform Console

We can see a list of all the Terraform commands by simply typing terraform

Terraform Init

At the start of a new terraform project we will run terraform init to downloadd the binaries for the terraform providers that we will use in this project

Terraform Plan

This will generate out a changeset, about the state of our infrastructure and what will be changed.

W can output this changeset ie. "plan" to be passed to an apply , but often you can just ignore outputting.

Terraform apply

terraform apply

This will run a plan and pass the changeset to be executed by terraform. Apply should prompt yes or no.

If we want to automatically approve and apply we can provide the auto approve fag eg. terraform apply --auto-approve.

TErraform Lock Files

.terraform.lock.chl contains the locked versioning for the providers or modules that should be used with this project.

The Terrraform Lock File should be committed to your VErsion Control System (VCS) eg. Github

TErraform state files

.terraform.tfstate contain information about the current state ogf your infrastructure.

this file should not be committed to your VCS.

This file can contain sensitive data.

If you lose thise file, you lose knowing the state of your infrastructure.

.terraform.tfstate.backup is the previous state file state.

Terraform Directory

.terraform directory contains binaries of terraform providers.

terraform-beginner-bootcamp-2023's People

Contributors

ronald03 avatar

Watchers

 avatar

terraform-beginner-bootcamp-2023's Issues

Project Root Env Var

We are going to set an environment variable for PROJECT_ROOT that we can reference in our bash scripts

refactorr aws cli script

  • Refactor AWS CLI into bash script
  • Provide env var examples for AWS CLI requirements
  • Set out env vars for AWS using gp env

Terraform Random Bucket Name

  • Explore the terraform registry
  • Install the terraform random provider
  • Run terraform init
  • Generate out a random bucket name
  • Output the random bucket name to outputs

Refactor Terraform CLI

There is an issue with installing Terraform CLI.
We need to go and make sure it automates without any user input.

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.