-
Notifications
You must be signed in to change notification settings - Fork 989
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #380 from jon4hz/tf
docs: add terraform
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: "Terraform" | ||
description: "How to use Infisical to inject environment variables and secrets into terraform." | ||
--- | ||
|
||
Prerequisites: | ||
|
||
- Set up and add envars to [Infisical Cloud](https://app.infisical.com) | ||
- [Install the CLI](/cli/overview) | ||
|
||
## Initialize Infisical for your [Terraform](https://www.terraform.io/) project | ||
|
||
```bash | ||
# navigate to the root of your of your project | ||
cd /path/to/project | ||
|
||
# then initialize Infisical | ||
infisical init | ||
``` | ||
|
||
## Run terraform as usual but with Infisical | ||
|
||
```bash | ||
infisical run -- <your application start command> | ||
|
||
# Example | ||
infisical run -- terraform plan | ||
``` | ||
|
||
<Note> | ||
To inject any arbitrary variable to terraform, you have | ||
to prefix them with `TF_VAR`. Read more about that | ||
[here](https://developer.hashicorp.com/terraform/cli/config/environment-variables#tf_var_name). | ||
</Note> |
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