From 818e9cfd4640eac57dfde3c720a383650247fbc5 Mon Sep 17 00:00:00 2001 From: Daphne Gold Date: Tue, 22 Aug 2023 11:35:56 -0700 Subject: [PATCH] Delete all database tf for frontend, unnecessary --- infra/frontend/database/example.tfvars | 2 - infra/frontend/database/main.tf | 72 -------------------------- infra/frontend/database/outputs.tf | 3 -- infra/frontend/database/variables.tf | 8 --- 4 files changed, 85 deletions(-) delete mode 100644 infra/frontend/database/example.tfvars delete mode 100644 infra/frontend/database/main.tf delete mode 100644 infra/frontend/database/outputs.tf delete mode 100644 infra/frontend/database/variables.tf diff --git a/infra/frontend/database/example.tfvars b/infra/frontend/database/example.tfvars deleted file mode 100644 index 757d768ac..000000000 --- a/infra/frontend/database/example.tfvars +++ /dev/null @@ -1,2 +0,0 @@ -environment_name = "" -region = "" diff --git a/infra/frontend/database/main.tf b/infra/frontend/database/main.tf deleted file mode 100644 index fd43c3f3b..000000000 --- a/infra/frontend/database/main.tf +++ /dev/null @@ -1,72 +0,0 @@ -# TODO(https://github.com/navapbc/template-infra/issues/152) use non-default VPC -data "aws_vpc" "default" { - default = true -} - -# TODO(https://github.com/navapbc/template-infra/issues/152) use private subnets -data "aws_subnets" "default" { - filter { - name = "default-for-az" - values = [true] - } -} - - -locals { - # The prefix key/value pair is used for Terraform Workspaces, which is useful for projects with multiple infrastructure developers. - # By default, Terraform creates a workspace named “default.” If a non-default workspace is not created this prefix will equal “default”, - # if you choose not to use workspaces set this value to "dev" - prefix = terraform.workspace == "default" ? "" : "${terraform.workspace}-" - - # Add environment specific tags - tags = merge(module.project_config.default_tags, { - environment = var.environment_name - description = "Database resources for the ${var.environment_name} environment" - }) - - environment_config = module.app_config.environment_configs[var.environment_name] - database_config = local.environment_config.database_config -} - -terraform { - required_version = ">=1.4.0" - - required_providers { - aws = { - source = "hashicorp/aws" - version = "~>4.67.0" - } - } - - backend "s3" { - encrypt = "true" - } -} - -provider "aws" { - region = var.region - default_tags { - tags = local.tags - } -} - -module "project_config" { - source = "../../project-config" -} - -module "app_config" { - source = "../app-config" -} - -module "database" { - source = "../../modules/database" - - name = "${local.prefix}${local.database_config.cluster_name}" - access_policy_name = "${local.prefix}${local.database_config.access_policy_name}" - app_username = "${local.prefix}${local.database_config.app_username}" - migrator_username = "${local.prefix}${local.database_config.migrator_username}" - schema_name = "${local.prefix}${local.database_config.schema_name}" - - vpc_id = data.aws_vpc.default.id - private_subnet_ids = data.aws_subnets.default.ids -} diff --git a/infra/frontend/database/outputs.tf b/infra/frontend/database/outputs.tf deleted file mode 100644 index 927b820a9..000000000 --- a/infra/frontend/database/outputs.tf +++ /dev/null @@ -1,3 +0,0 @@ -output "role_manager_function_name" { - value = module.database.role_manager_function_name -} diff --git a/infra/frontend/database/variables.tf b/infra/frontend/database/variables.tf deleted file mode 100644 index 160a2bce8..000000000 --- a/infra/frontend/database/variables.tf +++ /dev/null @@ -1,8 +0,0 @@ -variable "environment_name" { - type = string - description = "name of the application environment" -} - -variable "region" { - type = string -}