Skip to content

Instantly share code, notes, and snippets.

@cromyhector
Created June 14, 2022 04:40
Show Gist options
  • Save cromyhector/3b0e411817afd8fde82fee41acc3897e to your computer and use it in GitHub Desktop.
Save cromyhector/3b0e411817afd8fde82fee41acc3897e to your computer and use it in GitHub Desktop.
### --- dynamodb/resources.tf ---
resource "aws_dynamodb_table" "sneakers_table" {
name = var.table_name
read_capacity = 20
write_capacity = 20
hash_key = "BrandName"
range_key = "ModelNumber"
attribute {
name = "BrandName"
type = "S"
}
attribute {
name = "ModelNumber"
type = "N"
}
ttl {
attribute_name = "TimeToExist"
enabled = false
}
global_secondary_index {
name = "Sneakers_GSI"
hash_key = "BrandName"
range_key = "ModelNumber"
write_capacity = 10
read_capacity = 10
projection_type = "ALL"
}
tags = {
Name = var.environment_name
Environment = var.environment_type
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment