| 流程 | terraform init → plan → apply(CI 中 plan 展示、审批后 apply) |
|---|---|
| 锁定 | .terraform.lock.hcl 记录 provider 版本与哈希,应入库 |
| 版本 | required_version 约束 Terraform 本身版本 |
常用命令
常用命令
terraform init
terraform fmt -check
terraform validate
terraform plan -out=tfplan
terraform apply tfplanplan 产物(tfplan)用于「评审后原样执行」:保证执行的正是被看过的计划。