Skip to content

arunmur/terraform_workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform_workshop

This repo contains material to conduct a Terraform Workshop.

Setup

We run all of our terraform commands though docker.

Running commands

All terraform commands can be run through docker using

docker run --rm -ti -v "$PWD:/app" -w "/app" hashicorp/terraform

Try running the below command to get help,

docker run --rm -ti -v "$PWD:/app" -w "/app" hashicorp/terraform --help

Alternatively, to make your life in a shell easier you can alias the command to terraform

alias terraform='docker run --rm -ti -v $PWD:/app -w /app hashicorp/terraform'

You can set this alias in your profile file to automatically run everytime you log into a shell.

Now run,

terraform --help

Typical execution cycle

This is the typical execution cycle of an application managed by terraform



   +-----------+          +----------+
   | Plan      | -------> |  Apply   |
   +-----------+          +----------+
                            |     |
                            |     \------------\  +-----+
                            |                  |  |  *  |
                            V                  V  V     |
                      +-----------+           +--------------+              +---------------+
                      |  Create   | ------->  |   Upgrade    |  --------->  |  Destroy      |
                      +-----------+           +--------------+              +---------------+


terraform plan and terraform apply commands are used to mange the application infrastructure on the cloud.

Useful commands

  • Ssh into public instance ssh -i ~/.ssh/[.pem file] ubuntu@[instance ip]
  • Scp a file into an instance scp -i ~/.ssh/[.pem file] ./file(src) ubuntu@[instance ip]:/tmp/(dest)
  • Scp a file from an instance scp -i ~/.ssh/[.pem file] ubuntu@[instance ip]:/tmp/(src) ./file(dest)

Useful links

About

Material to conduct Terraform Workshop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published