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 configurable max values to IaC #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions iac/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ resource "aws_lambda_function" "autoscaler" {
environment {
variables = {
AUTOSCALING_GROUP_ARN = var.autoscaling_group_arn
AUTOSCALING_MAX_CREATE = var.autoscaling_max_create
AUTOSCALING_MAX_KILL = var.autoscaling_max_kill
AUTOSCALING_REGION = data.aws_region.current.name
SPACELIFT_API_KEY_ID = var.spacelift_api_key_id
SPACELIFT_API_KEY_SECRET_NAME = aws_ssm_parameter.spacelift_api_key_secret.name
Expand Down
12 changes: 12 additions & 0 deletions iac/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ variable "autoscaling_frequency" {
default = 5
}

variable "autoscaling_max_create" {
type = number
description = "Max number of instances to create during a single execution of the autoscaler"
default = 1
}

variable "autoscaling_max_kill" {
type = number
description = "Max number of instances to kill during a single execution of the autoscaler"
default = 1
}

variable "spacelift_api_key_id" {
type = string
description = "ID of the Spacelift API key to use"
Expand Down