Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chappio/terraform-encrypt
A simple encrypt program to be used by terraform's external data provider
https://github.com/chappio/terraform-encrypt
Last synced: 2 months ago
JSON representation
A simple encrypt program to be used by terraform's external data provider
- Host: GitHub
- URL: https://github.com/chappio/terraform-encrypt
- Owner: ChappIO
- Created: 2018-05-29T06:20:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-29T08:18:22.000Z (over 5 years ago)
- Last Synced: 2024-10-16T04:02:02.190Z (3 months ago)
- Language: Go
- Size: 5.86 KB
- Stars: 4
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# terraform-encrypt
A simple encrypt program to be used by terraform's external data provider or as a CLI tool.
## Usage
There are several commands which you can invoke on terraform-encrypt.
### Command: encrypt
To encrypt a file in-place (or to another file) you run:
```bash
terraform-encrypt encrypt [sourceFiles...] [flags]
```Flags:
- `-o`, `--output string`: The target file location. Can only be used if a single file is passed. Specify '-' to output to stdout.
- `-p`, `--password string`: The vault password. This defaults to the value of environment variable `VAULT_PASSWORD`.### Command: decrypt
To decrypt a file you run:
```bash
terraform-encrypt decrypt [sourceFiles...] [flags]
```Flags:
- `-c`, `--confirm-password`: Confirm the vault password when prompting.
- `-o`, `--output string`: The target file location. Can only be used if a single file is passed. Specify '-' to output to stdout.
- `-p`, `--password string`: The vault password. This defaults to the value of environment variable `VAULT_PASSWORD`.### Using Terraform
Create a json file:
```json
{
"fieldA": "Value",
"message": "I am super secret!"
}
```Encrypt the file:
```bash
terraform-encrypt encrypt secret.json
```Read using terraform:
```hcl
data "external" "secret" {
program = [
"terraform-encrypt",
"decrypt",
"${path.module}/path/to/encrypted/file",
"--output",
"-"
]
}output "result" {
value = "${data.external.secret.result.message}"
}
```