Skip to content

artiphishle/edu-terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Terraform

Some basic terraform examples.

Quickstart OSX

Install Terraform

brew tap hashicorp/tap
brew install terraform

terraform -install-autocomplete

Basic Commands

🔗 Terraform commands

Examples

You find the working configs in the examples/ directory.

1. Docker with running NginX

🔗 Install Docker Desktop

cd examples/nginx-with-docker

terraform init
terraform apply
# Check localhost:8000 for running nginx
terraform destroy

2. AWS t2-micro

Prerequisite: Install AWS CLI

# Go to AWS IAM Dashboard & 'create access key', add:
aws configure
cd examples/aws-t2-micro

terraform init
terraform apply
# Check AWS account for running t2-micro (EC2 service)
terraform destroy

3. Local file and variables

How to create variables and local files, check out the example.

4. VPC

VPC with a private and public subnet, nat gateway & internet gateway

Result

AWS Result 'VPC'

Troubleshoot

Error on source ~/.zshrc

Verify ~/.zshrc command for this entry:

autoload -Uz compinit && compinit # This line was missing
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /opt/homebrew/bin/terraform terraform

AWS refuses connection on port 53

My /etc/resolv.conf was missing, so I've linked it again:

# Requires root privilegues
ln -s /var/run/resolv.conf /etc/resolv.conf

About

Terraform examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published