If you wish to work on the provider, you'll first need Go installed on your machine (please check the requirements before proceeding).
Note: This project uses Go Modules making it safe to work with it outside of your existing GOPATH. The instructions that follow assume a directory in your home directory outside of the standard GOPATH (i.e $HOME/development/terraform-providers/
).
Clone repository to: $HOME/development/terraform-providers/
$ mkdir -p $HOME/development/terraform-providers/; cd $HOME/development/terraform-providers/
$ git clone [email protected]:launchdarkly/terraform-provider-launchdarkly
If you are working on the launchdarkly_audit_log_subscription
resource, you will want to ensure the configuration field mapping is up-to-date with the most recent changes by running make generate
.
To compile the provider, run make build
. This will build the provider and put the provider binary in the $GOPATH/bin
directory.
$ make build
In order to test the provider, you can simply run make test
.
$ make test
In order to run the full suite of Acceptance tests, run make testacc
.
Note: Acceptance tests create real LaunchDarkly resources, and require an enterprise account.
With Terraform v0.14 and later, development overrides for provider developers can be leveraged in order to use the provider built from source.
To do this, populate a Terraform CLI configuration file (~/.terraformrc
for all platforms other than Windows; terraform.rc
in the %APPDATA%
directory when using Windows) with at least the following options:
provider_installation {
dev_overrides {
"launchdarkly/launchdarkly" = "[REPLACE WITH GOPATH]/bin"
}
direct {}
}