Skip to content
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
1 change: 0 additions & 1 deletion terraform/modules/database/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ data "aws_secretsmanager_secret" "rds_master_secret" {
# RDS does not support secret-manager, have to provide the actual string
data "aws_secretsmanager_secret_version" "rds_master_secret" {
secret_id = data.aws_secretsmanager_secret.rds_master_secret.name
depends_on = [data.aws_secretsmanager_secret.rds_master_secret]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you have applied that multiple times and it still keeps generating new ones?

@bmonkman yeah, i have finally been able to pin point the problem, its the depends_on
not sure I understand why though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and i added it trying to solve the initial creation where it errors out saying
AWSCURRENT version not found or something along the lines of that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That shouldn't require depends_on because the line above it already creates an explicit dependency. Weird that it would cause (or fix) any problems though...

}

module "rds" {
Expand Down
4 changes: 4 additions & 0 deletions terraform/modules/secret/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ resource "aws_secretsmanager_secret_version" "random_secret" {
}

resource "random_password" "random" {
# this allows terraform state to have an identifier for generated passwords
keepers = {
aws_secret = var.name_prefix
}
count = var.type == "random" ? 1 : 0
length = var.random_length
special = true
Expand Down