Skip to content

Commit 174d261

Browse files
feat: Support disabling storage autoscaling (#15)
Co-authored-by: Bryant Biggs <[email protected]>
1 parent 891b691 commit 174d261

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ No modules.
187187
| <a name="input_create_connect_worker_configuration"></a> [create\_connect\_worker\_configuration](#input\_create\_connect\_worker\_configuration) | Determines whether to create connect worker configuration | `bool` | `false` | no |
188188
| <a name="input_create_schema_registry"></a> [create\_schema\_registry](#input\_create\_schema\_registry) | Determines whether to create a Glue schema registry for managing Avro schemas for the cluster | `bool` | `true` | no |
189189
| <a name="input_create_scram_secret_association"></a> [create\_scram\_secret\_association](#input\_create\_scram\_secret\_association) | Determines whether to create SASL/SCRAM secret association | `bool` | `false` | no |
190+
| <a name="input_enable_storage_autoscaling"></a> [enable\_storage\_autoscaling](#input\_enable\_storage\_autoscaling) | Determines whether autoscaling is enabled for storage | `bool` | `true` | no |
190191
| <a name="input_encryption_at_rest_kms_key_arn"></a> [encryption\_at\_rest\_kms\_key\_arn](#input\_encryption\_at\_rest\_kms\_key\_arn) | You may specify a KMS key short ID or ARN (it will always output an ARN) to use for encrypting your data at rest. If no key is specified, an AWS managed KMS ('aws/msk' managed service) key will be used for encrypting the data at rest | `string` | `null` | no |
191192
| <a name="input_encryption_in_transit_client_broker"></a> [encryption\_in\_transit\_client\_broker](#input\_encryption\_in\_transit\_client\_broker) | Encryption setting for data in transit between clients and brokers. Valid values: `TLS`, `TLS_PLAINTEXT`, and `PLAINTEXT`. Default value is `TLS` | `string` | `null` | no |
192193
| <a name="input_encryption_in_transit_in_cluster"></a> [encryption\_in\_transit\_in\_cluster](#input\_encryption\_in\_transit\_in\_cluster) | Whether data communication among broker nodes is encrypted. Default value: `true` | `bool` | `null` | no |

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ resource "aws_cloudwatch_log_group" "this" {
231231
################################################################################
232232

233233
resource "aws_appautoscaling_target" "this" {
234-
count = var.create ? 1 : 0
234+
count = var.create && var.enable_storage_autoscaling ? 1 : 0
235235

236236
max_capacity = var.scaling_max_capacity
237237
min_capacity = 1
@@ -242,7 +242,7 @@ resource "aws_appautoscaling_target" "this" {
242242
}
243243

244244
resource "aws_appautoscaling_policy" "this" {
245-
count = var.create ? 1 : 0
245+
count = var.create && var.enable_storage_autoscaling ? 1 : 0
246246

247247
name = "${var.name}-broker-storage-scaling"
248248
policy_type = "TargetTrackingScaling"

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,12 @@ variable "cloudwatch_log_group_kms_key_id" {
256256
# Storage Autoscaling
257257
################################################################################
258258

259+
variable "enable_storage_autoscaling" {
260+
description = "Determines whether autoscaling is enabled for storage"
261+
type = bool
262+
default = true
263+
}
264+
259265
variable "scaling_max_capacity" {
260266
description = "Max storage capacity for Kafka broker autoscaling"
261267
type = number

0 commit comments

Comments
 (0)