Skip to content

mitchallen/terraform-101

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-101

See article:

Usage

Install Terraform (Mac)

brew tap hashicorp/tap
brew install hashicorp/tap/terraform

terraform version

Make sure Docker is running

See if the docker daemon is running

docker ps

Install Docker Desktop

If you need to install docker:

Open Docker Desktop

This will start the docker daemon if it isn't running:

open -a Docker

Check it again:

docker ps

Terraform

Init the plan

terraform init

Run the plan

If using Docker for Mac, run this first:

export TF_VAR_docker_endpoint=unix://$HOME/.docker/run/docker.sock
terraform plan

If you run into issues with Docker, check the current context:

docker context ls

Apply the plan

If using Docker for Mac, run this first:

export TF_VAR_docker_endpoint=unix://$HOME/.docker/run/docker.sock
terraform apply

Verify the server is up

docker ps

If you have a lot of containers running already, you can filter with:

docker ps | grep random

Test the server

curl http://localhost:1220/v1/people/1

curl http://localhost:1220/v1/words/1

curl http://localhost:1220/v1/values/1

curl http://localhost:1220/v1/coords/1

For more commands see:

Destroy the plan

terraform destroy

Verify the container is gone

docker ps

References

About

Terraform Example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages