This is a Terraform provider for interacting with
Berglas.
Secrets will be stored in plaintext in the Terraform state. You should only
use this with provider with Terraform remote state. For more information, please
see sensitive state.
Installation
-
Download the latest compiled binary from GitHub releases.
-
Unzip/untar the archive.
-
Move it into $HOME/.terraform.d/plugins
:
$ mkdir -p $HOME/.terraform.d/plugins
$ mv terraform-provider-berglas $HOME/.terraform.d/plugins/terraform-provider-berglas
-
Create your Terraform configurations as normal, and run terraform init
:
$ terraform init
This will find the plugin locally.
-
If you haven't already, bootstrap berglas
Optionally
If using terraform v0.13+ you can create a versions.tf
file to pull the plugin during terraform init
without installing it locally:
terraform {
required_providers {
berglas = {
source = "sethvargo/berglas"
version = "~> 0.1"
}
}
}
Usage
-
Create a Terraform configuration file:
resource "berglas_secret" "demo" {
bucket = "my-bucket"
key = "projects/${var.project_id}/locations/global/keyRings/berglas/cryptoKeys/berglas-key"
name = "demo"
plaintext = "p@s$w0rd!"
}
-
Run terraform init
to pull in the provider:
$ terraform init
-
Run terraform plan
and terraform apply
:
$ terraform plan
$ terraform apply
Examples
For more examples, please see the examples folder in this
repository.
Reference
See the documentation.