From 322c4dcf7d4e843fef9d3b686e1393851e80d679 Mon Sep 17 00:00:00 2001 From: Alex Jurkiewicz Date: Thu, 27 Jan 2022 04:31:08 +1100 Subject: [PATCH] Don't set read/write capacity in PAY_PER_REQUEST billing mode (#101) Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com> --- README.md | 2 +- main.tf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cbfd2ce..b02a106 100644 --- a/README.md +++ b/README.md @@ -416,7 +416,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. ## Copyright -Copyright © 2017-2021 [Cloud Posse, LLC](https://cpco.io/copyright) +Copyright © 2017-2022 [Cloud Posse, LLC](https://cpco.io/copyright) diff --git a/main.tf b/main.tf index 7f3ae70..4b96ac8 100644 --- a/main.tf +++ b/main.tf @@ -47,8 +47,8 @@ resource "aws_dynamodb_table" "default" { count = local.enabled ? 1 : 0 name = module.this.id billing_mode = var.billing_mode - read_capacity = var.autoscale_min_read_capacity - write_capacity = var.autoscale_min_write_capacity + read_capacity = var.billing_mode == "PAY_PER_REQUEST" ? null : var.autoscale_min_read_capacity + write_capacity = var.billing_mode == "PAY_PER_REQUEST" ? null : var.autoscale_min_write_capacity hash_key = var.hash_key range_key = var.range_key stream_enabled = length(var.replicas) > 0 ? true : var.enable_streams