Skip to content

Commit 4da88ed

Browse files
committed
Addresses Issue outerbounds#89 by adding support for optional RDS SG ingress CIDR
1 parent ee7093c commit 4da88ed

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module "metaflow-datastore" {
88
resource_suffix = local.resource_suffix
99

1010
metadata_service_security_group_id = module.metaflow-metadata-service.metadata_service_security_group_id
11+
rds_sg_ingress_cidr = var.rds_sg_ingress_cidr
1112
metaflow_vpc_id = var.vpc_id
1213
subnet1_id = var.subnet1_id
1314
subnet2_id = var.subnet2_id

modules/datastore/rds.tf

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ resource "aws_security_group" "rds_security_group" {
3131
security_groups = [var.metadata_service_security_group_id]
3232
}
3333

34+
ingress {
35+
from_port = 5432
36+
to_port = 5432
37+
protocol = "tcp"
38+
cidr_blocks = var.rds_sg_ingress_cidr
39+
}
40+
3441
# egress to anywhere
3542
egress {
3643
from_port = 0

modules/datastore/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,9 @@ variable "enable_key_rotation" {
7171
description = "Enable key rotation for KMS keys"
7272
default = false
7373
}
74+
75+
variable "rds_sg_ingress_cidr" {
76+
type = list(string)
77+
description = "Add additional ingress CIDR access rules to RDS SG"
78+
default = []
79+
}

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,9 @@ variable "enable_key_rotation" {
199199
description = "Enable key rotation for KMS keys"
200200
default = false
201201
}
202+
203+
variable "rds_sg_ingress_cidr" {
204+
type = list(string)
205+
description = "Add additional ingress CIDR access rules to RDS SG"
206+
default = []
207+
}

0 commit comments

Comments
 (0)