This is a Terraform provider for managing resources within a Bitbucket Cloud account.
As this provider is published to the public Terraform Registry, you can install it like so (for Terraform 0.14+):
provider "bitbucket" {
username = "myUsername"
password = "myPassword"
}
terraform {
required_providers {
bitbucket = {
source = "zahiar/bitbucket"
}
}
}
For more detailed instructions and documentation on the resources and data sources supported, please go to Terraform Registry.
This provider is maintained during free time, so if you are interested in helping to develop this further, you are more than welcome to submit a pull request or raise a ticket if you'd prefer.
If you do wish to help develop this, you will need the following installed:
- Go (see
go.mod
file for the correct version to install) - Go Linter
- GOPATH (is correctly setup)
- Terraform (0.14+)
Simply run make build
, and it will compile and create a binary, as well as print-out instructions
on how to configure Terraform to use this locally built provider.
$ make build
$ make test
This will require you to specify the following environment variables, as these tests will provision actual resources in your account, and it will tear them down afterwards to ensure it leaves your account clean.
You will also require a UUID of another account that is a member of your workspace in order for the bitbucket_user_permission
tests to run, as Bitbucket's API will reject the account owner's UUID.
BITBUCKET_USERNAME
- Username of the account to run the tests againstBITBUCKET_PASSWORD
- Password of the account to run the tests againstBITBUCKET_MEMBER_ACCOUNT_UUID
- Account UUID of the member who is part of your account
NOTE: if a test fails, it may leave dangling resources in your account so please bear this in mind.
If you have two-factor authentication enabled, then be sure to set up an app password and use that instead.
$ BITBUCKET_USERNAME=myUsername BITBUCKET_PASSWORD=myPassword BITBUCKET_MEMBER_ACCOUNT_UUID=myMemberUUID make testacc
Every data source or resource added must have an accompanying docs page (see docs
directory for examples).
Docs are written using Markdown, and you can use this page to preview what your docs will look like when rendered.