Skip to content

dashdevs/terraform-aws-rds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform rds module

Usage

IMPORTANT: We do not pin modules to versions in our examples because of the difficulty of keeping the versions in the documentation in sync with the latest released versions. We highly recommend that in your code you pin the version to the exact version you are using so that your infrastructure remains stable, and update versions in a systematic way so that they do not catch you by surprise.

example for RDS instance:

module "database" {
  source                    = "dashdevs/rds/aws"
  name                      = var.name_prefix
  rds_engine_version        = "15.4-R3"
  rds_subnets               = var.public_subnets
  rds_security_group_ids    = var.rds_security_group_ids
  rds_db_name               = var.rds_db_name
  rds_db_username           = var.rds_db_username
}

Requirements

Name Version
terraform >= 1.5.2
aws >= 3.34

Providers

Name Version
aws >= 3.34

Inputs

Name Description Type Default Required
name Is used to create names for all internal resources of a module. It represents a prefix that will be added to the names of all internal resources to ensure their uniqueness within the module. string n/a yes
rds_engine The database engine to use. For supported values, see the Engine parameter in API action CreateDBInstance string postgres no
rds_engine_version The database engine version to use. If no version is specified, Amazon RDS defaults to an available version, typically the most recent version. Can be set without minor version string null no
rds_instance_class The instance type of the RDS instance string db.t3.micro no
rds_subnets List of subnets id. The DB instance will be created in the VPC associated with these subnets. list(string) n/a yes
ec2_rds_password_lengh Database user password length number 20 no
ec2_rds_db_password Database user password. If rds_db_password is not set or set is null then the password will be generated string null no
rds_security_group_ids List of security group identifiers that will be associated with the RDS instance. list(string) n/a yes
rds_snapshot_restore Switch to choose whether to restore the database from a snapshot or create the database. bool false no
rds_snapshot_identifier The database snapshot identifier. If rds_snapshot_restore is set true and rds_snapshot_identifier is not set then database will be restored from final snapshot string null no
rds_db_name The name of the database string n/a yes
rds_db_username The username of the database user string n/a yes
create_secret_manager Enables the creation of a secret resource in Secret Manager bool false no
rds_allocated_storage Database allocated storage capacity string 10 no
final_snapshot_identifier The name of the final database snapshot that will be created when the database is deleted. If set is null or not set then will be set as ${var.name}-final-${formatdate("YYYY-MM-DD-hh-mm-ss", timestamp())} string null no
publicly_accessible Bool to control if instance is publicly accessible. bool false no
parameter_group_name Name of the DB parameter group to associate. string null no

Outputs

Name Description
rds_db_username The username of the database user
rds_db_address The Endpoint of the database
rds_db_name The name of the database
rds_db_password The password of the database user