NOTE: This project is currently in beta and is not ready for production use.
See the examples
directory
- Clone the repository
- Enter the repository directory
- Build the provider with
make build
or invokego install
directly.
This provider uses Go modules. Please see the Go documentation for the most up to date information about using Go modules.
To add a new dependency github.com/author/dependency
to your Terraform provider:
go get github.com/author/dependency
go mod tidy
If you're building the provider, follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init
to initialize it.
If you wish to work on the provider, you'll first need Go installed on your machine (please check the requirements before proceeding). To compile the provider, run make build
.
In order to test the provider, you can simply run make test
. Pre-recorded API responses
(cassettes) are run. The cassettes are stored in jupiterone/cassettes/
.
When tests are modified, the cassettes need to be re-recorded.
Note: Recording cassettes creates/updates/destroys real resources. Never run this on a production JupiterOne organization.
In order to re-record all cassettes you need to have JUPITERONE_API_KEY
and JUPITERONE_ACCOUNT_ID
for your testing organization in your environment. With that, run make cassettes
.
If you only need to re-record a subset of your tests, you can run make cassettes TESTARGS ="-run XXX"
.
To run the full suite of Acceptance tests, run make testacc
.
Note: Acceptance tests create/update/destroy real resources. Never run this on a production JupiterOne organization.
$ make testacc
In order to check changes you made locally to the provider, you can use the binary you just compiled by adding the following
to your ~/.terraformrc
file. This is valid for Terraform 0.14+. Please see
Terraform's documentation
for more details.
provider_installation {
# Use /home/developer/go/bin as an overridden package directory
# for the jupiterone/jupiterone provider. This disables the version and checksum
# verifications for this provider and forces Terraform to look for the
# jupiterone provider plugin in the given directory.
dev_overrides {
"jupiterone/jupiterone" = "/home/developer/go/bin"
}
# 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 {}
}
For information about writing acceptance tests, see the main Terraform contributing guide.
This repository contains a GitHub Action configured to automatically build and
publish assets for release when a tag is pushed that matches the pattern v*
(ie. v0.1.0
).
A Gorelaser configuration is provided that produces build artifacts matching the layout required to publish the provider in the Terraform Registry.
Releases will appear as drafts. Once marked as published on the GitHub Releases page, they will become available via the Terraform Registry.
To generate new provider documentation run make docs