Run terraform fmt + validate + plan with var-file for the Book Review App
Generate a Terraform plan for the Book Review App infrastructure. Work from the terraform/ directory.
Run terraform fmt -check -recursive. If it fails, fix formatting automatically and note the files changed.
Run terraform validate. If it fails, diagnose and fix all errors before continuing. Do not run plan against broken config.
Run:
terraform plan -var-file=terraform.tfvars -out=tfplan.out
If terraform.tfvars does not exist, warn the user and list which required variables have no defaults so they know what to provide.
After the plan completes, parse and summarize:
Before presenting the plan to the user, scan the planned changes for:
0.0.0.0/0 inbound on ports other than 80/443publicly_accessible = trueIf any of these are found, block and report them as critical issues before the user can proceed to apply.
If the plan is clean, print: "Plan complete. Review the changes above, then run /tf-apply to apply or /tf-deploy for a full pipeline run."
If there were issues, list them and wait for the user to fix them.