Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autoscaling parameters #19

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading