Skip to content

Commit

Permalink
Parameterizing database name to account for some issues in scratch (#944
Browse files Browse the repository at this point in the history
)

* Parameterizing database name to account for some issues in scratch

* formatting variables
  • Loading branch information
ben851 authored Sep 26, 2023
1 parent 9cdaea8 commit ecd9cfd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aws/rds/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ resource "aws_rds_cluster" "notification-canada-ca" {
cluster_identifier = "notification-canada-ca-${var.env}-cluster"
engine = "aurora-postgresql"
engine_version = 11.9
database_name = "NotificationCanadaCa${var.env}"
database_name = var.rds_database_name
final_snapshot_identifier = "server-${random_string.random.result}"
master_username = "postgres"
master_password = var.rds_cluster_password
Expand Down
6 changes: 6 additions & 0 deletions aws/rds/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ variable "enable_delete_protection" {
type = bool
description = "Sets whether or not to enable delete protection."
default = true
}

variable "rds_database_name" {
type = string
description = "Set the name of the database"

}
1 change: 1 addition & 0 deletions env/production/rds/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ inputs = {
rds_instance_type = "db.r6g.large"
vpc_private_subnets = dependency.common.outputs.vpc_private_subnets
sns_alert_general_arn = dependency.common.outputs.sns_alert_general_arn
rds_database_name = "NotificationCanadaCaproduction"
}
1 change: 1 addition & 0 deletions env/scratch/rds/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ inputs = {
rds_instance_type = "db.t3.medium"
vpc_private_subnets = dependency.common.outputs.vpc_private_subnets
sns_alert_general_arn = dependency.common.outputs.sns_alert_general_arn
rds_database_name = "notificationcanadacascratch"
}

terraform {
Expand Down
1 change: 1 addition & 0 deletions env/staging/rds/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ inputs = {
rds_instance_type = "db.r6g.large"
vpc_private_subnets = dependency.common.outputs.vpc_private_subnets
sns_alert_general_arn = dependency.common.outputs.sns_alert_general_arn
rds_database_name = "NotificationCanadaCastaging"
}

terraform {
Expand Down

0 comments on commit ecd9cfd

Please sign in to comment.