rvn-rds · Latest version: 0.4.2
Dependencies and consumers
Every dependency input can be specified manually to reference existing external infrastructure rather than a Ravion module.Readme
Creates and manages an Amazon RDS database. Supports PostgreSQL, MySQL, MariaDB, Oracle, and SQL Server engines.Overview
Use this module when an application needs a managed relational database in AWS. It provisions an RDS instance with subnet placement, security group access, backups, monitoring, optional read replicas, and CloudWatch alarms. The module supports PostgreSQL, MySQL, MariaDB, Oracle, and SQL Server engines. Aurora uses a different AWS resource model and is not configured by this module.Use cases
Networking
Select a VPC network first. Ravion maps the network’s AWS account, region, VPC ID, and private subnet IDs into this module. The database subnet group uses the selected private subnets by default. Public access is disabled by default. Keep it disabled for normal application databases and allow access through security group IDs from application services or controlled CIDR blocks.Database engine and sizing
Choose the engine, optional engine major version, optional engine minor version, instance class, and allocated storage. If engine major version is blank, AWS selects the latest available version for that engine. Storage type defaults to gp3. Max allocated storage controls RDS storage autoscaling; keep it at 0 to disable autoscaling. AWS supports increasing allocated storage after creation, but not reducing it in place.Credentials and security
Manage password in Secrets Manager is enabled by default, so AWS creates and stores the master password for the database. Disable it only when you need to provide a master password yourself. Storage encryption is enabled by default. Provide a storage KMS key ARN when you need a customer-managed key for storage. IAM database authentication is shown only for MySQL and PostgreSQL.Availability, backups, and maintenance
Multi-AZ creates a standby in another availability zone for failover. The single availability zone field is hidden when Multi-AZ is enabled. Read replicas are shown only for engines that support RDS read replicas and are hidden for SQL Server. Automated backups default to 7 days. You can set the backup window and control final snapshot behavior. Deletion protection is enabled by default. Automatic minor engine version upgrades are configured next to the engine version fields and, when enabled, happen during the configured maintenance window. Major version upgrades and immediate changes are opt-in.Observability
Performance insights is enabled by default with 7 days of retention. Enhanced monitoring can be enabled by setting a monitoring interval. CloudWatch alarms are optional. When enabled, the module can alarm on CPU utilization, free storage space, and database connections. The free storage alarm threshold is entered in GiB in Ravion and converted to bytes for Terraform. The Ravion UI also shows RDS CloudWatch metrics for CPU, free storage, connections, read IOPS, and write IOPS.Configuration
Advanced configuration
Use parameter group settings for engine parameters. Oracle settings and SQL Server settings are shown in separate engine-specific sections. Option group settings are shown only for Oracle and SQL Server engines; blue/green updates are shown only for MySQL and MariaDB. Use advanced Terraform variables for one-off overrides not represented directly in the UI. Values in advanced Terraform variables override generated variables. Terraform settings let you override the OpenTofu version, Terraform execution environment inherited from the VPC network, and Ravion state backend workspace name.Design decisions
RDS instances are placed in private subnets by default through the VPC network reference. Secrets Manager password management, encryption at rest, performance insights, and deletion protection default on because they are safer defaults for long-lived databases. The module keeps primary database choices visible and tucks optional engine, engine-specific, storage, backup, monitoring, maintenance, parameter group, and option group details behind collapsible controls. Source repository and stack plumbing remain managed by Ravion.Learn more
Inputs reference
All inputs forrvn-rds version 0.4.2. Use the name shown for each field as the input key in module config.
VPC network.
- Immutable after creation
Database
Name slug. Name prefix for all RDS resources.
- Default:
<<project.given_id>>-<<environment.given_id>> - Immutable after creation
- Pattern:
^[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?$— 1-40 lowercase letters, numbers, and hyphens. Start and end with a letter or number.
Create or restore.
- Default:
none - Allowed values:
none(New empty database),snapshot(Restore from snapshot),point_in_time(Point-in-time restore) - Immutable after creation
Database name.
- Immutable after creation
- Pattern:
^[a-z][a-z0-9_]{0,63}$— 1-64 lowercase letters, numbers, and underscores. Start with a letter. - Pattern:
^(?:|[^adimnoprst].*|a(?:|[^d].*|d(?:|[^m].*|m(?:|[^i].*|i(?:|[^n].*|n.+))))|d(?:|[^a].*|a(?:|[^t].*|t(?:|[^a].*|a(?:|[^b].*|b(?:|[^a].*|a(?:|[^s].*|s(?:|[^e].*|e(?:[^s].*|s.+))))))))|i(?:|[^n].*|n(?:|[^f].*|f(?:|[^o].*|o(?:|[^r].*|r(?:|[^m].*|m(?:|[^a].*|a(?:|[^t].*|t(?:|[^i].*|i(?:|[^o].*|o(?:|[^n].*|n(?:|[^_].*|_(?:|[^s].*|s(?:|[^c].*|c(?:|[^h].*|h(?:|[^e].*|e(?:|[^m].*|m(?:|[^a].*|a.+)))))))))))))))))|m(?:|[^y].*|y(?:|[^s].*|s(?:|[^q].*|q(?:|[^l].*|l.+))))|n(?:|[^u].*|u(?:|[^l].*|l(?:|[^l].*|l.+)))|o(?:|[^r].*|r(?:|[^a].*|a(?:|[^c].*|c(?:|[^l].*|l(?:|[^e].*|e.+)))))|p(?:|[^eo].*|e(?:|[^r].*|r(?:|[^f].*|f(?:|[^o].*|o(?:|[^r].*|r(?:|[^m].*|m(?:|[^a].*|a(?:|[^n].*|n(?:|[^c].*|c(?:|[^e].*|e(?:|[^_].*|_(?:|[^s].*|s(?:|[^c].*|c(?:|[^h].*|h(?:|[^e].*|e(?:|[^m].*|m(?:|[^a].*|a.+))))))))))))))))|o(?:|[^s].*|s(?:|[^t].*|t(?:|[^g].*|g(?:|[^r].*|r(?:|[^e].*|e(?:|[^s].*|s.+)))))))|r(?:|[^do].*|d(?:|[^s].*|s(?:|[^a].*|a(?:|[^d].*|d(?:|[^m].*|m(?:|[^i].*|i(?:|[^n].*|n.+))))))|o(?:|[^o].*|o(?:|[^t].*|t.+)))|s(?:|[^y].*|y(?:|[^s].*|s.+))|t(?:|[^e].*|e(?:|[^m].*|m(?:|[^p].*|p(?:|[^l].*|l(?:|[^a].*|a(?:|[^t].*|t(?:|[^e].*|e(?:|[^01].*|0.+|1.+)))))))))$— Pick a different name, this is reserved by AWS. - Shown when:
{"engine":["mysql","postgres","mariadb","oracle-ee","oracle-se2","oracle-se2-cdb"],"restore_mode":"none"}
Username.
- Default:
dbadmin - Immutable after creation
- Pattern:
^[A-Za-z][A-Za-z0-9_]{0,62}$— Invalid RDS master username. Start with a letter. Letters, numbers, and underscores only. - Shown when:
{"restore_mode":"none"}
Snapshot to restore. Snapshot identifier or ARN to restore into this new database. The snapshot must be compatible with the selected engine and instance settings.
- Immutable after creation
- Shown when:
{"restore_mode":"snapshot"}
Use latest restorable time. Restore to the latest time AWS can recover from the selected source database backup.
- Default:
true - Immutable after creation
- Shown when:
{"restore_mode":"point_in_time"}
Restore time. Restore to this UTC timestamp instead of the latest restorable time.
- Immutable after creation
- Shown when:
{"point_in_time_use_latest_restorable_time":false,"restore_mode":"point_in_time"}
Source DB instance identifier. Source DB instance identifier to restore from.
- Immutable after creation
- Shown when:
{"restore_mode":"point_in_time"}
Source automated backups ARN. ARN of the source automated backups to restore from. Use this for cross-region or retained automated backup restores.
- Immutable after creation
- Shown when:
{"restore_mode":"point_in_time"}
Source DB resource ID. Source DB resource ID to restore from when using automated backups.
- Immutable after creation
- Shown when:
{"restore_mode":"point_in_time"}
Version
Engine.
- Default:
postgres - Allowed values:
postgres(PostgreSQL),mysql(MySQL),mariadb(MariaDB),oracle-ee(Oracle Enterprise Edition),oracle-se2(Oracle Standard Edition 2),oracle-se2-cdb(Oracle Standard Edition 2 CDB),sqlserver-ee(SQL Server Enterprise),sqlserver-se(SQL Server Standard),sqlserver-ex(SQL Server Express),sqlserver-web(SQL Server Web) - Immutable after creation
Engine major version. Examples: 15 for PostgreSQL or SQL Server, 8.0 for MySQL, 19 for Oracle.
- Immutable after creation
Engine minor version. Optional minor engine version appended to the major version. Example: major 15 and minor 4 becomes 15.4.
Auto minor version upgrades. Enable automatic minor engine version upgrades during the configured maintenance window.
- Default:
true
Size & Storage
Instance class. RDS instance size, such as db.t4g.micro or db.r6g.large.
- Default:
db.t4g.micro
Allocated storage (GiB). AWS supports increasing allocated storage after creation, but not reducing it in place.
- Default:
20 - Min:
20 - Max:
65536
Max allocated storage (GiB). Upper limit for RDS storage autoscaling. Use 0 to disable. AWS can grow storage up to this limit, but storage cannot be reduced in place.
- Default:
0 - Min:
0 - Max:
65536
Storage type.
- Default:
gp3 - Allowed values:
gp3,gp2,io1,io2,standard
Provisioned IOPS.
- Min:
1000 - Max:
256000 - Shown when:
{"storage_type":["gp3","io1","io2"]}
Storage throughput (MiB/s).
- Min:
125 - Max:
1000 - Shown when:
{"storage_type":"gp3"}
Storage KMS key ARN.
- Immutable after creation
CA certificate identifier.
Network access
Publicly accessible. Keep disabled for production databases unless public access is intentional.
- Default:
false
Port. Leave blank to use the engine default port.
- Min:
1 - Max:
65535
Security group creation.
- Default:
true - Immutable after creation
Existing security group ID.
- Shown when:
{"security_group_creation_enabled":false}
Allowed security groups.
- Shown when:
{"security_group_creation_enabled":true}
Allowed CIDR blocks.
- Shown when:
{"security_group_creation_enabled":true}
Availability & replicas
Multi-AZ.
- Default:
false
Availability zone. Single-AZ placement. Hidden when Multi-AZ is enabled because AWS chooses standby placement.
- Shown when:
{"multi_az_enabled":false}
Read replicas.
- Default:
false - Shown when:
{"engine":["mysql","postgres","mariadb","oracle-ee","oracle-se2","oracle-se2-cdb"]}
Read replica count.
- Default:
1 - Min:
0 - Max:
15 - Shown when:
{"engine":["mysql","postgres","mariadb","oracle-ee","oracle-se2","oracle-se2-cdb"],"read_replica_creation_enabled":true}
Read replica instance class.
- Shown when:
{"engine":["mysql","postgres","mariadb","oracle-ee","oracle-se2","oracle-se2-cdb"],"read_replica_creation_enabled":true}
Read replica AZs.
- Shown when:
{"engine":["mysql","postgres","mariadb","oracle-ee","oracle-se2","oracle-se2-cdb"],"read_replica_creation_enabled":true}
Credentials & authentication
Secrets Manager KMS key ARN.
- Shown when:
{"restore_mode":"none"}
IAM database authentication.
- Default:
false - Shown when:
{"engine":["mysql","postgres"]}
SQL Server settings
License model.
- Allowed values:
license-included,bring-your-own-license - Immutable after creation
- Shown when:
{"engine":["sqlserver-ee","sqlserver-se","sqlserver-ex","sqlserver-web"]}
Character set.
- Immutable after creation
- Shown when:
{"engine":["sqlserver-ee","sqlserver-se","sqlserver-ex","sqlserver-web"]}
SQL Server time zone.
- Immutable after creation
- Shown when:
{"engine":["sqlserver-ee","sqlserver-se","sqlserver-ex","sqlserver-web"]}
Active Directory directory ID.
- Immutable after creation
- Shown when:
{"engine":["sqlserver-ee","sqlserver-se","sqlserver-ex","sqlserver-web"]}
Active Directory IAM role name.
- Immutable after creation
- Shown when:
{"domain":{"not":""},"engine":["sqlserver-ee","sqlserver-se","sqlserver-ex","sqlserver-web"]}
Oracle settings
License model.
- Allowed values:
license-included,bring-your-own-license - Immutable after creation
- Shown when:
{"engine":["oracle-ee","oracle-se2","oracle-se2-cdb"]}
Character set.
- Immutable after creation
- Shown when:
{"engine":["oracle-ee","oracle-se2","oracle-se2-cdb"]}
Backups
Backup retention days.
- Default:
7 - Min:
0 - Max:
35
Backup window.
- Shown when:
{"backup_retention_period":{"not":0}}
Copy tags to snapshots.
- Default:
true
Delete automated backups. Delete retained automated backups when the database is deleted. Disable this to preserve automated backups after deletion.
- Default:
true - Shown when:
{"backup_retention_period":{"not":0}}
Create final snapshot.
- Default:
true
Final snapshot identifier.
- Shown when:
{"final_snapshot_creation_enabled":true}
Deletion protection.
- Default:
true
Maintenance
Maintenance window.
Allow major version upgrades.
- Default:
false
Apply changes immediately.
- Default:
false
Monitoring
CloudWatch log exports.
Enhanced monitoring interval.
- Default:
0 - Allowed values:
0(0),1(1),5(5),10(10),15(15),30(30),60(60)
Monitoring IAM role creation.
- Default:
true - Immutable after creation
- Shown when:
{"monitoring_interval":{"not":0}}
Monitoring IAM role ARN.
- Shown when:
{"monitoring_interval":{"not":0},"monitoring_role_creation_enabled":false}
Performance insights.
- Default:
true
Performance insights retention days.
- Default:
7 - Shown when:
{"performance_insights_enabled":true}
Performance insights KMS key ARN.
- Shown when:
{"performance_insights_enabled":true}
CloudWatch alarms
Create CloudWatch alarms.
- Default:
true
CPU alarm threshold (%).
- Default:
80 - Min:
0 - Max:
100 - Shown when:
{"cloudwatch_alarms_creation_enabled":true}
Free storage alarm threshold (GiB). Displayed in GiB. Ravion converts this to bytes for Terraform.
- Default:
5 - Min:
0 - Shown when:
{"cloudwatch_alarms_creation_enabled":true}
Connections alarm threshold.
- Default:
100 - Min:
1 - Shown when:
{"cloudwatch_alarms_creation_enabled":true}
Alarm evaluation periods.
- Default:
2 - Min:
1 - Shown when:
{"cloudwatch_alarms_creation_enabled":true}
Alarm period seconds.
- Default:
300 - Allowed values:
10(10),30(30),60(60),300(300),900(900),3600(3600) - Shown when:
{"cloudwatch_alarms_creation_enabled":true}
Alarm action ARNs.
- Shown when:
{"cloudwatch_alarms_creation_enabled":true}
OK action ARNs.
- Shown when:
{"cloudwatch_alarms_creation_enabled":true}
Parameter group
Parameter group creation. Create a parameter group for this database. Disable this only when you want to attach an existing parameter group.
- Default:
true - Immutable after creation
Existing parameter group name. Name of an existing parameter group to attach when this module is not creating one.
- Immutable after creation
- Shown when:
{"parameter_group_creation_enabled":false}
Parameter group family. Parameter group family, such as postgres15 or mysql8.0. Leave blank to derive it from the selected engine and major version.
- Immutable after creation
- Shown when:
{"parameter_group_creation_enabled":true}
Parameters. Custom database engine parameters to apply to the created parameter group. Many changes require a database reboot depending on the parameter.
- Default:
[] - Shown when:
{"parameter_group_creation_enabled":true}
Option group
Option group creation.
- Default:
false - Immutable after creation
- Shown when:
{"engine":["oracle-ee","oracle-se2","oracle-se2-cdb","sqlserver-ee","sqlserver-se","sqlserver-ex","sqlserver-web"]}
Existing option group name.
- Immutable after creation
- Shown when:
{"engine":["oracle-ee","oracle-se2","oracle-se2-cdb","sqlserver-ee","sqlserver-se","sqlserver-ex","sqlserver-web"],"option_group_creation_enabled":false}
Option group engine version.
- Immutable after creation
- Shown when:
{"engine":["oracle-ee","oracle-se2","oracle-se2-cdb","sqlserver-ee","sqlserver-se","sqlserver-ex","sqlserver-web"],"option_group_creation_enabled":true}
Options.
- Default:
[] - Shown when:
{"engine":["oracle-ee","oracle-se2","oracle-se2-cdb","sqlserver-ee","sqlserver-se","sqlserver-ex","sqlserver-web"],"option_group_creation_enabled":true}
Blue/green deployments
Blue/green updates.
- Default:
false - Shown when:
{"engine":["mysql","mariadb"]}
Misc
Tags. A map of tags to assign to all resources. Default tags are
Owner, ProjectGivenId, EnvironmentGivenId, ModuleGivenId, ModuleIdTerraform settings
OpenTofu version override. Override the environment’s default version for this module
Ravion Terraform workspace name. Override Terraform state backend workspace name. Defaults to project + environment + module given ids.
- Immutable after creation
Advanced Terraform variables. Optional raw Terraform variable overrides for advanced module inputs or one-off overrides. Values here override the generated variables above.
- Default:
{}