Skip to content

Commit

Permalink
Merge pull request #12 from tablexi/parameter_group_provided
Browse files Browse the repository at this point in the history
ADD rds parameter group provided var
  • Loading branch information
phoolish authored Nov 20, 2017
2 parents cf305a5 + 2f37d8c commit 878fdfa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
17 changes: 17 additions & 0 deletions rds/example/parameter_group_provided.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module "rds-parameter-group-provided" {
source = "../"

engine = "postgres"
name = "rds-parameter-group-provided"
parameter_group_name = "${aws_db_parameter_group.parameter-group-provided.id}"
parameter_group_provided = true
subnets = ["rds-parameter-group-provided"]
version = "9.6"
vpc_id = "rds-parameter-group-provided"
}

resource "aws_db_parameter_group" "parameter-group-provided" {
name = "parameter-group-provided"
family = "parameter-group-provided"
description = "parameter-group-provided"
}
2 changes: 1 addition & 1 deletion rds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resource "aws_db_subnet_group" "mod" {
}

resource "aws_db_parameter_group" "mod" {
count = "${var.parameter_group_name != "" ? 0 : 1}"
count = "${var.parameter_group_provided ? 0 : 1}"
name = "${local.parameter_group_name}"
family = "${local.family}"
description = "${local.family} parameter group for ${var.name} ${var.env}"
Expand Down
5 changes: 5 additions & 0 deletions rds/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ variable "parameter_group_name" {
default = ""
}

variable "parameter_group_provided" {
description = "If the parameter_group_name is provided, must be set to true."
default = false
}

variable "port" {
description = "Override the default port"
default = ""
Expand Down

0 comments on commit 878fdfa

Please sign in to comment.