Skip to content

rhythmictech/terraform-aws-asg-rollingupdate

Repository files navigation

terraform-aws-asg-rollingupdate

tflint tfsec yamllint misspell pre-commit-check follow on Twitter

Terraform module to create Autoscaling Group in AWS with AutoScalingRollingUpdates

Requirements

Name Version
terraform >= 0.13.0
aws >= 3.0
null >= 3.0

Providers

Name Version
aws >= 3.0
null >= 3.0

Modules

No modules.

Resources

Name Type
aws_cloudformation_stack.this resource
aws_lb.this resource
aws_lb_listener.this resource
aws_lb_target_group.this resource
null_resource.tags_for_asg resource
null_resource.tags_for_lt resource

Inputs

Name Description Type Default Required
aws_lb_internal The Load Balancer which fronts the ASG is internal bool true no
batch_max_size Maximum batch size for ASG rolling updates string 1 no
elb_drop_invalid_headers Invalid headers being passed through to the target of the load balance may exploit vulnerabilities bool true no
health_check_path Path of HTTP Health Check string "EC2" no
health_check_port Path of HTTP Health Check number 80 no
health_check_type Check instance health with EC2 or ELB checks string "EC2" no
image_id AMI ID to use for this cluster string "" no
instance_security_groups Security groups to apply to instances in ASG list(string) [] no
instance_type Instance type to use in ASG string "" no
keypair_name Name of an externally created keypair to attach to the automatically created instances. This only applies if launch_template_name is defined AND scaling_object_type is set to 'launchtemplate' string "" no
launch_template_name Name of externally created launch template to use with this module. If not defined and scaling_object_type is set to 'launchtemplate' (the default value), this will cause a launch template to be created in the cloudformation template string "" no
launch_template_overrides A list of maps defining any overrides to the Mixed Instance Policy Template. Required for Mixed Instance Policies. The map can contain the following values: instanceType (AWS Instance Type), launchTemplateSpecification (a separate launch template to use, object consisting of either launchTemplateId or launchTemplateName and optionally version), weightedCapacity (a weighted capacity entry for how frequently to use this override) list(map(string)) [] no
launch_template_version Version of externally created launch template to use with this module. If launch_template_name is defined this MUST be defined. string "" no
lb_access_logging_bucket Optional target for ALB access logging string null no
lb_access_logging_prefix Optional target prefix for ALB access logging (only used if lb_access_logging_bucket is set) string null no
lb_listener_certificate ARN of the certificate to attach to the LB. Only if lb_listener_protocol is HTTPS string "" no
lb_listener_port Port on which LB will listen number 80 no
lb_listener_protocol Protcol on which LB will listen string "HTTP" no
lb_listener_ssl_policy AWS SSL Security Policy to use with an HTTPS listener on the Load Balancer string "ELBSecurityPolicy-TLS-1-2-Ext-2018-06" no
lb_security_groups Security groups to apply to Load Balancer list(string) n/a yes
max_instance_lifetime Maximum lifetime of instances in ASG in seconds (values must be either equal to 0 or between 604800 and 31536000 seconds.) number 0 no
max_instances Max instances in ASG string 4 no
min_instances Min instances in ASG string 2 no
min_instances_in_service Minimum number of instances that must remain in service when autoscaling group is updated string n/a yes
name common name for resources in this module string "ec2-spot-cluster" no
on_demand_allocation_strategy Strategy for allocation of instances to fulfill On-Demand capacity. Only valid value is currently 'prioritized'. string "prioritized" no
on_demand_base_capacity Minimum amount of the ASG Capacity that should be filled with On Demand instances number 0 no
on_demand_percent_above_base_capacity Percentage of the instances beyond the base capacity of the ASG that should be On Demand number 100 no
pause_time Time to wait for a new instance to check-in before marking it as failed. Specify PauseTime in the ISO8601 duration format (in the format PT#H#M#S, where each # is the number of hours, minutes, and seconds, respectively). string "PT5M" no
scaling_object_type The object type the autoscaling group should use as the basis for its instances. The default value is 'LaunchTemplate'. MixedInstancesPolicy is also supported, and future values may include 'LaunchConfigurationName', and 'InstanceId' string "launchtemplate" no
spot_allocation_strategy Method by which to allocate spot instances for a MixedInstancesPolicy deployment. Valid values are lowest-price, capacity-optimized, and capacity-optimized-prioritized. string "lowest-price" no
spot_instance_pools Number of Spot Instance pools to allocate your spot capacity for a MixedInstancesPolicy deployment. Applies only when lowest-price allocation strategy is in effect. number 2 no
spot_max_price Maximum price to pay for Spot Instances in a MixedInstancesPolicy deployment. Default is blank, which equates to the price of on-demand instances. string "" no
subnet_ids Subnets ALB will listen on list(string) n/a yes
tags Tags definition to apply to resources map(string) n/a yes
vpc_id VPC ID to use for target group string n/a yes

Outputs

Name Description
aws_cloudformation_stack AWS ASG CFN Stack resource
aws_lb AWS LB resource
aws_lb_listener AWS LB listener resource
aws_lb_target_group AWS LB Target Group resource
rendered n/a

The Giants underneath this module

  • pre-commit.com/
  • terraform.io/
  • github.com/tfutils/tfenv
  • github.com/segmentio/terraform-docs