-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creates an RDS cluster param group for MD5 encryption
Updates the existing param group module so we can create a separate param group for the DWH db cluster that has MD5 encryption as the password param. This change is required when using AWS Glue which uses a JDBC driver which in turn uses MD5 for its password. At present will only be using Glue to connect to the DWH cluster
- Loading branch information
1 parent
57b633c
commit f5c0bbb
Showing
4 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
output "aurora_pg_param_group_name" { | ||
value = resource.aws_rds_cluster_parameter_group.rds_aurora.name | ||
value = aws_rds_cluster_parameter_group.rds_aurora.name | ||
} | ||
|
||
output "rds_pg_param_group_name" { | ||
value = resource.aws_db_parameter_group.rds_db.name | ||
value = try(aws_db_parameter_group.rds_db[0].name, "") | ||
} |
15 changes: 14 additions & 1 deletion
15
service-infrastructure/database_parameter_groups/parameter_groups.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
resource "aws_db_parameter_group" "rds_db" { | ||
count = var.has_rds == true ? 1 : 0 | ||
name = "rds-pg" | ||
family = "postgres14" | ||
} | ||
|
||
|
||
|
||
resource "aws_rds_cluster_parameter_group" "rds_aurora" { | ||
name = "aurora-pg" | ||
name = var.aurora_name | ||
family = "aurora-postgresql14" | ||
|
||
dynamic "parameter" { | ||
for_each = var.has_md_5_password == true ? [0] : [] | ||
content { | ||
name = "password_encryption" | ||
value = "MD5" | ||
} | ||
} | ||
|
||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
variable "has_md_5_password" { | ||
type = bool | ||
default = false | ||
} | ||
|
||
variable "aurora_name" { | ||
type = string | ||
default = "aurora-pg" | ||
} | ||
|
||
|
||
variable "has_rds" { | ||
type = bool | ||
default = true | ||
} |
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