Skip to content

Commit

Permalink
Add autoscaling parameters (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
snovikov authored Jan 27, 2025
1 parent b48d346 commit 89d48bd
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 0 deletions.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,62 @@ Type: `number`

Default: `1`

### <a name="input_autoscale_measure_name"></a> [autoscale\_measure\_name](#input\_autoscale\_measure\_name)

Description: Metric used for your Auto Scaling trigger

Type: `string`

Default: `"CPUUtilization"`

### <a name="input_autoscale_statistic"></a> [autoscale\_statistic](#input\_autoscale\_statistic)

Description: Statistic the trigger should use, such as Average

Type: `string`

Default: `"Average"`

### <a name="input_autoscale_unit"></a> [autoscale\_unit](#input\_autoscale\_unit)

Description: Unit for the trigger measurement, such as Bytes

Type: `string`

Default: `"Percent"`

### <a name="input_autoscale_lower_bound"></a> [autoscale\_lower\_bound](#input\_autoscale\_lower\_bound)

Description: Minimum level of autoscale metric to remove an instance

Type: `number`

Default: `20`

### <a name="input_autoscale_lower_increment"></a> [autoscale\_lower\_increment](#input\_autoscale\_lower\_increment)

Description: How many Amazon EC2 instances to remove when performing a scaling activity.

Type: `number`

Default: `-1`

### <a name="input_autoscale_upper_bound"></a> [autoscale\_upper\_bound](#input\_autoscale\_upper\_bound)

Description: Maximum level of autoscale metric to add an instance

Type: `number`

Default: `80`

### <a name="input_autoscale_upper_increment"></a> [autoscale\_upper\_increment](#input\_autoscale\_upper\_increment)

Description: How many Amazon EC2 instances to add when performing a scaling activity

Type: `number`

Default: `1`

### <a name="input_env_vars"></a> [env\_vars](#input\_env\_vars)

Description: Map of custom ENV variables to be provided to the application running on Elastic Beanstalk, e.g. env\_vars = { DB\_USER = 'admin' DB\_PASS = 'xxxxxx' }
Expand Down
8 changes: 8 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ module "environment" {
autoscale_min = var.autoscale_min
autoscale_max = var.autoscale_max

autoscale_measure_name = var.autoscale_measure_name
autoscale_statistic = var.autoscale_statistic
autoscale_unit = var.autoscale_unit
autoscale_lower_bound = var.autoscale_lower_bound
autoscale_lower_increment = var.autoscale_lower_increment
autoscale_upper_bound = var.autoscale_upper_bound
autoscale_upper_increment = var.autoscale_upper_increment

vpc_id = var.vpc_id

availability_zone_selector = var.availability_zone_selector
Expand Down
42 changes: 42 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,48 @@ variable "autoscale_max" {
default = 1
}

variable "autoscale_measure_name" {
type = string
default = "CPUUtilization"
description = "Metric used for your Auto Scaling trigger"
}

variable "autoscale_statistic" {
type = string
default = "Average"
description = "Statistic the trigger should use, such as Average"
}

variable "autoscale_unit" {
type = string
default = "Percent"
description = "Unit for the trigger measurement, such as Bytes"
}

variable "autoscale_lower_bound" {
type = number
default = 20
description = "Minimum level of autoscale metric to remove an instance"
}

variable "autoscale_lower_increment" {
type = number
default = -1
description = "How many Amazon EC2 instances to remove when performing a scaling activity."
}

variable "autoscale_upper_bound" {
type = number
default = 80
description = "Maximum level of autoscale metric to add an instance"
}

variable "autoscale_upper_increment" {
type = number
default = 1
description = "How many Amazon EC2 instances to add when performing a scaling activity"
}

variable "solution_stack_name" {
type = string
description = "Elastic Beanstalk stack, e.g. Docker, Go, Node, Java, IIS. For more info, see https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html"
Expand Down

0 comments on commit 89d48bd

Please sign in to comment.