Skip to content

Commit

Permalink
feat: add scale in/out cooldown settings
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Jankovič <[email protected]>
  • Loading branch information
kirecek committed Mar 7, 2024
1 parent 9786ac9 commit 27c8f36
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ No modules.
| <a name="input_s3_logs_bucket"></a> [s3\_logs\_bucket](#input\_s3\_logs\_bucket) | Name of the S3 bucket to deliver logs to | `string` | `null` | no |
| <a name="input_s3_logs_enabled"></a> [s3\_logs\_enabled](#input\_s3\_logs\_enabled) | Indicates whether you want to enable or disable streaming broker logs to S3 | `bool` | `false` | no |
| <a name="input_s3_logs_prefix"></a> [s3\_logs\_prefix](#input\_s3\_logs\_prefix) | Prefix to append to the folder name | `string` | `null` | no |
| <a name="input_scaling_disable_scale_in"></a> [scaling\_disable\_scale\_in](#input\_scaling\_disable\_scale\_in) | Whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. | `bool` | `false` | no |
| <a name="input_scaling_in_cooldown"></a> [scaling\_in\_cooldown](#input\_scaling\_in\_cooldown) | Amount of time, in seconds, after a scale in activity completes before another scale in activity can start | `number` | `0` | no |
| <a name="input_scaling_max_capacity"></a> [scaling\_max\_capacity](#input\_scaling\_max\_capacity) | Max storage capacity for Kafka broker autoscaling | `number` | `250` | no |
| <a name="input_scaling_out_cooldown"></a> [scaling\_out\_cooldown](#input\_scaling\_out\_cooldown) | Amount of time, in seconds, after a scale out activity completes before another scale out activity can start | `number` | `0` | no |
| <a name="input_scaling_role_arn"></a> [scaling\_role\_arn](#input\_scaling\_role\_arn) | The ARN of the IAM role that allows Application AutoScaling to modify your scalable target on your behalf. This defaults to an IAM Service-Linked Role | `string` | `null` | no |
| <a name="input_scaling_target_value"></a> [scaling\_target\_value](#input\_scaling\_target\_value) | The Kafka broker storage utilization at which scaling is initiated | `number` | `70` | no |
| <a name="input_schema_registries"></a> [schema\_registries](#input\_schema\_registries) | A map of schema registries to be created | `map(any)` | `{}` | no |
Expand Down
7 changes: 5 additions & 2 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ module "msk_cluster" {
s3_logs_bucket = module.s3_logs_bucket.s3_bucket_id
s3_logs_prefix = local.name

scaling_max_capacity = 512
scaling_target_value = 80
scaling_max_capacity = 512
scaling_target_value = 80
scaling_in_cooldown = 0
scaling_out_cooldown = 0
scaling_disable_scale_in = false

client_authentication = {
sasl = { scram = true }
Expand Down
5 changes: 4 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,10 @@ resource "aws_appautoscaling_policy" "this" {
predefined_metric_type = "KafkaBrokerStorageUtilization"
}

target_value = var.scaling_target_value
target_value = var.scaling_target_value
disable_scale_in = var.scaling_disable_scale_in
scale_in_cooldown = var.scaling_in_cooldown
scale_out_cooldown = var.scaling_out_cooldown
}
}

Expand Down
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,24 @@ variable "scaling_target_value" {
default = 70
}

variable "scaling_disable_scale_in" {
description = "Whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource."
type = bool
default = false
}

variable "scaling_in_cooldown" {
description = "Amount of time, in seconds, after a scale in activity completes before another scale in activity can start"
type = number
default = 0
}

variable "scaling_out_cooldown" {
description = "Amount of time, in seconds, after a scale out activity completes before another scale out activity can start"
type = number
default = 0
}

################################################################################
# Glue Schema Registry & Schema
################################################################################
Expand Down

0 comments on commit 27c8f36

Please sign in to comment.