Skip to content

Terraform module for terraform-aws-rds-postgres

License

Notifications You must be signed in to change notification settings

Datatamer/terraform-aws-rds-postgres

Folders and files

NameName
Last commit message
Last commit date
Jul 16, 2021
Mar 14, 2024
Mar 14, 2024
Mar 14, 2024
Mar 14, 2024
Mar 8, 2022
Mar 14, 2024
Jun 22, 2020
Mar 20, 2020
Jul 6, 2020
Sep 6, 2022
Mar 14, 2024
Mar 14, 2024
Mar 14, 2024
Sep 6, 2022
Mar 14, 2024

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=x.y.z"
  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

Requirements

Name Version
terraform >= 0.13
aws >= 3.36, !=4.0.0, !=4.1.0, !=4.2.0, !=4.3.0, !=4.4.0, !=4.5.0, !=4.6.0, !=4.7.0, !=4.8.0

Providers

Name Version
aws >= 3.36, !=4.0.0, !=4.1.0, !=4.2.0, !=4.3.0, !=4.4.0, !=4.5.0, !=4.6.0, !=4.7.0, !=4.8.0

Inputs

Name Description Type Default Required
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
security_group_ids List of security group IDs to associate list(string) n/a yes
subnet_group_name The name of the subnet group to add the RDS instance to string n/a yes
additional_tags [DEPRECATED: Use tags instead] 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
auto_minor_version_upgrade Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window bool true 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
enabled_cloudwatch_logs_exports Indicates that postgresql logs will be configured to be sent automatically to Cloudwatch bool true no
engine_version Version of RDS Postgres string "12" 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
multi_az Specifies if the RDS instance is multi-AZ. bool true no
param_log_min_duration_statement (ms) Sets the minimum execution time above which statements will be logged. string "-1" no
param_log_statement Sets the type of statements logged. Valid values are none, ddl, mod, all string "none" 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
performance_insights_enabled Specifies whether Performance Insights are enabled. bool false no
performance_insights_retention_period The amount of time in days to retain Performance Insights data. Either 7 (7 days) or 731 (2 years). number 7 no
postgres_name The name of the postgres database to create on the DB instance string "tamr_rds_db" no
skip_final_snapshot Skip final snapshot bool true no
storage_type Storage type (e.g. gp2, io1) string "gp2" no
tags A map of tags to add to all resources. Replaces additional_tags. map(string) {} no
username The username for the master DB user. string "tamr" no

Outputs

Name Description
cloudwatch_logs_path n/a
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_security_group_ids List of security group ids 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.