<- All Blueprints
Customizable templates for deploying cloud infrastructure

AWS Autoscaling Group

This blueprint creates an AWS Auto Scaling Group with best practices in mind, such as configuring minimum and maximum instance counts for efficient scaling, using private subnets for enhanced security, setting health checks and termination policies with sensible defaults, and encouraging the use of tags for resource identification and management. The blueprint is organized into groups to assist users—including those who may not be cloud infrastructure experts—in configuring essential and advanced settings easily.

Define and customize Blueprints to set what infrastructure configuration options are available to developers.

---
constants:
  __name: "{{ name }}_{{ __guid }}"
variables:
  name:
    desc: "Name of the Auto Scaling Group."
    required: true
    group: Auto Scaling Group Details
  launch_configuration:
    desc: "Name of the launch configuration to use."
    required: true
    group: Launch Configuration
    links_to: resource.aws_launch_configuration.name
  min_size:
    desc: "Minimum number of instances in the Auto Scaling Group."
    required: true
    group: Auto Scaling Group Details
    default: 1
  max_size:
    desc: "Maximum number of instances in the Auto Scaling Group."
    required: true
    group: Auto Scaling Group Details
    default: 3
  desired_capacity:
    desc: "Desired number of instances."
    required: false
    group: Auto Scaling Group Details
    default: 1
  vpc_zone_identifier:
    desc: "List of subnet IDs."
    required: true
    group: Network
    links_to: resource.aws_subnet.id
  health_check_type:
    desc: "Type of health check to use. Valid values are 'EC2' or 'ELB'."
    required: false
    group: Health Checks
    default: "EC2"
  health_check_grace_period:
    desc: "Time (in seconds) after instance comes into service before checking health."
    required: false
    group: Health Checks
    default: 300
  termination_policies:
    desc: "List of termination policies."
    required: false
    group: Advanced
    default: ["Default"]
  tags:
    group: Tags
    required: false
groups:
  Auto Scaling Group Details:
    order: 1
    desc: "Basic settings for the Auto Scaling Group."
  Launch Configuration:
    order: 2
    desc: "Launch configuration settings."
  Network:
    order: 3
    desc: "Network settings for the Auto Scaling Group."
  Health Checks:
    order: 4
    desc: "Health check settings."
  Advanced:
    order: 5
    desc: "Advanced settings for the Auto Scaling Group."
  Tags:
    order: 6
    desc: "Tags to assign to the Auto Scaling Group."
---

resource "aws_autoscaling_group" "__name" {
  name                      = {{ name }}
  launch_configuration      = {{ launch_configuration }}
  min_size                  = {{ min_size }}
  max_size                  = {{ max_size }}
  desired_capacity          = {{ desired_capacity }}
  vpc_zone_identifier       = [
    {{# vpc_zone_identifier }}
      {{ vpc_zone_identifier }},
    {{/ vpc_zone_identifier }}
  ]
  health_check_type         = {{ health_check_type }}
  health_check_grace_period = {{ health_check_grace_period }}
  termination_policies      = [
    {{# termination_policies }}
      {{ termination_policies }},
    {{/ termination_policies }}
  ]

  tags = [
    {
      Key                 = "Name"
      Value               = {{ name }}
      PropagateAtLaunch   = true
    },
    {{# tags }}
    {
      Key               = {{ tags.key | required: false }}
      Value             = {{ tags.value | required: false }}
      PropagateAtLaunch = true
    },
    {{/ tags }}
  ]
}

// Configures the Auto Scaling Group with minimum and maximum instance counts for efficient scaling.
// Uses private subnets for enhanced security.
// Sets health checks and termination policies with sensible defaults.
// Encourages tagging for resource identification and management.
//
A form is created automatically that accepts inputs that you defined in the Blueprint.
After filling out the Blueprint form, Terraform is generated and a PR is automatically submitted.
What am I looking at?

Talk to a Human

See Resourcely in action and learn how it can help you secure and manage your cloud infrastructure today!