GithubHelp home page GithubHelp logo

ahafidh / terraform-aws-autoscaling Goto Github PK

View Code? Open in Web Editor NEW

This project forked from salvianreynaldi/terraform-aws-autoscaling

0.0 0.0 0.0 70 KB

A terraform module which provisions an auto scaling group along with its launch template

License: Apache License 2.0

HCL 100.00%

terraform-aws-autoscaling's Introduction

terraform-aws-autoscaling

A terraform module which provisions an auto scaling group along with its launch configuration

Conventions

  • the auto scaling group will have Service, Cluster, Environment, and ProductDomain tags by default, which are propagated to all instances it spawns

Behaviour

  • To specify on-demand instance types, use the launch_template_overrides variable. Auto Scaling will launch instances based on the order of preference specified in that list. ["c5.large", "c4.large", "m5.large"] means the ASG will always try to launch c5.large if it's available, falling back to c4.large if it's not available, and falling back to m5.large if the previous two aren't available
  • On the first deployment, this module will provision an ASG with a launch template that select the most recent AMI that passes through the given image_filters
  • Each time there's a change in the values of the module.asg_name's keepers (e.g. security group, AMI ID), a new ASG will be provisioned by terraform, and the old one will later be destroyed (doing the "simple swap" deployment strategy).
  • When there's a change in launch template parameters' values, terraform will create a new launch template version unless the new configuration is already the same as the latest version of the launch template (e.g. when the launch template had been updated externally).

Migration from pre-launch-template versions

terraform init
terraform state rm module.<this module name in your terraform code>.module.random_lc
terraform apply

Switching between plain launch template and mixed instance policy

switching to plain launch template

module "asg" {
  source = "github.com/traveloka/terraform-aws-autoscaling?ref=v0.3.1"
  # ...
  use_mixed_instance_policy = false
  launch_template_overrides = [
    {
      "instance_type" = "c4.large" # this (the first element) will be the launch template's instance type
    },
    {
      "instance_type" = "t3.medium"
    },
  ]
}

switching to mixed instance policy

module "asg" {
  source = "github.com/traveloka/terraform-aws-autoscaling?ref=v0.3.1"
  # ...
  use_mixed_instance_policy = true
}

Authors

License

See LICENSE for full details.

terraform-aws-autoscaling's People

Contributors

andysaputra avatar aoktox avatar febryantonius avatar franzramadhan avatar isen-ng avatar michaelhansel avatar rafikurnia avatar salvianreynaldi avatar yecklilien avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.