A dry run import is a validation step that checks whether a resource can be imported into Terraform state without modifying the live environment. It helps confirm the state is valid and drift free before execution. Security and infrastructure teams use it to reduce the chance of corrupting operational state during migration.
Expanded Definition
dry run import is a pre-execution validation for Terraform workflows that confirms a resource can be brought under state management without touching the live environment. It is used to detect mismatched identifiers, missing attributes, and existing drift before an import is committed.
In NHI-heavy environments, the value is not the import itself but the assurance that critical objects such as service accounts, API keys, certificates, and related configuration state can be reconciled safely. Definitions vary across vendors and tooling, but the operational intent is consistent: prove that the planned import maps cleanly to reality before state is altered. That makes the practice especially relevant during migrations, platform consolidation, and incident recovery, where state corruption can create hidden access risk. For a broader NHI governance context, see Ultimate Guide to NHIs and the NIST Cybersecurity Framework 2.0.
The most common misapplication is treating a dry run import as proof of security, which occurs when teams confuse successful state validation with verified ownership, scope, and access controls.
Examples and Use Cases
Implementing dry run import rigorously often introduces workflow overhead, requiring teams to balance safer state reconciliation against slower change delivery and more disciplined review.
- Before importing a service account into Terraform, an operator validates that the existing resource matches the intended state model and that no live attributes will be overwritten.
- During cloud platform migration, a team checks whether a secrets manager entry can be imported cleanly while preserving resource identity and avoiding accidental drift correction.
- After discovering unmanaged infrastructure, an SRE team uses a dry run import to determine whether a certificate, role binding, or API integration can be adopted without service interruption.
- When governing NHI estates, practitioners use the validation step to prevent duplicate ownership of credentials and to confirm that imported records align with authoritative inventory sources, as discussed in Ultimate Guide to NHIs.
- In infrastructure audits, teams compare the import preview against NIST Cybersecurity Framework 2.0 expectations for asset visibility and controlled change.
In practice, the dry run often becomes the checkpoint that separates a clean migration from a state file that silently diverges from production reality.
Why It Matters in NHI Security
Dry run import matters because NHI environments fail in subtle ways when state, ownership, and access controls are not aligned. A successful import preview can prevent accidental overwrites of credentials, but it can also surface deeper issues such as unmanaged secrets, duplicate service identities, or incomplete inventory records. That matters in a domain where NHIs outnumber human identities by 25x to 50x, and where only 5.7% of organisations report full visibility into their service accounts, according to Ultimate Guide to NHIs.
Used correctly, the dry run helps teams align import operations with Zero Trust discipline and with governance expectations reflected in the NIST Cybersecurity Framework 2.0. It is not a substitute for validation of least privilege, rotation, or ownership, and it does not confirm that the resource should be managed, only that it can be imported safely. Organisations typically encounter the operational cost of getting this wrong only after a failed migration or a drift incident, at which point dry run import becomes operationally unavoidable to address.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and CSA MAESTRO address the attack and risk surface, while NIST CSF 2.0, NIST Zero Trust (SP 800-207) and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-04 | Dry run import reduces state corruption risk during NHI lifecycle changes. |
| NIST CSF 2.0 | PR.AC-1 | Import validation supports controlled access and asset integrity before change execution. |
| NIST Zero Trust (SP 800-207) | SC-2 | Zero Trust depends on verified resource identity and controlled change paths. |
| NIST AI RMF | MAP 2.2 | Dry run import fits governance of system context and operational boundaries. |
| CSA MAESTRO | GOV-03 | Agentic and automated workflows need pre-change validation for safe execution. |
Validate import mappings before state changes to avoid unmanaged or duplicated NHI records.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on August 28, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org