Skip to content

rocksea/terraform-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform

Terraform is Infrastructure as Code for Managing infrastructure.

Commands

The commands are divided into three steps.

$ terraform init

$ terraform plan

$ terraform apply

Switching workspace

terraform workspace new dev
terraform workspace show
terraform workspace list

Installing AWS CLI on MacOS

curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /

Terraform Modules

Find AMI

You must select an AMI to launch EC2 Instance. A link to find AMIs

aws ec2 describe-images \
    --owners 099720109477 \
    --filters "Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-????????" "Name=state,Values=available" \
    --query "reverse(sort_by(Images, &Name))[:1].ImageId" \
    --output text

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published