Skip to content

Commit

Permalink
Addresses Issue outerbounds#89 by adding support for optional RDS SG …
Browse files Browse the repository at this point in the history
…ingress CIDR
  • Loading branch information
cstano-attn committed Mar 1, 2024
1 parent ee7093c commit 4da88ed
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module "metaflow-datastore" {
resource_suffix = local.resource_suffix

metadata_service_security_group_id = module.metaflow-metadata-service.metadata_service_security_group_id
rds_sg_ingress_cidr = var.rds_sg_ingress_cidr
metaflow_vpc_id = var.vpc_id
subnet1_id = var.subnet1_id
subnet2_id = var.subnet2_id
Expand Down
7 changes: 7 additions & 0 deletions modules/datastore/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ resource "aws_security_group" "rds_security_group" {
security_groups = [var.metadata_service_security_group_id]
}

ingress {
from_port = 5432
to_port = 5432
protocol = "tcp"
cidr_blocks = var.rds_sg_ingress_cidr
}

# egress to anywhere
egress {
from_port = 0
Expand Down
6 changes: 6 additions & 0 deletions modules/datastore/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@ variable "enable_key_rotation" {
description = "Enable key rotation for KMS keys"
default = false
}

variable "rds_sg_ingress_cidr" {
type = list(string)
description = "Add additional ingress CIDR access rules to RDS SG"
default = []
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,9 @@ variable "enable_key_rotation" {
description = "Enable key rotation for KMS keys"
default = false
}

variable "rds_sg_ingress_cidr" {
type = list(string)
description = "Add additional ingress CIDR access rules to RDS SG"
default = []
}

0 comments on commit 4da88ed

Please sign in to comment.