Use this Terraform deployment checklist to prepare, review, apply, and maintain secure, repeatable cloud infrastructure across development, staging, and production.
Overview
Terraform can make infrastructure changes reviewable and repeatable, but the tool does not replace sound deployment practices. A reliable Terraform production workflow depends on clear project boundaries, protected state, controlled credentials, meaningful plan reviews, and a defined recovery path.
This checklist is designed for teams deploying cloud infrastructure for web applications, SaaS platforms, internal systems, and AI workloads. Use it before a first deployment, before promoting changes between environments, and whenever a provider, module, workflow, or security requirement changes.
Keep the checklist close to the repository or runbook that owns the deployment. Some items will be one-time setup tasks; others should be verified on every change. If the infrastructure supports a larger application, pair this process with a broader production-ready cloud architecture review.
Checklist by scenario
Before creating or restructuring a Terraform project
- Define the infrastructure boundary. Decide which resources Terraform owns and which are managed elsewhere.
- Separate reusable modules from environment-specific configuration. Keep modules focused on a coherent capability, such as networking, a database, or an application service.
- Choose an environment structure that matches the team’s operating model. Separate directories, workspaces, or a combination can work, but the choice should be documented and used consistently.
- Pin Terraform and provider versions where practical, then define how version updates will be tested and approved.
- Use clear variable names, descriptions, types, and validation rules. Set safe defaults only when a default cannot create an unsafe or unexpectedly expensive resource.
- Define naming, tagging, labels, and required metadata. Consistent metadata supports ownership, inventory, troubleshooting, and cloud cost optimization.
- Record required inputs and outputs in the project documentation. A new operator should be able to understand how to initialize, plan, apply, and remove the configuration.
Before the first deployment
- Configure a remote state location appropriate for the environment and enable the provider’s supported state protection or locking mechanism where available.
- Restrict access to state. Treat it as sensitive because it may contain resource attributes or other values that should not be broadly exposed.
- Confirm that the state location has an appropriate recovery strategy, including versioning, backups, or an equivalent operational safeguard.
- Authenticate through short-lived or workload-based credentials where supported. Avoid embedding long-lived access keys in source code, variable files, or CI logs.
- Keep secrets out of committed Terraform files and plaintext command history. Use a suitable secret manager or protected CI/CD secret store.
- Review provider permissions. The identity running Terraform should have enough access to perform the intended deployment, but its permissions should be bounded by the team’s security model.
- Run formatting, validation, linting, and security checks before creating the first plan.
- Confirm the target account, subscription, project, region, and environment. A correct configuration applied to the wrong target is still a failed deployment.
Before applying a change
- Review the code diff and the generated plan separately. The code shows intent; the plan shows Terraform’s proposed actions.
- Look specifically for resource replacement, deletion, public exposure, network changes, permission changes, and unexpected data-store modifications.
- Check variable values and sensitive inputs without printing secret contents into logs.
- Confirm that the plan was generated from the intended commit and target environment.
- Verify that changes with operational impact have an owner, an implementation window, and a rollback or recovery approach.
- Require an independent review for production changes or for changes involving identity, networking, encryption, backups, or persistent data.
- Use an approval step in CI/CD rather than applying directly from an untracked local workstation when the environment is shared or production-facing.
After applying
- Confirm that the apply completed successfully and that the state was updated as expected.
- Check application health, connectivity, logs, alerts, and key service metrics. Terraform can report a successful resource operation while the application still needs attention.
- Verify security controls, backups, network reachability, and access paths for newly created resources.
- Record outputs that operators need, but avoid exposing sensitive outputs in general-purpose logs or documentation.
- Compare the deployed result with the intended architecture and update runbooks, diagrams, and ownership records.
- Review expected infrastructure spend after material changes. A cost review can be paired with the cloud cost optimization calculator and a broader cost checklist.
What to double-check
State and concurrency
State is the record Terraform uses to map configuration to real resources. Verify that each environment points to the correct state location and that operators cannot accidentally share unrelated environments. Test the team’s response to a failed or interrupted run before an urgent change is needed. Do not edit state manually unless the action is understood, reviewed, and supported by a recovery plan.
Secrets and sensitive data
Mark sensitive variables and outputs where appropriate, but remember that marking a value sensitive mainly limits display; it does not automatically remove the value from state or prevent a provider from storing it as part of a resource representation. Identify which systems can access state, plans, logs, and CI artifacts. Set retention and access rules accordingly.
Security and network exposure
Check firewall rules, security groups, route tables, identity policies, public endpoints, encryption settings, and administrative access. Prefer explicit allowlists and least-privilege roles over broad access designed for convenience. For application patterns involving containers, serverless services, or managed Kubernetes, make sure the Terraform layer matches the application’s actual trust boundaries. The architectural trade-offs discussed in serverless versus containers can help frame that review.
Destructive changes and recovery
Pay close attention to forced replacements and deletions. For databases, storage, queues, and other stateful services, confirm retention, backup, restore, and migration procedures independently of Terraform. A configuration that can recreate a resource is not necessarily a complete disaster recovery plan; use a separate cloud disaster recovery checklist for recovery readiness.
Common mistakes
- Applying from an unreviewed laptop: Local credentials, uncommitted files, and unrecorded variable values make the change difficult to audit or repeat.
- Sharing one state file across environments: This increases the chance that a development change affects staging or production and makes access boundaries harder to enforce.
- Storing secrets in the repository: Removing a secret from the latest commit does not guarantee that it is absent from history, state, plans, or CI artifacts. Rotate exposed credentials and review their storage paths.
- Trusting a successful plan too broadly: A plan can be syntactically valid while still proposing an unsafe public endpoint, excessive permissions, or an unexpected replacement.
- Using overly broad modules: Modules that create unrelated networking, compute, identity, and data resources are harder to review and reuse safely.
- Ignoring drift: Console edits and emergency changes can leave real infrastructure different from the code. Investigate drift before applying a new plan rather than treating it as harmless noise.
- Skipping cost and ownership metadata: Untagged or unlabeled resources are harder to assign, monitor, and remove. This weakens both operations and cloud cost optimization.
- Assuming Terraform is the whole deployment: Infrastructure readiness does not prove that application migrations, observability, permissions, backups, or operational handoffs are complete.
When to revisit
Revisit this Terraform checklist before seasonal planning cycles, major product launches, platform migrations, and changes to deployment ownership. Review it when the cloud provider, Terraform version, providers, modules, CI/CD system, secret-management approach, or organizational security requirements change.
Schedule a focused review after an incident, unexpected bill, failed rollback, security finding, or significant drift event. These events often reveal a missing approval step, unclear ownership boundary, weak state protection, or an assumption that was never documented.
For a practical next step, copy the checklist into the repository’s deployment runbook and label each item as automated, reviewed per change, or reviewed periodically. Automate formatting, validation, plan generation, policy checks, and secret scanning where your toolchain supports them. Keep human approval for decisions that require context, especially destructive changes, production access, and security exceptions. Before the next deployment, confirm the target environment, inspect the plan, verify state and credentials, apply through the approved workflow, and complete the post-deployment checks.