Skip to content

nikosmeds/terraform-aws-asg-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary

  • Terraform provisions an EC2 auto scaling group.
  • Chef configures a basic apache web server.

Usage

  1. Clone this repository locally.
  2. Ensure your AWS API access keys are defined in ~/.aws/credentials.
  3. Update terraform/terraform.tfvars variables with your AWS account ID and other optional parameters.
  4. Use Terraform to provision infrastructure.
$ cd terraform/
$ terraform apply -target=module.vpc
$ terraform apply -target=module.apache
  1. SSH into server and run ChefSpec tests.
$ ssh ubuntu@<ec2_dns>
$ cd /srv/playground/chef/apache
$ sudo chef exec rspec
  1. Stress the CPU, which triggers ASG to spin up 2nd server.
$ stress -c 8
  1. Afterwards, use Terraform to destroy infrastructure.
$ terraform destroy -target=module.apache
$ terraform destroy -target=module.vpc

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published