Plan with a var file
Show the changes and save the plan to a file, so CI applies exactly this plan
terraform plan -var-file=prod.tfvars -out=plan.tfplan
More terraform commands
-
terraform apply plan.tfplanApply exactly the plan you generated before, without interactive prompts
-
terraform import module.path.resource_type.name <remote-id>Put a resource that already exists under Terraform control
-
terraform state show module.path.resource_type.nameShow the state attributes of one resource
-
terraform state mv old.address new.addressRename or move a resource without destroying and recreating it
-
terraform workspace listShow all workspaces; the current one is marked with *