-
Notifications
You must be signed in to change notification settings - Fork 0
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 #3 from sebastiaan-dev/task/docs
Update documentation
- Loading branch information
Showing
8 changed files
with
94 additions
and
9 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
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
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 |
---|---|---|
@@ -1,3 +1,30 @@ | ||
terraform { | ||
required_providers { | ||
bitwarden-secrets = { | ||
source = "sebastiaan-dev/bitwarden-secrets" | ||
version = ">=0.1.2" | ||
} | ||
} | ||
} | ||
|
||
# Configure the provider | ||
provider "bitwarden-secrets" { | ||
access_token = "Access token acquired from Bitwarden" | ||
} | ||
|
||
# Create a project managed by Terraform | ||
resource "bitwarden-secrets_project" "project" { | ||
name = "Terraform-Provider" | ||
} | ||
|
||
# Create a secret managed by Terraform | ||
resource "bitwarden-secrets_secret" "secret" { | ||
key = "Name of the secret" | ||
value = "Value stored on Bitwarden" | ||
project_id = bitwarden-secrets_project.project.id | ||
} | ||
|
||
# Or, read a pre-existing secret | ||
data "bitwarden-secrets_secret" "read_only_secret" { | ||
id = "ID of the secret" | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Create a project managed by Terraform | ||
resource "bitwarden-secrets_secret" "example" { | ||
name = "example" | ||
} |
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,22 @@ | ||
--- | ||
layout: "" | ||
page_title: "Bitwarden Secrets Provider" | ||
description: |- | ||
Use the Bitwarden provider to read, create, or update logins, secure notes and folders in your Bitwarden Vaults. | ||
--- | ||
|
||
# Bitwarden Secrets Provider | ||
|
||
This project builds a Terraform Provider on top of Bitwardens [Secrets Manager CLI]. It allows for reading secrets with Data Sources, or managing secrets or projects through Resources. Because the provider makes use of the CLI internally it should be available to the system globally, it is therefore recommended to put the `bws` binary in the system path. | ||
|
||
## Example Usage | ||
|
||
{{tffile "examples/provider/provider.tf"}} | ||
|
||
## Authorization | ||
|
||
There are some remarks on the behaviour of read and writing from and to secrets. First, in order to use a Data Source secret from the Bitwarden Secrets Manager the currently active `access-token` should have read permissions for the project associated with the secret. For Resource secrets it should either hold that the secret is a child of a project Resource managed by Terraform, or that the currently active `access-token` has both read and write permissions for the associated project. | ||
|
||
{{ .SchemaMarkdown | trimspace }} | ||
|
||
[Secrets Manager CLI]: https://bitwarden.com/help/secrets-manager-cli/ |