Skip to content

Commit

Permalink
[PRMP-120] Remove terraform references to RDS database
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadIqbalAD-NHS committed Oct 23, 2024
1 parent 3ddba9d commit a84259a
Show file tree
Hide file tree
Showing 14 changed files with 6 additions and 381 deletions.
44 changes: 0 additions & 44 deletions terraform-db-roles/application-role.tf

This file was deleted.

6 changes: 1 addition & 5 deletions terraform-db-roles/data.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
data "aws_caller_identity" "current" {}

data "aws_ssm_parameter" "db_cluster_resource_id" { // TODO: PRMP-120 - May need removing
name = "/repo/${var.environment}/output/${var.repo_name}/db-resource-cluster-id"
}
data "aws_caller_identity" "current" {}
14 changes: 0 additions & 14 deletions terraform-db-roles/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,11 @@ provider "aws" {
region = var.region
}

provider "postgresql" { // TODO: PRMP-120 - REMOVE
host = var.db_host
port = var.db_port
database = var.db_name
username = var.db_username
password = var.db_password
connect_timeout = 15
superuser = false
}

terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.44.0"
}
postgresql = { // TODO: PRMP-120 - REMOVE
source = "cyrilgdn/postgresql"
version = "1.13.0"
}
}
}
79 changes: 0 additions & 79 deletions terraform-db-roles/migration-role.tf

This file was deleted.

11 changes: 1 addition & 10 deletions terraform-db-roles/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,9 @@ variable "repo_name" {
default = "prm-deductions-ehr-repository"
}

variable "db_port" { // TODO: PRMP-120 - REMOVE
type = string
default = "5432"
}

variable "component_name" {
type = string
default = "ehr-repo"
}

variable "environment" {}
variable "db_name" {} // TODO: PRMP-120 - REMOVE
variable "db_host" {} // TODO: PRMP-120 - REMOVE
variable "db_username" {} // TODO: PRMP-120 - REMOVE
variable "db_password" {} // TODO: PRMP-120 - REMOVE
variable "environment" {}
8 changes: 0 additions & 8 deletions terraform/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ data "aws_ssm_parameter" "private_zone_id" {
name = "/repo/${var.environment}/output/prm-deductions-infra/private-root-zone-id"
}

data "aws_ssm_parameter" "db-username" {
name = "/repo/${var.environment}/user-input/ehr-repo-db-username"
}

data "aws_ssm_parameter" "db-password" {
name = "/repo/${var.environment}/user-input/ehr-repo-db-password"
}

data "aws_ssm_parameter" "dynamodb_name" {
name = "/repo/${var.environment}/output/prm-deductions-infra/ehr-transfer-tracker-db-name"
}
6 changes: 1 addition & 5 deletions terraform/dev.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dns_name = "ehr-repo"
repo_name = "prm-deductions-ehr-repository"

node_env = "prod"
database_name = "deductions_db" // TODO: PRMP-120 - REMOVE

s3_bucket_name = "dev-ehr-repo-bucket"
s3_prev_bucket_name = "dev-ehr-repo"
Expand All @@ -14,7 +13,4 @@ task_memory = 512
port = 3000

service_desired_count = "1"
alb_deregistration_delay = 15

grant_access_through_vpn = true // TODO: PRMP-120 - REMOVE
enable_rds_cluster_deletion_protection = false // TODO: PRMP-120 - REMOVE
alb_deregistration_delay = 15
6 changes: 0 additions & 6 deletions terraform/ecs-task.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ locals {
{ name = "NODE_ENV", value = var.node_env },
{ name = "NHS_ENVIRONMENT", value = var.environment },
{ name = "S3_BUCKET_NAME", value = var.s3_bucket_name },
{ name = "DATABASE_NAME", value = aws_rds_cluster.db-cluster.database_name }, # TODO: PRMP-120 - Removed code references as part of PRMP-123, terraform needs removing as part of PRMP-120
{ name = "DATABASE_HOST", value = aws_rds_cluster.db-cluster.endpoint }, # TODO: PRMP-120 - Removed code references as part of PRMP-123, terraform needs removing as part of PRMP-120
{ name = "DATABASE_USER", value = var.application_database_user }, # TODO: PRMP-120 - Removed code references as part of PRMP-123, terraform needs removing as part of PRMP-120
{ name = "USE_AWS_RDS_CREDENTIALS", value = "true" }, # TODO: PRMP-120 - Removed code references as part of PRMP-123, terraform needs removing as part of PRMP-120
{ name = "AWS_REGION", value = var.region },
{ name = "SKIP_DB_MIGRATION", value = "true" }, # TODO: PRMP-120 - Removed code references as part of PRMP-123, terraform needs removing as part of PRMP-120
{ name = "USE_SSL_FOR_DB", value = "true" }, # TODO: PRMP-120 - Removed code references as part of PRMP-123, terraform needs removing as part of PRMP-120
{ name = "LOG_LEVEL", value = var.log_level },
{ name = "DYNAMODB_NAME", value = data.aws_ssm_parameter.dynamodb_name.value },
]
Expand Down
6 changes: 1 addition & 5 deletions terraform/perf.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ dns_name = "ehr-repo"
repo_name = "prm-deductions-ehr-repository"

node_env = "prod"
database_name = "deductions_db" // TODO: PRMP-120 - REMOVE

s3_bucket_name = "perf-ehr-repo-bucket"
s3_prev_bucket_name = "perf-ehr-repo"

port = 3000

service_desired_count = "2"
alb_deregistration_delay = 15

grant_access_through_vpn = true // TODO: PRMP-120 - REMOVE
enable_rds_cluster_deletion_protection = false // TODO: PRMP-120 - REMOVE
alb_deregistration_delay = 15
6 changes: 0 additions & 6 deletions terraform/pre-prod.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dns_name = "ehr-repo"
repo_name = "prm-deductions-ehr-repository"

node_env = "prod"
database_name = "deductions_db" // TODO: PRMP-120 - REMOVE

s3_bucket_name = "pre-prod-ehr-repo-bucket"
s3_prev_bucket_name = "pre-prod-ehr-repo"
Expand All @@ -16,10 +15,5 @@ service_desired_count = "3"
alb_deregistration_delay = 15
log_level = "info"

grant_access_through_vpn = true // TODO: PRMP-120 - REMOVE
enable_rds_cluster_deletion_protection = true // TODO: PRMP-120 - REMOVE

is_restricted_account = true

db_instance_number = 3 // TODO: PRMP-120 - REMOVE

8 changes: 1 addition & 7 deletions terraform/prod.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dns_name = "ehr-repo"
repo_name = "prm-deductions-ehr-repository"

node_env = "prod"
database_name = "deductions_db" // TODO: PRMP-120 - REMOVE

s3_bucket_name = "prod-ehr-repo-bucket"
s3_prev_bucket_name = "prod-ehr-repo"
Expand All @@ -16,9 +15,4 @@ service_desired_count = "3"
alb_deregistration_delay = 15
log_level = "info"

grant_access_through_vpn = true // TODO: PRMP-120 - REMOVE
enable_rds_cluster_deletion_protection = true // TODO: PRMP-120 - REMOVE

is_restricted_account = true

db_instance_number = 3 // TODO: PRMP-120 - REMOVE
is_restricted_account = true
Loading

0 comments on commit a84259a

Please sign in to comment.