Added HCL code for creating dynamodb table.

This commit is contained in:
K
2025-09-05 01:25:29 +05:30
parent 6df047c387
commit 0e2f9e3b57
+17
View File
@@ -35,3 +35,20 @@ resource "aws_security_group" "ec2_ssh_security" {
} }
# For each protocol, new block; eg. egress { from... to... protocol = "icmp" cidr...} # For each protocol, new block; eg. egress { from... to... protocol = "icmp" cidr...}
} }
# DynamoDB Table
resource "aws_dynamodb_table" "dynamo-test" {
name = "testTable" # Table name
billing_mode = "PROVISIONED" # Specify billing type; PROVISIONED (provisioned billing mode) / PAY_PER_REQUEST (on-demand billing mode)
read_capacity = 1 # no. of reads per sec.
write_capacity = 1 # no. of writes per sec.
# Attribute
attribute {
name = "username" # Col. name
type = "S" # Col. type;
# S -> String, N -> Number, B -> Binary, BOOL -> Boolean, List -> L (ordered collection of values), Map ->M (key-value pairs), Null -> NULL
}
hash_key = "username" # Primary key
}