Skip to content

SumoLogic/terraform-sumologic-sumo-logic-integrations

Repository files navigation

terraform-sumologic-sumo-logic-integrations

Configure Sumo Logic Applications and Connections using Terraform modules. The modules configure/create the following resources:

  • A source under the specified collector for the integration in Sumo Logic.
  • App dashboards in the specified folder in Sumo Logic.
  • Connections in Sumo Logic.
  • Webhook configurations in JIRA, Bitbucket, Pagerduty or other chosen systems.
  • Resources in cloud systems such as AWS.

Getting Started

Requirements

  • Terraform 0.13+

  • curl for App installations.

  • Sumo Logic Terraform Provider

  • Null Terraform Provider.

  • Respective Terraform providers based on selections.

    Create a providers.tf file and add the requirements in the following format:

    terraform {
      required_version = ">= 0.13"
    
      required_providers {
        null = {
          version = "~> 2.1"
        }
        sumologic = {
          source  = "sumologic/sumologic"
          version = ">= 2.31.3, < 3.0.0"
        }
        jira = {
          source  = "fourplusone/jira"
          version = "~> 0.1.14"
        }
    
      }
    }

Sumo Logic Provider

provider "sumologic" {
  access_id   = "<SUMOLOGIC ACCESS ID>"
  access_key  = "<SUMOLOGIC ACCESS KEY>"
  environment = "<SUMOLOGIC DEPLOYMENT>"
}

You can also define these values in terraform.tfvars.

REST Api Provider

Sumo Logic REST Api provider configuration is required for App installations and is needed for all integrations involving App configuration and installation:

provider "restapi" {
  alias                = "sumo"
  uri                  = "<SUMOLOGIC ENDPOINT URI>"
  write_returns_object = true
  username             = "<SUMOLOGIC ACCESS ID>"
  password             = "<SUMOLOGIC ACCESS KEY>"
  headers              = { Content-Type = "application/json" }
}

You can also define these values in terraform.tfvars.

Prerequisites for using Modules

All App integrations need a collector and a folder where the App should be installed. Sumo Logic Connections do not need a collector or folder.

Configure the collector resource as below:

resource "sumologic_collector" "sumo_collector" {
  name     = "SumoLogic Integrations"
  category = "SumoLogic"
}

In the module declaration, pass the collector id as sumologic_collector.sumo_collector.id.

Configure a folder as below:

data "sumologic_personal_folder" "personalFolder" {}
resource "sumologic_folder" "folder" {
  name        = "SumoLogic Applications"
  description = "SumoLogic Applications Folder"
  parent_id   = data.sumologic_personal_folder.personalFolder.id
  depends_on  = [sumologic_collector.sumo_collector]
}

In the module declaration, pass the folder id as sumologic_folder.folder.id.

Module Declaration Example

Jira Cloud
module "sumologic-jira-cloud-app" {
  source            = "SumoLogic/sumo-logic-integrations/sumologic//atlassian/cloud/jira"
  version           = "{revision}"

  sumo_access_id    = "<SUMOLOGIC ACCESS ID>"
  sumo_access_key   = "<SUMOLOGIC ACCESS KEY>"
  sumo_api_endpoint = "<SUMOLOGIC ENDPOINT URI>"
  collector_id      = sumologic_collector.sumo_collector.id
  source_category   = "Atlassian/Cloud/Jira"
  folder_id         = sumologic_folder.folder.id
  jira_cloud_jql    = ""                                           # Optional
  jira_cloud_events = ["jira:issue_created", "jira:issue_updated"] # Optional. By default all events are configured.
  app_version       = "1.0"
}

See respective module readme and examples for more details.

Modules