Import binds an existing AWS resource to Terraform state, while rebuilding creates a new database and then switches traffic. Import reduces downtime risk and avoids data migration exposure, but rebuilding may still be needed when the target architecture itself must change.
How Terraform import differs from rebuilding an RDS database
Terraform import links an existing Amazon RDS resource to Terraform state so Terraform can manage it going forward, but it does not create a new database or move data. Rebuilding creates a replacement database and shifts applications or traffic to it. The practical difference is control versus replacement: import preserves the current resource, while rebuild changes the resource itself.
When import is the safer path and when rebuild is the right one
Import is the better fit when the database is already live, carries production data, and the goal is to bring it under infrastructure-as-code without disrupting service. Rebuild is the better fit when the current instance is structurally wrong, such as the wrong engine version, parameter model, subnet placement, encryption posture, or sizing strategy, and those differences matter more than preserving the existing resource identity.
That distinction matters because import reduces the chance of downtime and data migration mistakes, but it also preserves any pre-existing configuration drift. Rebuild is more disruptive, but it gives you a clean target state and avoids trying to reconcile a long-lived database into code after the fact.
What changes operationally between the two approaches
Import is mostly a state-management exercise. You must make the Terraform configuration match the live resource closely enough that a plan does not propose unintended replacement. Rebuilding is an application and data-migration exercise, because you are creating a new RDS instance, validating it, migrating data, and then cutting over clients, endpoints, or DNS.
The key operational trade-off is blast radius. Import keeps the current runtime path intact, which is useful when the service is already stable. Rebuild gives you a chance to correct design issues, but it introduces migration planning, cutover timing, rollback design, and validation of reads, writes, backups, and replication behaviour before the old system is retired.
Risk and Threat Considerations
The main risk with import is assuming Terraform now reflects reality when it only reflects state. If the live RDS configuration was changed manually, the imported state can hide drift until the next apply, which can lead to accidental replacement or unexpected changes.
Failure mechanism: Manual edits, mismatched parameters, or incomplete configuration capture create state drift, and Terraform may later interpret that drift as a need to modify or recreate the database.
Impact: That can produce avoidable downtime, service interruption, or loss of data-plane confidence if a production RDS instance is replaced or altered unexpectedly.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5 and CIS Controls v8 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | CM-2 — Baseline Configuration | Import vs rebuild hinges on aligning live RDS settings to a managed baseline. |
| CM-6 — Configuration Settings | The question is about preserving or changing database settings during management or rebuild. | |
| CP-10 — System Recovery and Reconstitution | Rebuilding an RDS database requires recovery, cutover, and restore planning. | |
| Recommendation — Baseline the RDS configuration before importing or replacing the instance. Define and enforce approved RDS configuration settings in code. Test restore and cutover procedures before decommissioning the old database. | ||
| ISO/IEC 27001:2022 | A.8.9 — Configuration management | Import and rebuild both depend on controlled configuration management for the database. |
| Recommendation — Document and control RDS configuration changes through the ISMS. | ||
| CIS Controls v8 | CIS-4 — Secure Configuration of Enterprise Assets and Software | The distinction turns on whether the RDS asset is kept or rebuilt to match a secure baseline. |
| Recommendation — Harden and standardize the RDS configuration before go-live. | ||
Practitioner Guidance
What to verify: Before importing, confirm that the live RDS settings you care about are already known and codified, especially storage, subnet group, encryption, backups, parameter group, and maintenance settings. If the current instance deviates materially from the desired architecture, treat import as a temporary management step, not the final state.
- Use import when the existing database must stay in place and the task is governance or configuration control.
- Use rebuild when the target architecture must change in a way that import cannot safely express.
- Plan cutover, rollback, and data validation before rebuilding, because the hard part is usually migration, not creation.
Practitioner takeaway: Import is for absorbing a live RDS resource into declarative control, while rebuild is for replacing the resource to achieve a materially different database design.
Related resources from NHI Mgmt Group
- What is the difference between importing cloud resources into Terraform and rebuilding them from scratch?
- What is the difference between importing EKS resources into Terraform and reprovisioning them?
- What is the difference between manually managing EC2 Image Builder resources and importing them into Terraform?
- What is the difference between privilege reduction and secret rotation?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 10, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org