Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Commit

Permalink
Use random_string resource for rds password.
Browse files Browse the repository at this point in the history
[#153526683]
  • Loading branch information
Genevieve LEsperance committed Dec 9, 2017
1 parent 3d90302 commit b0a6af9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rds.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
resource "random_string" "rds_password" {
length = 16
special = true
}

resource "aws_db_instance" "rds" {
allocated_storage = 100
instance_class = "${var.rds_instance_class}"
engine = "mysql"
engine_version = "5.6.35"
identifier = "${var.env_name}"
username = "${var.rds_db_username}"
password = "${md5(timestamp())}"
password = "${random_string.rds_password.result}"
db_subnet_group_name = "${aws_db_subnet_group.rds_subnet_group.name}"
publicly_accessible = false
vpc_security_group_ids = ["${aws_security_group.mysql_security_group.id}"]
Expand Down

0 comments on commit b0a6af9

Please sign in to comment.