Skip to content

Commit

Permalink
allow rds_security_group_id to be empty (#12)
Browse files Browse the repository at this point in the history
* allow rds_security_group_id to be empty

* Update variables.tf

Co-authored-by: meyerjrr <[email protected]>

* Update condition and add comments

---------

Co-authored-by: meyerjrr <[email protected]>
  • Loading branch information
JoshuaWilkes and meyerjrr authored Sep 25, 2024
1 parent 8026014 commit a94c200
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-fishes-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@common-fate/terraform-commonfate-proxy-resource-rds": patch
---

Allow the rds_security_group_id to be empty when create_security_group_rule is false.
12 changes: 9 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ variable "app_url" {
}
}


variable "rds_security_group_id" {
description = "The security group attached with your RDS database."
type = string
}

default = ""

validation {
# when create_security_group_rule is false, a rds_security_group_id is not required, it can either have a value or be empty
# when create_security_group_rule is true, rds_security_group_id must not be empty
condition = var.create_security_group_rule == false || length(var.rds_security_group_id) > 0
error_message = "rds_security_group_id must not be empty when create_security_group_rule is true."
}
}

variable "rds_instance_identifier" {
description = "The identifier of the rds instance."
Expand Down Expand Up @@ -64,6 +69,7 @@ variable "users" {

}


variable "create_security_group_rule" {
description = "If 'true', will create a rule allowing ingress from the proxy to the database security group. The database security group is specified by the 'rds_security_group_id' variable."
type = bool
Expand Down

0 comments on commit a94c200

Please sign in to comment.