bsmsapp/terraform/modules/dynamodb/main.tf

28 lines
624 B
HCL

# ---------------------------------------------------------------------------
# Amazon DynamoDB
# ---------------------------------------------------------------------------
resource "aws_dynamodb_table" "this" {
name = var.name
read_capacity = var.read_capacity
write_capacity = var.write_capacity
billing_mode = var.billing_mode
# attribute {
# name = var.hash_key
# type = "S"
# }
dynamic "attribute" {
for_each = var.attributes
content {
name = attribute.value.name
type = attribute.value.type
}
}
hash_key = var.hash_key
tags = var.tags
}