Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made some changes for db password #6687

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}