Created
August 16, 2021 01:40
-
-
Save MikeZ77/12b1a23c297c66ed1521709e971fd289 to your computer and use it in GitHub Desktop.
RDS Proxy Secrets Manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_secretsmanager_secret" "rds_secret" { | |
name_prefix = "rds-proxy-secret" | |
recovery_window_in_days = 7 | |
description = "Secret for RDS Proxy" | |
} | |
resource "aws_secretsmanager_secret_version" "rds_secret_version" { | |
secret_id = aws_secretsmanager_secret.rds_secret.id | |
secret_string = jsonencode({ | |
"username" = "my_username" | |
"password" = "my_password" | |
"engine" = "mysql" | |
"host" = aws_db_instance.database.address | |
"port" = 3306 | |
"dbInstanceIdentifier" = aws_db_instance.database.id | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment