Some basic terraform examples.
brew tap hashicorp/tap
brew install terraform
terraform -install-autocomplete
You find the working configs in the examples/ directory.
cd examples/nginx-with-docker
terraform init
terraform apply
# Check localhost:8000 for running nginx
terraform destroy
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
How to create variables and local files, check out the example.
VPC with a private and public subnet, nat gateway & internet gateway
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
My /etc/resolv.conf
was missing, so I've linked it again:
# Requires root privilegues
ln -s /var/run/resolv.conf /etc/resolv.conf