This is an opinionated and simplified Autoscaling module for AWS. This module automatically creates an Autoscaling Group and an Autoscaling Launch Configuration.
provider "aws" {
version = "~> 1.0.0"
region = "eu-west-1"
}
# Add our autoscaler
module "autoscaler" {
source = "github.com/olindata/terraform-aws-ezvpc.git"
name = "widgets-webservers"
subnet_ids = ["subnet-12312312", "subnet-23423423"] # Put your private subnet IDs here, maybe from our
image_id = "ami-12312312" # (optional, put premade AMI here, defaults to latest ubuntu)
is_live = false # (optional, default false) Set to true for Multi-AZ and advanced monitoring
instance_type = "${var.instance_type}" # (optional, default db.t2.nano) Set the instance type
security_groups = ["${aws_security_group.default.id}"] # (optional) Add security group ids to the instances
user_data = "" # (optional, put userdata scripts here)
}
# WARNING: In the above example, you should be using our terraform-tags
# module from https://github.com/olindata/terraform-tags instead of
# hardcoding tags like this bad example. Please see examples in our
# templates folder of our terraform-aws repository.
This module does the following...
- Creates an AWS Autoscaling Group
- Creates an AWS Autoscaling Launch Configuration
Module created and managed by Farley and OlinData
- Add CloudWatch Alarms to scale up/down based on CPU Load (possibly Farley's Multi-model scaling approach)
Apache 2 Licensed. See LICENSE for full details.