Skip to content

Latest commit

 

History

History
83 lines (53 loc) · 1.57 KB

README.md

File metadata and controls

83 lines (53 loc) · 1.57 KB

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