A terraform module for managing RDS instances
- Assumes you're making your instances in a VPC
Defaults:
engine
- The type of RDS isntance you want to use. Defaults to mysqlengine_version
- The RDS version you want to use. Defaults to 5.7.17instance_class
- The RDS instance class. Defaults to db.m4.largemulti_az
- Specifies if the RDS instance is multi-AZ. Defaults to trueport
- RDS port. Defaults to 3306vpc_security_group_ids
- VPC security group ID for cluster.db_subnet_group_name
- Subnet group name for cluster. Defaults to rds-mainparameter_group_name
- Parameter group name for cluster. Defaults to default.mysql5.7allocated_storage
- The amount of storage for the RDS instance. Defaults to 10storage_type
- The storage type for the RDS instance. Defaults to gp2backup_window
- The backup window for the instance. Defaults to 09:46-10:16backup_retention_period
- The retention period for backups. Defaults to 7storage_encrypted
- Ensure your database data is encrypted at rest. Default to truedelete_automated_backups
- Remove your database snapshots automatically when the RDS instance is deleted. Defaults to falsedeletion_protection
- Set deletion protection on the instance. Defaults to truemonitoring_interval
- The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. Defaults to 30performance_insights_enabled
- Specifies whether Performance Insights are enabled. Defaults to false.performance_insights_retention_period
- The amount of time in days to retain Performance Insights data. Defaults to 7. Alternative of 2 years (731 days)
Required:
name
- Name of the RDS instanceusername
- Username for the RDS instance, max 16 characterspassword
- Password for the RDS instance
name
- Name of the instance
You can use this in your terraform template with the following steps.
- Adding a module resource to your template, e.g. main.tf
module "instance" {
source = "git::ssh://git@github.com/telus/terraform-aws_rds_cluster"
name = "my-rds-instance"
username = "my-username"
password = "my-password"
instance_class = "db.m4.large"
}
Created and maintained by Alex Podobnik (alexandar.podobnik@telus.com)