Skip to content

Addresses Issue #89 by adding support for optional RDS SG ingress CIDR #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = []
}