Skip to content

Commit

Permalink
ADD rds parameter group provided var
Browse files Browse the repository at this point in the history
  • Loading branch information
phoolish committed Nov 19, 2017
1 parent 2798944 commit 2f37d8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions rds/example/parameter_group_provided.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module "rds-parameter-group-provided" {
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"
Expand Down
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 2f37d8c

Please sign in to comment.