# DynamoDB table for storing filament data resource "aws_dynamodb_table" "filaments" { name = "${var.app_name}-filaments" billing_mode = "PAY_PER_REQUEST" hash_key = "id" attribute { name = "id" type = "S" } attribute { name = "brand" type = "S" } attribute { name = "tip" type = "S" } attribute { name = "status" type = "S" } # Global secondary index for querying by brand global_secondary_index { name = "brand-index" hash_key = "brand" projection_type = "ALL" } # Global secondary index for querying by type global_secondary_index { name = "tip-index" hash_key = "tip" projection_type = "ALL" } # Global secondary index for querying by status global_secondary_index { name = "status-index" hash_key = "status" projection_type = "ALL" } tags = { Name = "${var.app_name}-filaments" Environment = var.environment } }