From d92ff1b0af6663ae5d97fc4e041789aec44e75ae Mon Sep 17 00:00:00 2001 From: Russell Gilmore Date: Tue, 17 Jun 2025 15:22:24 -0400 Subject: [PATCH] Removed dynamodb --- README.md | 1 - red-backend/main.tf | 37 +++---------------------------------- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 51afbc1..ec7b077 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ No modules. | Name | Type | |------|------| -| [aws_dynamodb_table.ddb_lock_status_table](https://registry.terraform.io/providers/hashicorp/aws/6.0.0-beta1/docs/resources/dynamodb_table) | resource | | [aws_iam_policy.s3_ddb_policy](https://registry.terraform.io/providers/hashicorp/aws/6.0.0-beta1/docs/resources/iam_policy) | resource | | [aws_s3_bucket.backend_s3](https://registry.terraform.io/providers/hashicorp/aws/6.0.0-beta1/docs/resources/s3_bucket) | resource | | [aws_s3_bucket_public_access_block.s3_public_access_block](https://registry.terraform.io/providers/hashicorp/aws/6.0.0-beta1/docs/resources/s3_bucket_public_access_block) | resource | diff --git a/red-backend/main.tf b/red-backend/main.tf index 3e4db23..417671d 100644 --- a/red-backend/main.tf +++ b/red-backend/main.tf @@ -53,31 +53,10 @@ resource "aws_s3_bucket_public_access_block" "s3_public_access_block" { restrict_public_buckets = true } -# DynamoDB table for Terraform state lock -# trivy:ignore:AVD-AWS-0025 -resource "aws_dynamodb_table" "ddb_lock_status_table" { - name = "${var.project_name}-tf-lock-status" - billing_mode = "PAY_PER_REQUEST" - hash_key = "LockID" - - attribute { - name = "LockID" - type = "S" - } - - server_side_encryption { - enabled = true - } - - point_in_time_recovery { - enabled = true - } -} - -# IAM policy to access the S3 bucket and DynamoDB table +# IAM policy to access the S3 bucket resource "aws_iam_policy" "s3_ddb_policy" { name = "${var.project_name}-Backend-Resource-Policy" - description = "IAM policy to access the S3 bucket and DynamoDB table" + description = "IAM policy to access the S3 bucket" policy = jsonencode({ Version = "2012-10-17" @@ -94,16 +73,6 @@ resource "aws_iam_policy" "s3_ddb_policy" { "s3:PutObject" ] Resource = ["arn:${data.aws_partition.current.partition}:s3:::${aws_s3_bucket.backend_s3.id}/*"] - }, - { - Effect = "Allow" - Action = [ - "dynamodb:DescribeTable", - "dynamodb:GetItem", - "dynamodb:PutItem", - "dynamodb:DeleteItem" - ] - Resource = ["arn:${data.aws_partition.current.partition}:dynamodb:*:*:table/${aws_dynamodb_table.ddb_lock_status_table.id}"] - }] + }, ] }) }