Skip to content

benmangold/tf-up-and-running

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tf-up-and-running

a codethrough of Terraform Up & Running by Yevgeniy Brikman

auth

export AWS IAM credentials into your environment

export AWS_ACCESS_KEY_ID=abcdefg
export AWS_SECRET_ACCESS_KEY=hijklmnop

setup and teardown

setup:

# initialize state lock
cd s3-lock
terraform init
terraform apply
cd ..

# deploy autoscaling group with remote state
cd asg
terraform init
terraform workspace new tf-up-and-running # switch to empty workspace
terraform apply

applying the autoscaler will output public dns to a Hello World server

# <terraform apply output>
Apply complete! Resources: 8 added, 0 changed, 0 destroyed.

Outputs:

alb_dns_name = <publicDNS>

curl <publicDNS>
Hello World

teardown:

# tear down autoscaling group
cd asg
terraform destroy
cd ..

# tear down state lock
cd s3-lock
terraform init
terraform destroy # destroying the bucket requires the S3 console

mysql rds

mysql/main.tf requires a secret tf-up-and-running-mysql-password set up in AWS Secrets Manager

About

working through Terraform Up and Running

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages