Skip to content

Commit

Permalink
fix(aurora): fix db param group name (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-ook authored Aug 7, 2023
1 parent 6a99fa3 commit 18ba13b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion label.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resource "random_string" "iid" {
### frigga name
module "frigga" {
source = "Young-ook/spinnaker/aws//modules/frigga"
version = "2.3.5"
version = "3.0.0"
name = var.name == null || var.name == "" ? "rds" : var.name
petname = var.name == null || var.name == "" ? true : false
}
Expand Down
13 changes: 5 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ resource "aws_security_group" "db" {

### network/subnets
resource "aws_db_subnet_group" "db" {
name = format("%s-db", local.name)
name = local.name
subnet_ids = var.subnets
tags = merge(local.default-tags, var.tags)
}

### database/parameters
resource "aws_rds_cluster_parameter_group" "db" {
name = format("%s-db-cluster-params", local.name)
tags = merge(local.default-tags, var.tags)

name = local.name
tags = merge(local.default-tags, var.tags)
family = lookup(var.aurora_cluster, "family", local.default_cluster.family)
dynamic "parameter" {
for_each = lookup(var.aurora_cluster, "cluster_parameters", local.default_cluster.cluster_parameters)
Expand All @@ -67,11 +66,9 @@ resource "aws_rds_cluster_parameter_group" "db" {

resource "aws_db_parameter_group" "db" {
for_each = { for key, val in var.aurora_instances : key => val }
name = format("%s-db-instance-%s-params", local.name, each.key)
name = join("-", [local.name, random_string.iid[each.key].result])
tags = merge(local.default-tags, var.tags)


family = lookup(var.aurora_cluster, "family", local.default_cluster.family)
family = lookup(var.aurora_cluster, "family", local.default_cluster.family)
dynamic "parameter" {
for_each = lookup(var.aurora_instances[each.key], "instance_parameters", local.default_instances.0.instance_parameters)
content {
Expand Down

0 comments on commit 18ba13b

Please sign in to comment.