Skip to content

Commit

Permalink
Merge pull request #119 from dxw/fix-rds-indentifier-regex-check
Browse files Browse the repository at this point in the history
Fix RDS identifier regex check
  • Loading branch information
Stretch96 authored Jun 28, 2024
2 parents 5a3b1e4 + e6c6249 commit fb2fcb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rds-infrastructure-instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ resource "aws_db_instance" "infrastructure_rds" {
for k, v in local.infrastructure_rds : k => v if v["type"] == "instance"
} : {}

identifier = "${regex("^[0-9]", substr(local.resource_prefix_hash, 0, 1)) != null ? "h" : ""}${local.resource_prefix_hash}-${each.key}"
identifier = "${length(regexall("^[0-9]", substr(local.resource_prefix_hash, 0, 1))) > 0 ? "h" : ""}${local.resource_prefix_hash}-${each.key}"
engine = local.rds_engines[each.value["type"]][each.value["engine"]]
engine_version = each.value["engine_version"]
allow_major_version_upgrade = false
Expand All @@ -62,7 +62,7 @@ resource "aws_db_instance" "infrastructure_rds" {
backup_window = "22:00-23:59"
copy_tags_to_snapshot = true
skip_final_snapshot = false
final_snapshot_identifier = "${regex("^[0-9]", substr(local.resource_prefix_hash, 0, 1)) != null ? "h" : ""}${local.resource_prefix_hash}-${each.key}-final"
final_snapshot_identifier = "${length(regexall("^[0-9]", substr(local.resource_prefix_hash, 0, 1))) > 0 ? "h" : ""}${local.resource_prefix_hash}-${each.key}-final"
backup_retention_period = 35

monitoring_interval = each.value["monitoring_interval"]
Expand Down

0 comments on commit fb2fcb5

Please sign in to comment.