
Q-Bits: Provisioning RDS with Terraform and Q Developer
Amazon Q Developer enhances Terraform workflows by providing real-time explanations, suggesting best practices, and generating code.
Dr. Rahul Gaikwad
Amazon Employee
Published Jan 25, 2025
Welcome to another installment of Q-Bits, our regular series showcasing cool ways Amazon employees are leveraging Amazon Q Developer. Today, we're diving into how Q Developer can assist with provisioning RDS instance using Terraform.
Few years back, I transitioned myself from Database Administration (DBA) to DevOps, where I got opportunity to dive into the world of infrastructure automation with Terraform. As a newcomer, I found myself navigating the complexities of HashiCorp Configuration Language (HCL) to provision AWS resources, particularly focusing on RDS database. Although my focus was solely on database resources, the IaC devlopmenet process took a significant investment of time and effort.
Now, as I started my new role as a Solutions Architect for Financial Service Industry (FSI) customers, I struggled with forgotten RDS configurations. Now, with Amazon Q Developer at my side, I was no longer alone in navigating the complexities of Terraform and AWS configurations.
While revisiting my old backup, I dove into my legacy RDS Terraform configurations and curious about parameters like
parameter_group
and option_group
. Rather than digging through Terraform documentation again, I took a smarter approach. I highlighted the configuration lines, right-clicked, and chose "Amazon Q > Explain" for instant clarity.
Amazon Q Developer swiftly provided a clear explanation, significantly saving my both time and effort.

As you can see, my legacy code does not adhere to best practices and lacks advanced configurations. Let's see how we can refactor it with the assistance of Amazon Q Developer.
I wanted to follow the latest IaC standards and enhance my legacy code, so I simply selected entire file and right-clicked, and chose "Amazon Q > Fix". Q Developer swiftly reviewed my code and suggested several improvements.
I observed, Amazon Q Developer implemented several significant improvements including:
- Security Enhancenements:
- Added
storage_encrypted
andpublicly_accessible
- Credentials moved to variables and marked as sensitive
- Performance Optimization:
- Added
max_allocated_storage
for storage autoscaling - Enabled Performance Insights for monitoring
- Added enhanced monitoring with
monitoring_interval
- Backup and Maintenance :
- Added backup retention period
- Defined backup and maintenance windows
- Changed
skip_final_snapshot
to false for better disaster recovery
- Best Practices :
- Added an identifier for better resource management
- Added tags for better resource organization
- Included subnet groups for proper networking
- Added proper snapshot handling
Finally, I wanted to add DB snapshot, so I just asked Q Devloper by putting a comment, Q developer suggested entrire block for
aws_db_snapshot
resource.
The recommendation was so quick, saved my time and effort on searching syntax on Terraform documentation.
Amazon Q Developer has greatly enhanced my Terraform workflow. It provided immediate explanations for unfamiliar configurations, recommended modern best practices, and even anticipated my infrastructure needs. This tool has not only saved me time but also ensured that my AWS setup is optimized and secure.
As we continue to explore the capabilities of Amazon Q Developer, it’s evident that it is becoming an essential resource for developers, whether working on personal projects or professional tasks. Stay tuned for more Q-Bits, where we will showcase how Amazon Q Developer is transforming our development processes. If interested, check out this AWS blog on Accelerate your Terraform development with Amazon Q Developer.
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.