From 176dd6213e2c8c04b3494fad583f7d091612b136 Mon Sep 17 00:00:00 2001 From: Matt Jarrett <16245634+cujarrett@users.noreply.github.com> Date: Sun, 2 Jan 2022 19:39:04 -0600 Subject: [PATCH] feat: removes legacy tables (#273) * feat: removes legacy databases --- terraform/main.tf | 2 - terraform/modules/dynamodb/main.tf | 122 +---------------------------- terraform/modules/iam/main.tf | 52 ------------ terraform/modules/iam/variables.tf | 10 --- 4 files changed, 1 insertion(+), 185 deletions(-) diff --git a/terraform/main.tf b/terraform/main.tf index f7b9ca1..12a746d 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -9,8 +9,6 @@ module "dynamodb" { module "iam" { source = "./modules/iam" error_sns_topic = var.error_sns_topic - destiny_insights_mods_arn = module.dynamodb.destiny_insights_mods_arn - destiny_insights_xur_arn = module.dynamodb.destiny_insights_xur_arn destiny_insights_items_arn = module.dynamodb.destiny_insights_items_arn parameter_store_twitter_auth_arn = var.parameter_store_twitter_auth_arn } diff --git a/terraform/modules/dynamodb/main.tf b/terraform/modules/dynamodb/main.tf index c809416..adc08bb 100644 --- a/terraform/modules/dynamodb/main.tf +++ b/terraform/modules/dynamodb/main.tf @@ -1,119 +1,7 @@ -resource "aws_dynamodb_table" "destiny_insights_mods" { - name = "destiny-insights-mods" - billing_mode = "PROVISIONED" - read_capacity = 15 - write_capacity = 2 - hash_key = "key" - - point_in_time_recovery { - enabled = true - } - - attribute { - name = "key" - type = "S" - } - - attribute { - name = "timestamp" - type = "S" - } - - attribute { - name = "type" - type = "S" - } - - attribute { - name = "name" - type = "S" - } - - global_secondary_index { - name = "timestamp" - hash_key = "timestamp" - write_capacity = 2 - read_capacity = 2 - projection_type = "ALL" - } - - global_secondary_index { - name = "type" - hash_key = "type" - write_capacity = 2 - read_capacity = 2 - projection_type = "ALL" - } - - global_secondary_index { - name = "name" - hash_key = "name" - write_capacity = 2 - read_capacity = 2 - projection_type = "ALL" - } -} - -resource "aws_dynamodb_table" "destiny_insights_xur" { - name = "destiny-insights-xur" - billing_mode = "PROVISIONED" - read_capacity = 2 - write_capacity = 2 - hash_key = "key" - - point_in_time_recovery { - enabled = true - } - - attribute { - name = "key" - type = "S" - } - - attribute { - name = "timestamp" - type = "S" - } - - attribute { - name = "type" - type = "S" - } - - attribute { - name = "name" - type = "S" - } - - global_secondary_index { - name = "timestamp" - hash_key = "timestamp" - write_capacity = 2 - read_capacity = 2 - projection_type = "ALL" - } - - global_secondary_index { - name = "type" - hash_key = "type" - write_capacity = 2 - read_capacity = 2 - projection_type = "ALL" - } - - global_secondary_index { - name = "name" - hash_key = "name" - write_capacity = 2 - read_capacity = 2 - projection_type = "ALL" - } -} - resource "aws_dynamodb_table" "destiny_insights_items" { name = "destiny-insights-items" billing_mode = "PROVISIONED" - read_capacity = 20 + read_capacity = 35 write_capacity = 2 hash_key = "key" @@ -196,14 +84,6 @@ resource "aws_dynamodb_table" "destiny_insights_items" { } } -output "destiny_insights_mods_arn" { - value = aws_dynamodb_table.destiny_insights_mods.arn -} - -output "destiny_insights_xur_arn" { - value = aws_dynamodb_table.destiny_insights_xur.arn -} - output "destiny_insights_items_arn" { value = aws_dynamodb_table.destiny_insights_items.arn } diff --git a/terraform/modules/iam/main.tf b/terraform/modules/iam/main.tf index c573880..2e430c7 100644 --- a/terraform/modules/iam/main.tf +++ b/terraform/modules/iam/main.tf @@ -91,58 +91,6 @@ resource "aws_iam_role_policy_attachment" "attach_parameter_store" { policy_arn = aws_iam_policy.destiny_insights_bot_parameter_store.arn } -resource "aws_iam_policy" "destiny_insights_mods" { - name = "destiny-insights-mods-dynamodb" - description = "Adds DynamoDB access" - - policy = <