- Website: terraform.io
- Chat: gitter
- Mailing List: Google Groups
The Terraform Sumo Logic provider is a plugin for Terraform that allows for the full lifecycle management of Sumo Logic resources.
This provider is maintained by Sumo Logic.
- Terraform >= 0.13
- Go >= 1.13 (to build the provider plugin)
- Set
$GOPATH
- Add
$GOPATH/bin
to your$PATH
- Set
- Sumo Logic
Add the Sumo Logic provider to your terraform configuration:
terraform {
required_providers {
sumologic = {
source = "sumologic/sumologic"
version = "" # set the Sumo Logic Terraform Provider version
}
}
}
Run terraform init
to automatically install the selected version of the provider.
See the provider documentation for information on the supported resources and example usage.
$ git clone https://github.com/SumoLogic/terraform-provider-sumologic.git
$ cd terraform-provider-sumologic
$ make build
This will build the provider and put the provider binary in the $GOPATH/bin
directory.
- Run
make install-dev
- Update the provider source in your configuration file:
terraform {
required_providers {
sumologic = {
source = "sumologic.com/dev/sumologic"
version = "~> 1.0.0"
}
}
}
Note: Acceptance tests create real resources, and often cost money to run.
Create a personal access key for your Sumo Logic account, and set the following environment variables.
$ export SUMOLOGIC_ACCESSID="yourAccessID"
$ export SUMOLOGIC_ACCESSKEY="yourAccessKey"
$ export SUMOLOGIC_ENVIRONMENT="yourEnvironment"
$ export SUMOLOGIC_BASE_URL="yourEnvironmentAPIUrl" # not required for most production deployments
$ export TF_ACC=1
More information on configuration can be found here.
# Run all acceptance tests:
$ make testacc
# Run a specific test:
$ go test -v ./sumologic -run YourSpecificTestName
Some tests require additional configuration for interacting with resources external to Sumo Logic:
- GCP metrics
export SUMOLOGIC_TEST_GOOGLE_APPLICATION_CREDENTIALS=$(cat /path/to/service_acccount.json)
export SUMOLOGIC_ENABLE_GCP_METRICS_ACC_TESTS="false"
to disable acceptance tests