- Website: https://www.terraform.io
- Mailing list: Google Groups
Everything needed to start local development and testing of the Provider plugin
export GOPATH="${GOPATH:=$HOME/go}"
mkdir -p "$GOPATH/src/github.com/opsgenie"
cd "$GOPATH/src/github.com/opsgenie"
git clone [email protected]:opsgenie/terraform-provider-opsgenieexport GOPATH="${GOPATH:=$HOME/go}"
cd "$GOPATH/src/github.com/opsgenie"
# Compile all versions of the provider and install it in GOPATH.
make build
# Only compile the local executable version (Faster)
make devRun all local unit tests.
make testThis configuration makes use of the dev_overrides.
See the [Manual Setup][Manual Setup] for more details.
# Creates $HOME/.terraformrc
make setupClick to expand
- Create the
.terraformrcfile on your in your home folder usingtouch ~/.terraformrc - Configure
dev_overridesin your~/.terraformrcas show below:provider_installation { dev_overrides { # Remember to replace <home dir> with your username "opsgenie/opsgenie" = "/home/<home dir>/go/bin" } direct {} }
- Run
make build
-
Create a basic terraform project locally with a
main.tffile:terraform { required_providers { opsgenie = { source = "opsgenie/opsgenie" version = ">=0.6.0" # version can be omitted } } } # Configure the Opsgenie Provider provider "opsgenie" { api_key = "<insert api_key>" # https://support.atlassian.com/opsgenie/docs/api-key-management/ api_url = "api.opsgenie.com" # can be a stage instance url for devs } resource "opsgenie_team" { name = "Dev-Provider test team" description = "New team made using in-development OpsGenie provider" }
-
And, Add respective terraform change files which you want to apply on your OG instance
-
Run respective terraform commands to test the provider as per your convenience Install the currently available provider with
tf initterraform planandterraform initwill use providers from the configured paths in$HOME/.terraformrcterraformwill output an error if no provider is found in thedev_overridespath. (make build)
This allows you to use the normal release versions of the opsgenie/opsgenie provider.
Note Removes $HOME/.terraformrc
make clean