Skip to content

Commit

Permalink
Use count on autoscaler module to disable
Browse files Browse the repository at this point in the history
after cloudposse/terraform-aws-dynamodb-autoscaler#37 was merged, some autoscaler resources were automatically created, even if enable_autoscaler = false

Closes cloudposse#92
  • Loading branch information
mwarkentin committed May 20, 2021
1 parent 0f1474b commit a872940
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ resource "aws_dynamodb_table" "default" {
module "dynamodb_autoscaler" {
source = "cloudposse/dynamodb-autoscaler/aws"
version = "0.13.0"

count = local.enabled && var.enable_autoscaler && var.billing_mode == "PROVISIONED" ? 1 : 0

enabled = local.enabled && var.enable_autoscaler && var.billing_mode == "PROVISIONED"

attributes = concat(module.this.attributes, var.autoscaler_attributes)
Expand Down

0 comments on commit a872940

Please sign in to comment.