-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add terraform recipe to the cookbook (#3305)
* docs: add terraform recipe to the cookbook Signed-off-by: Ali Sajid Imami <[email protected]> * [autofix.ci] apply automated fixes * Update docs/mise-cookbook.md --------- Signed-off-by: Ali Sajid Imami <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: jdx <[email protected]>
- Loading branch information
1 parent
1cfc822
commit 80579af
Showing
3 changed files
with
58 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Tasks Cookbook | ||
|
||
Here we are sharing a few configurations for tasks that other people have found useful. | ||
|
||
## Managing `terraform`/`opentofu` Projects | ||
|
||
It is often necessary to have your terraform configuration in a `terraform/` subdirectory. | ||
This necessitates the use of syntax like `terraform -chdir=terraform plan` to use appropriate | ||
terraform command. The following config allows you to invoke all of them from `mise`, leveraging | ||
`mise` tasks. | ||
|
||
```toml | ||
[tools] | ||
terraform = "1" | ||
|
||
[tasks."terraform:init"] | ||
description = "Initializes a Terraform working directory" | ||
run = "terraform -chdir=terraform init" | ||
|
||
[tasks."terraform:plan"] | ||
description = "Generates an execution plan for Terraform" | ||
run = "terraform -chdir=terraform plan" | ||
|
||
[tasks."terraform:apply"] | ||
description = "Applies the changes required to reach the desired state of the configuration" | ||
run = "terraform -chdir=terraform apply" | ||
|
||
[tasks."terraform:destroy"] | ||
description = "Destroy Terraform-managed infrastructure" | ||
run = "terraform -chdir=terraform destroy" | ||
|
||
[tasks."terraform:validate"] | ||
description = "Validates the Terraform files" | ||
run = "terraform -chdir=terraform validate" | ||
|
||
[tasks."terraform:format"] | ||
description = "Formats the Terraform files" | ||
run = "terraform -chdir=terraform fmt" | ||
|
||
[tasks."terraform:check"] | ||
description = "Checks the Terraform files" | ||
depends = ["terraform:format", "terraform:validate"] | ||
|
||
[env] | ||
_.file = ".env" | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters