package
1.4.0
Repository: https://github.com/gprossliner/go-graylog.git
Documentation: pkg.go.dev

# README

terraform-provider-graylog

GoDoc CircleCI codecov Go Report Card GitHub last commit GitHub tag License

terraform provider for Graylog.

This is sub project of go-graylog.

Motivation

http://docs.graylog.org/en/2.5/pages/users_and_roles/permission_system.html

The Graylog permission system is extremely flexible but you can't utilize this flexibility from Web UI. By using this provider, you can utilize this flexibility and manage the infrastructure as code.

Install

Download binary and install under ~/.terraform.d/plugins.

https://www.terraform.io/docs/configuration/providers.html#third-party-plugins

$ GO_GRAYLOG_VERSION=0.11.0
$ GO_GRAYLOG_ARCH=darwin_amd64
$ wget https://github.com/suzuki-shunsuke/go-graylog/releases/download/v${GO_GRAYLOG_VERSION}/terraform-provider-graylog_v${GO_GRAYLOG_VERSION}_${GO_GRAYLOG_ARCH}.gz
$ gzip -d terraform-provider-graylog_v${GO_GRAYLOG_VERSION}_${GO_GRAYLOG_ARCH}.gz
$ mkdir -p ~/.terraform.d/plugins
$ mv terraform-provider-graylog_v${GO_GRAYLOG_VERSION}_${GO_GRAYLOG_ARCH} ~/.terraform.d/plugins/terraform-provider-graylog_v${GO_GRAYLOG_VERSION}
$ chmod +x ~/.terraform.d/plugins/terraform-provider-graylog_v${GO_GRAYLOG_VERSION}

Docker Image

https://hub.docker.com/r/suzukishunsuke/terraform-graylog/

Docker image which is installed terraform and terraform-provider-graylog on alpine.

Example

provider "graylog" {
  web_endpoint_uri = "${var.web_endpoint_uri}"
  auth_name = "${var.auth_name}"
  auth_password = "${var.auth_password}"
}

// Role my-role-2
resource "graylog_role" "my-role-2" {
  name = "my-role-2"
  permissions = ["users:edit"]
  description = "Created by terraform"
}

And please see https://github.com/suzuki-shunsuke/example/tree/master/graylog-terraform also.

Variables

Required

nameEnvironment variabledescription
web_endpoint_uriGRAYLOG_WEB_ENDPOINT_URI
auth_nameGRAYLOG_AUTH_NAME
auth_passwordGRAYLOG_AUTH_PASSWORD

Optional

nameEnvironment variabledefaultdescription
x_requested_byGRAYLOG_X_REQUESTED_BYterraform-go-graylogX-Requested-By Header

Resources

Unsupported resources

We can't support these resources for some reasons.

CollectorConfiguration (includes input, output snippet)

We can't support these resources because graylog API doesn't return the created resource id (response body: no content).

The following APIs doesn't return the created resource id (response body: no content).

  • POST /plugins/org.graylog.plugins.collector/configurations/{id}/inputs Create a configuration input
  • POST /plugins/org.graylog.plugins.collector/configurations/{id}/outputs Create a configuration output
  • POST /plugins/org.graylog.plugins.collector/configurations/{id}/snippets Create a configuration snippet

# Packages

Package graylog provides the terraform provider for Graylog.