Terraform has a specific workflow: write configuration, plan changes, and apply them. Why does following this workflow matter?
Think about how seeing changes before applying helps avoid mistakes.
The Terraform workflow helps you preview changes with terraform plan before applying them. This prevents surprises and accidental resource changes.
You run terraform apply directly without running terraform plan first. What is the likely result?
Consider what happens when you don't preview changes.
Skipping terraform plan means you don't see what will change. Applying directly can cause unexpected updates or deletions.
Terraform can store its state file locally or remotely. How does using remote state storage improve the workflow in a team environment?
Think about how teams avoid overwriting each other's work.
Remote state storage enables state sharing and locking, so team members don't overwrite each other's changes and can coordinate safely.
Terraform state files contain detailed information about your infrastructure. Why is it important to secure these files?
Consider what kind of information Terraform stores about your resources.
State files can include sensitive info like passwords or API keys. If exposed, attackers could misuse this data.
In a continuous integration/continuous deployment (CI/CD) pipeline, what is the best practice to handle Terraform workflow steps?
Think about safety and automation balance in pipelines.
Generating a plan and requiring manual approval before applying changes ensures safe, controlled infrastructure updates in CI/CD.