diff --git a/modules/dynamodb/dynamo.tf b/modules/dynamodb/dynamo.tf new file mode 100644 index 0000000..8ba6d4e --- /dev/null +++ b/modules/dynamodb/dynamo.tf @@ -0,0 +1,24 @@ +provider "aws" { + region = "ap-south-1" +} +resource "aws_dynamodb_table" "dynamodb-table-test" { + + billing_mode = "PROVISIONED" + deletion_protection_enabled = false + hash_key = var.hashkey-name + name = var.dynamodb-name + range_key = var.rangekey-name + read_capacity = 3 + stream_enabled = false + tags = {} + tags_all = {} + write_capacity = 3 + attribute { + name = "first-name" + type = "S" + } + attribute { + name = "last-name" + type = "S" + } +} diff --git a/modules/dynamodb/outputs.tf b/modules/dynamodb/outputs.tf new file mode 100644 index 0000000..541c269 --- /dev/null +++ b/modules/dynamodb/outputs.tf @@ -0,0 +1,3 @@ +output "arn-value" { + value = aws_dynamodb_table.dynamodb-table-test.arn +} diff --git a/modules/dynamodb/variables.tf b/modules/dynamodb/variables.tf new file mode 100644 index 0000000..8dcb01d --- /dev/null +++ b/modules/dynamodb/variables.tf @@ -0,0 +1,9 @@ +variable "dynamodb-name" { + default = "dynamodb-table-chetana" +} +variable "hashkey-name" { + default = "name-one" +} +variable "rangekey-name" { + default = "anme-two" +} diff --git a/modules/s3module/outputs.tf b/modules/s3module/outputs.tf new file mode 100644 index 0000000..87323fa --- /dev/null +++ b/modules/s3module/outputs.tf @@ -0,0 +1,3 @@ +output "arn-value" { + value = aws_s3_bucket.s3-bucket.arn +} diff --git a/modules/s3module/s3.tf b/modules/s3module/s3.tf new file mode 100644 index 0000000..a2bc88a --- /dev/null +++ b/modules/s3module/s3.tf @@ -0,0 +1,8 @@ +resource "aws_s3_bucket" "s3-bucket" { + bucket = var.bucket-name + + tags = { + Name = "s3-bucket-test" + } + force_destroy = true +} diff --git a/modules/s3module/variables.tf b/modules/s3module/variables.tf new file mode 100644 index 0000000..6d4d900 --- /dev/null +++ b/modules/s3module/variables.tf @@ -0,0 +1,3 @@ +variable "bucket-name" { + default = "s3-bucket-1225221" +}