Skip to content

Terraform Provider that integrates with Bitwarden to manage groups and group members

License

Notifications You must be signed in to change notification settings

OneSignal/terraform-provider-bitwarden

Repository files navigation

Bitwarden Terraform Provider

This template repository is built on the Terraform Plugin Framework.

Requirements

Building The Provider

  1. Clone the repository
  2. Enter the repository directory
  3. Build the provider using the Go install command:
go install

Using the provider

This provider is intended to manage users and groups in Bitwarden for an organisation.

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 installed on your machine (see 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

provider_installation {

  dev_overrides {
      "onesignal/bitwarden" = "<PATH>"
  }

  # 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.

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

About

Terraform Provider that integrates with Bitwarden to manage groups and group members

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published