From 0e2f9e3b57a8e155d6d55b2b2b71ea2e075b3809 Mon Sep 17 00:00:00 2001 From: Kshitij Date: Fri, 5 Sep 2025 01:25:29 +0530 Subject: [PATCH] Added HCL code for creating dynamodb table. --- Terraform/main.tf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Terraform/main.tf b/Terraform/main.tf index 82eaaf5..a6caa61 100644 --- a/Terraform/main.tf +++ b/Terraform/main.tf @@ -35,3 +35,20 @@ resource "aws_security_group" "ec2_ssh_security" { } # 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 +}