File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,3 +74,20 @@ tasks:
7474 msg : " Variables file does not exist: {{.TFVARS_FILE}}"
7575 cmds :
7676 - terraform apply -var-file {{.TFVARS_FILE}} {{.TF_ARGS}}
77+
78+ refresh :
79+ desc : Refresh the Terraform state to match the real-world infrastructure.
80+ summary : |
81+ Refreshes the Terraform state for a specified environment, using a file to load the variables.
82+ The `terraform refresh` arguments can be optionally passed in.
83+ Requires a variables file specific to the environment to be present.
84+ Usage: task terraform:refresh -- ENVIRONMENT [tofu refresh arguments]
85+ Example: terraform tofu:refresh -- automation
86+ dir : " {{.USER_WORKING_DIR}}"
87+ silent : true
88+ vars : *vars
89+ preconditions :
90+ - sh : test -f {{.TFVARS_FILE}}
91+ msg : " Variables file does not exist: {{.TFVARS_FILE}}"
92+ cmds :
93+ - terraform refresh -var-file {{.TFVARS_FILE}} {{.TF_ARGS}}
You can’t perform that action at this time.
0 commit comments