Skip to content

Commit 873348b

Browse files
Allowing adding extra SGs for the cluster (#9)
1 parent 17b8b9f commit 873348b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ resource "aws_rds_cluster" "main" {
3434
preferred_maintenance_window = "${var.preferred_maintenance_window}"
3535
port = "${local.port}"
3636
db_subnet_group_name = "${aws_db_subnet_group.main.name}"
37-
vpc_security_group_ids = ["${aws_security_group.main.id}"]
37+
vpc_security_group_ids = ["${concat(list(aws_security_group.main.id), var.extra_security_groups)}"]
3838
snapshot_identifier = "${var.snapshot_identifier}"
3939
storage_encrypted = "${var.storage_encrypted}"
4040
apply_immediately = "${var.apply_immediately}"

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ variable "allowed_security_groups" {
3434
default = []
3535
}
3636

37+
variable "extra_security_groups" {
38+
description = "A list of Security Group IDs to add to the cluster"
39+
default = []
40+
}
41+
3742
variable "vpc_id" {
3843
description = "VPC ID"
3944
type = "string"

0 commit comments

Comments
 (0)