Skip to content

pkuber-tamr/terraform-aws-rds-postgres

 
 

Repository files navigation

Tamr AWS RDS Terraform Module

This terraform module creates an AWS RDS postgres instance that will be used by TAMR. This repo follows the terraform standard module structure.

Examples

Basic

Inline example implementation of the module. This is the most basic example of what it would look like to use this module.

module "rds_postgres" {
  source               = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=0.4.0"
  postgres_name        = "example_rds_postgres"
  parameter_group_name = "example-rds-postgres-pg"
  identifier_prefix    = "example-rds-"
  username             = "exampleUsername"
  password             = "examplePassword"

  subnet_group_name    = "example_subnet"
  rds_subnet_ids       = ["example-subnet-1", "example-subnet-2"]
  ingress_sg_ids       = ["sg-sparksecuritygroup1", "sg-sparksecuritygroup2", "sg-tamrvmsecuritygroup"]
  vpc_id               = "vpc-examplevpcnetworkid"
}

Minimal

Smallest complete fully working example. This example might require extra resources to run the example.

Resources Created

This terraform module will create:

  • an AWS RDS Postgres instance
  • a database parameter group
  • a database subnet group
  • a security group for the rds instance

Requirements

Name Version
terraform >= 0.13
aws >= 3.36.0

Providers

Name Version
aws >= 3.36.0

Inputs

Name Description Type Default Required
ingress_sg_ids List of security group IDs to allow ingress from (i.e. Spark cluster SG IDs, Tamr VM SG ID) list(string) n/a yes
password The password for the master DB user. string n/a yes
rds_subnet_ids VPC subnet IDs in subnet group list(string) n/a yes
subnet_group_name The name of the subnet group to add the RDS instance to string n/a yes
vpc_id VPC ID for the rds security group string n/a yes
additional_cidrs Additional CIDR to connect to RDS Postgres instance list(string) [] no
additional_tags Additional tags to set on the RDS instance map(string) {} no
allocated_storage Allocate storage number 20 no
apply_immediately Apply immediately, do not set this to true for production bool false no
backup_retention_period Backup retention period in days number 14 no
backup_window Backup window string "03:29-03:59" no
copy_tags_to_snapshot Copy tags to snapshots bool true no
db_port The port on which the database accepts connections. number 5432 no
engine_version Version of RDS Postgres string "12.3" no
identifier_prefix Identifier prefix for the RDS instance string "tamr-rds-" no
instance_class Instance class string "db.m4.large" no
maintenance_window Maintenance window string "sun:04:32-sun:05:02" no
max_allocated_storage Max allocate storage number 1000 no
parameter_group_family The family of the DB parameter group string "postgres12" no
parameter_group_name The name of the rds parameter group string "rds-postgres-pg" no
postgres_name The name of the postgres database to create on the DB instance string "tamr_rds_db" no
security_group_name Name for the security group for the rds instance string "tamr_rds_sg" no
skip_final_snapshot Skip final snapshot bool true no
storage_type Storage type (e.g. gp2, io1) string "gp2" no
username The username for the master DB user. string "tamr" no

Outputs

Name Description
rds_db_port n/a
rds_dbname n/a
rds_hostname n/a
rds_postgres_id ID of the of the RDS instance
rds_postgres_pg_id ID of the RDS postgres parameter group
rds_sg_id ID of the security group attached to the rds instance
rds_username n/a

References

Development

Releasing new versions

  • Updated version contained in VERSION
  • Documented changes in CHANGELOG.md
  • Create a tag in github for the commit associated with the version

License

Apache 2 Licensed. See LICENSE for full details.

About

Terraform module for terraform-aws-rds-postgres

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 89.5%
  • Makefile 10.5%