-
Notifications
You must be signed in to change notification settings - Fork 8
DEV-14278, DEV-14279 Address tfsec warnings and make example more complete. #11
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * @Datatamer/devops @Datatamer/ci-team |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| postgres_db_name = "example_postgres_db" | ||
| vpc_id = "vpc-example" | ||
| subnet_ids = ["subnet-az1", "subnet-az2"] | ||
| spark_service_access_sg_ids = ["example-spark-service-access-sg"] | ||
| tamr_vm_sg_id = "example-tamr-vm-sg" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,18 @@ | ||
| module "rds_postgres" { | ||
| source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=0.3.0" | ||
| postgres_name = "example_rds_postgres" | ||
| # source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=0.3.0" | ||
| source = "../.." | ||
|
|
||
| identifier_prefix = "example-rds-pg-" | ||
| postgres_name = "example0" | ||
| parameter_group_name = "example-rds-postgres-pg" | ||
| identifier_prefix = "example-rds-" | ||
| username = "example-tamr-master" | ||
| password = "foo" #tfsec:ignore:GEN003 | ||
|
|
||
| username = "exampleUsername" | ||
| password = "examplePassword" | ||
| vpc_id = var.vpc_id | ||
| subnet_group_name = "example_subnet_group" | ||
| # Network requirement: DB subnet group needs a subnet in at least two Availability Zones | ||
| rds_subnet_ids = var.subnet_ids | ||
|
|
||
| subnet_group_name = "example_subnet" | ||
| rds_subnet_ids = ["example-subnet-1", "example-subnet-2"] | ||
| spark_cluster_sg_ids = ["sg-examplesecuritygroup1", "sg-examplesecuritygroup2"] | ||
| tamr_vm_sg_id = "sg-exampletamrsecuritygroup" | ||
| vpc_id = "vpc-examplevpcnetworkid" | ||
| spark_cluster_sg_ids = var.spark_service_access_sg_ids | ||
| tamr_vm_sg_id = var.tamr_vm_sg_id | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,19 @@ | ||
| variable "postgres_db_name" { | ||
| variable "vpc_id" { | ||
| type = string | ||
| description = "Name of the postgres db" | ||
| description = "VPC ID of network." | ||
| } | ||
|
|
||
| variable "parameter_group_name" { | ||
| type = string | ||
| description = "Name of the parameter group" | ||
| variable "subnet_ids" { | ||
| type = list(string) | ||
| description = "List of at least 2 subnets in different AZs for DB subnet group" | ||
| } | ||
|
|
||
| variable "identifier_prefix" { | ||
| type = string | ||
| description = "Identifier prefix for the resources" | ||
| } | ||
|
|
||
| variable "pg_username" { | ||
| type = string | ||
| description = "Username for postgres" | ||
| variable "spark_service_access_sg_ids" { | ||
| type = list(string) | ||
| description = "List of Spark service access security group IDs to allow ingress from" | ||
| } | ||
|
|
||
| variable "pg_password" { | ||
| variable "tamr_vm_sg_id" { | ||
| type = string | ||
| description = "Password for postgres" | ||
| description = "Security group ID of Tamr VM to allow ingress from" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ resource "aws_security_group" "rds_postgres_sg" { | |
| } | ||
|
|
||
| resource "aws_security_group_rule" "tamr_vm" { | ||
| description = "Rule for ingress from Tamr VM to Postgres" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Idea for future improvement (out of scope for this ticket): Could probably just take a list that includes both.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| from_port = 5432 | ||
| protocol = "tcp" | ||
| security_group_id = aws_security_group.rds_postgres_sg.id | ||
|
|
@@ -15,6 +16,7 @@ resource "aws_security_group_rule" "tamr_vm" { | |
| } | ||
|
|
||
| resource "aws_security_group_rule" "spark_cluster" { | ||
| description = "Rule for ingress from Spark cluster to Postgres" | ||
| count = length(var.spark_cluster_sg_ids) | ||
| from_port = 5432 | ||
| protocol = "tcp" | ||
|
|
@@ -25,6 +27,7 @@ resource "aws_security_group_rule" "spark_cluster" { | |
| } | ||
|
|
||
| resource "aws_security_group_rule" "additional_cidrs" { | ||
| description = "Rule for ingress from additional CIDRs to Postgres" | ||
| count = length(var.additional_cidrs) == 0 ? 0 : 1 | ||
| from_port = 5432 | ||
| protocol = "tcp" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good choice, since I think this is actually too short of a password to be accepted by RDS (maybe I'm thinking of something else though)