Git Product home page Git Product logo

terraform-provider-splunk's Introduction

Terraform Provider for Splunk Enterprise

Requirements

  • Terraform v0.12
  • Go go1.14.4 (to build the provider plugin)

Building The Provider

Clone the repository

Create go src directory and setup $GOPATH

Build the provider: make build

Developing The Provider

  • Use the Splunk REST API manual to design resource schemas for the provider.
  • Add a resource_x_test.go file to test the new resources' CRUD operations
  • Before merging your changes lint your code by running make fmt
  • Test the provider with the existing suite of provider tests before merging your changes
  • Build the provider and test the new resources' CRUD and import operations before merging your changes
  • Add all necessary documentation in the docs folder
  • As per best practices, update changelog.md and version as required

Testing The Provider

  • To run unit tests: make test
  • To run acceptance tests: make testacc
    • Set the following variables to run acceptance tests SPLUNK_HOME, SPLUNK_USERNAME, SPLUNK_URL, SPLUNK_PASSWORD

Using the provider

  • Install Terraform
  • Build the binary by make build
  • Initialize terraform by terraform init
  • Run terraform plan and terraform apply to apply configurations
  • To update run terraform plan first to check config diff
  • For importing existing resources use terraform import
  • To remove all terraform managed resources use terraform destroy
  • Use terraform refresh for state migrations to be applied

NOTE: When developing and testing local provider builds, if terraform version >= 0.13 you would have to replace the provider binaries in the .terraform folder with your local build. Follow these guidelines

Contributions

We are open to contributions!

Please follow development guidelines and feel free to open a PR against the `master` branch with your changes. The PR should trigger the GitHub actions to run both the unit and acceptance tests. Once all tests have passed, our team will review, make suggestions, approve, and merge the PR. After merging, our team will update the changelog.MD file and create a version tag that should automatically create a new release.

Examples

  • The examples folder contains a few basic splunk provider examples, run terraform init and terraform apply to apply these example configuration.
  • Resource examples are also available in their respective docs/resources folder

NOTE: Create a resource block first before importing resources. Docs on the import usage

Notes and Troubleshooting

  • For Splunk Cloud Platform instance configurations, use Terraform Provider for Splunk Cloud Platform instead.
  • When conflicts arise during resource creation, import the resource first using terraform import command and make modifications to the resource.
  • The error too many open files may be due to ulimit settings on your machine. Check current and increase the maximum number of open files 1024 using ulimit -n 1024
  • When deleting or editing conf files manually, restart Splunk to ensure state consistency before applying or reapplying a template.
  • Splunk environment with numerous indexes, saved searches, knowledge objects, etc. may cause issues with the provided tests. To avoid these errors, use a fresh or lightly configured Splunk environment.

Support

Use the GitHub issue tracker to submit bugs or request features.

  • Please add the Terraform and provider version, and the version of Splunk Enterprise used.

Splunk Ideas is another place for your suggestions and Splunk Answers for questions.

terraform-provider-splunk's People

Contributors

micahkemp-splunk avatar rrossetti-splunk avatar anushjay avatar petropliuta avatar zscholl avatar nstonesplunk avatar mcmluk-monster avatar bedinger avatar shaunhouseman avatar jiananzx avatar xboarder56 avatar jinyulin avatar sriniketh923 avatar sortigoza avatar mrboso avatar markdingram avatar jkoby avatar jamesmoriarty avatar genevieveluyt avatar yorokobi avatar clete2 avatar bhayes-zd avatar asvoboda avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.