Untitled

Created November 06, 2025 Last modified November 06, 2025 @ 9:31 AM

New Terraform projects will generally follow a consistent pattern of minimum CLI commands to deploy the project:

  • terraform init is always the first step. It will initialize the working directory, determine the providers you’re using (e.g., Google Cloud Platform), and download required plugins to use those services. It will also fetch external modules and create a lock file (called .terraform.lock.hcl) that helps to ensure consistent provider versions.
  • terraform plan is a good command to run as best practice before actually implementing any changes. It is essentially a dry run, printing a preview of all the changes that will be made when the current configuration is applied. It will also validate the configuration and check for syntax errors and logical issues.
  • terraform apply shows the execution plan and then asks for confirmation to make the changes. Once the developer confirms the changes, Terraform will call provider APIs to create, modify, or destroy resources.