Skip to content

Commit

Permalink
Merge pull request #6687 from ministryofjustice/LogGroupAndDBPassword…
Browse files Browse the repository at this point in the history
…SecretErrorFix

Made some changes for db password
  • Loading branch information
fshafaatmoj authored Jun 21, 2024
2 parents 7b5acca + f96d5b5 commit 002816f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion terraform/environments/cdpt-ifs/database.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "aws_db_instance" "database" {
instance_class = local.application_data.accounts[local.environment].db_instance_class
identifier = local.application_data.accounts[local.environment].db_instance_identifier
username = local.application_data.accounts[local.environment].db_user
password = aws_secretsmanager_secret_version.db_password.secret_string
password = aws_secretsmanager_secret_version.dbase_password.secret_string
vpc_security_group_ids = [aws_security_group.db.id]
depends_on = [aws_security_group.db]
snapshot_identifier = local.application_data.accounts[local.environment].db_snapshot_identifier
Expand Down
2 changes: 1 addition & 1 deletion terraform/environments/cdpt-ifs/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ resource "aws_ecs_task_definition" "ifs_task_definition" {
secrets = [
{
name : "RDS_PASSWORD",
valueFrom : aws_secretsmanager_secret_version.db_password.arn
valueFrom : aws_secretsmanager_secret_version.dbase_password.arn
}
],
}
Expand Down
8 changes: 4 additions & 4 deletions terraform/environments/cdpt-ifs/secrets.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
resource "aws_secretsmanager_secret" "db_password" {
name = "database_password"
resource "aws_secretsmanager_secret" "dbase_password" {
name = "dbase_password"
}

resource "random_password" "password_long" {
length = 32
special = false
}

resource "aws_secretsmanager_secret_version" "db_password" {
secret_id = aws_secretsmanager_secret.db_password.id
resource "aws_secretsmanager_secret_version" "dbase_password" {
secret_id = aws_secretsmanager_secret.dbase_password.id
secret_string = random_password.password_long.result
}

0 comments on commit 002816f

Please sign in to comment.