Skip to content

Commit

Permalink
Make dyanamo table read capacity a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
BenGalewsky committed Jan 30, 2024
1 parent 4fea2f5 commit 9a2e470
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions infra/mdf/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module "dynamodb" {
env_vars = var.env_vars
resource_tags = var.resource_tags
dynamodb_write_capacity = 20
dynamodb_read_capacity = 20
}

module "permissions" {
Expand Down
2 changes: 1 addition & 1 deletion infra/mdf/modules/dynamo/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
resource "aws_dynamodb_table" "dynamodb-table" {
name = "${var.namespace}-${var.env}"
billing_mode = "PROVISIONED"
read_capacity = 5
read_capacity = var.dynamodb_read_capacity
write_capacity = var.dynamodb_write_capacity
hash_key = "source_id"
range_key = "version"
Expand Down
5 changes: 5 additions & 0 deletions infra/mdf/modules/dynamo/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ variable "resource_tags" {
variable "dynamodb_write_capacity" {
type = number
description = "The write capacity for the DynamoDB table."
}

variable "dynamodb_read_capacity" {
type = number
description = "The read capacity for the DynamoDB table."
}
1 change: 1 addition & 0 deletions infra/mdf/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module "dynamodb" {
env_vars = var.env_vars
resource_tags = var.resource_tags
dynamodb_write_capacity = 20
dynamodb_read_capacity = 20
}

module "permissions" {
Expand Down

0 comments on commit 9a2e470

Please sign in to comment.