https://github.com/onesignal/terraform-provider-bitwarden
Terraform Provider that integrates with Bitwarden to manage groups and group members
https://github.com/onesignal/terraform-provider-bitwarden
Last synced: 25 days ago
JSON representation
Terraform Provider that integrates with Bitwarden to manage groups and group members
- Host: GitHub
- URL: https://github.com/onesignal/terraform-provider-bitwarden
- Owner: OneSignal
- License: mpl-2.0
- Created: 2023-10-04T14:47:05.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-06T10:44:47.000Z (over 2 years ago)
- Last Synced: 2025-02-16T16:56:17.305Z (over 1 year ago)
- Language: Go
- Size: 332 KB
- Stars: 1
- Watchers: 4
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Bitwarden Terraform Provider
_This template repository is built on the [Terraform Plugin Framework](https://github.com/hashicorp/terraform-plugin-framework)._
## Requirements
- [Terraform](https://developer.hashicorp.com/terraform/downloads) >= 1.0
- [Go](https://golang.org/doc/install) >= 1.19
## Building The Provider
1. Clone the repository
1. Enter the repository directory
1. Build the provider using the Go `install` command:
```shell
go install
```
## Using the provider
This provider is intended to manage users and groups in Bitwarden for an organisation.
```hcl
provider "bitwarden" {
# Configure the authentication values needed to authenticate with Bitwarden API.
# More information can be found here: https://bitwarden.com/help/public-api/#authentication
client_id = "client_id"
client_secret = "client_api_secret"
}
resource "bitwarden_group" "example" {
name = "example"
}
```
## Developing the Provider
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (see [Requirements](#requirements) above).
To compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
If you like to test it out, you will need to create a `~/.terraformrc` file for the `dev_overrides`
```hcl
provider_installation {
dev_overrides {
"onesignal/bitwarden" = ""
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
```
To generate or update documentation, run `go generate`.
In order to run the full suite of Acceptance tests, run `make testacc`.
*Note:* Acceptance tests create real resources, and often cost money to run.
```shell
export BITWARDEN_CLIENT_ID="organization.xxxx"
export BITWARDEN_CLIENT_SECRET="xxx"
make testacc
```
## TODOs
- [ ] implement group members
- [ ] gracefully handle 404 when group is manually deleted? How do we do that?
- [ ] ensure urls don't end on trailing /, use validators?
- [ ] Add docs to group resource