|
| 1 | +# terraform-sumologic-integrations |
| 2 | + |
| 3 | +Configure Sumo Logic Applications using Terraform modules. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +#### Requirements |
| 8 | + |
| 9 | +* [Terraform 0.12.26+](https://www.terraform.io/downloads.html) |
| 10 | +* [curl](https://curl.haxx.se/download.html) for App installations. |
| 11 | + |
| 12 | +#### Sumo Logic Provider |
| 13 | + |
| 14 | +```shell |
| 15 | +provider "sumologic" { |
| 16 | + access_id = "<SUMOLOGIC ACCESS ID>" |
| 17 | + access_key = "<SUMOLOGIC ACCESS KEY>" |
| 18 | + environment = "<SUMOLOGIC DEPLOYMENT>" |
| 19 | +} |
| 20 | +``` |
| 21 | +You can also define these values in `terraform.tfvars`. |
| 22 | + |
| 23 | +#### REST Api Provider |
| 24 | + |
| 25 | +Two REST API provider configurations are required by these modules: |
| 26 | + |
| 27 | +1. Sumo Logic REST Api provider configuration is required for App installations and is needed for all integrations involving App configuration and installation: |
| 28 | + |
| 29 | +```shell |
| 30 | +provider "restapi" { |
| 31 | + alias = "sumo" |
| 32 | + uri = "<SUMOLOGIC ENDPOINT URI>" |
| 33 | + write_returns_object = true |
| 34 | + username = "<SUMOLOGIC ACCESS ID>" |
| 35 | + password = "<SUMOLOGIC ACCESS KEY>" |
| 36 | + headers = { Content-Type = "application/json" } |
| 37 | +} |
| 38 | +``` |
| 39 | +You can also define these values in `terraform.tfvars`. |
| 40 | +
|
| 41 | +2. Opsgenie REST Api provider configuration is required for configuring webhooks in Opsgenie and is needed for Opsgenie integration configuration: |
| 42 | +
|
| 43 | +```shell |
| 44 | +provider "restapi" { |
| 45 | + alias = "opsgenie" |
| 46 | + uri = "https://api.opsgenie.com" |
| 47 | + write_returns_object = true |
| 48 | + headers = { Content-Type = "application/json", Authorization = "GenieKey <OPSGENIE KEY>" } |
| 49 | +} |
| 50 | +``` |
| 51 | +You can also define these values in `terraform.tfvars`. |
| 52 | +
|
| 53 | +#### Prerequisites for using Modules |
| 54 | +
|
| 55 | +All App integrations needs a collector and a folder where the App should be installed. |
| 56 | +Sumo Logic Webhooks do not need a collector or folder. |
| 57 | +
|
| 58 | +Configure the collector resource as below: |
| 59 | +
|
| 60 | +```shell |
| 61 | +resource "sumologic_collector" "atlassian_collector" { |
| 62 | + name = "Atlassian" |
| 63 | + category = "Atlassian" |
| 64 | +} |
| 65 | +``` |
| 66 | +
|
| 67 | +In the module declaration, pass the collector id as `sumologic_collector.atlassian_collector.id`. |
| 68 | +
|
| 69 | +Configure a folder as below: |
| 70 | +
|
| 71 | +```shell |
| 72 | +data "sumologic_personal_folder" "personalFolder" {} |
| 73 | +resource "sumologic_folder" "folder" { |
| 74 | + name = "Atlassian" |
| 75 | + description = "Atlassian Applications" |
| 76 | + parent_id = data.sumologic_personal_folder.personalFolder.id |
| 77 | + depends_on = [sumologic_collector.atlassian_collector] |
| 78 | +} |
| 79 | +``` |
| 80 | +
|
| 81 | +In the module declaration, pass the folder id as `sumologic_folder.folder.id`. |
| 82 | +
|
| 83 | +#### Module Declaration |
| 84 | +
|
| 85 | +##### Opsgenie |
| 86 | +
|
| 87 | +```shell |
| 88 | +module "sumologic-jira-opsgenie-app" { |
| 89 | + source = "github.com/SumoLogic/sumologic-terraform-integrations//atlassian/cloud/opsgenie" |
| 90 | + providers = { |
| 91 | + restapi = restapi.opsgenie |
| 92 | + } |
| 93 | + sumo_access_id = "<SUMOLOGIC ACCESS ID>" |
| 94 | + sumo_access_key = "<SUMOLOGIC ACCESS KEY>" |
| 95 | + sumo_api_endpoint = "<SUMOLOGIC ENDPOINT URI>" |
| 96 | + collector_id = sumologic_collector.atlassian_collector.id |
| 97 | + source_category = "Atlassian/Opsgenie" |
| 98 | + folder_id = sumologic_folder.folder.id |
| 99 | + # version = "{revision}" |
| 100 | +} |
| 101 | +``` |
| 102 | +
|
| 103 | +##### Jira Cloud |
| 104 | +
|
| 105 | +```shell |
| 106 | +module "sumologic-jira-cloud-app" { |
| 107 | + source = "github.com/SumoLogic/sumologic-terraform-integrations//atlassian/cloud/jira" |
| 108 | + sumo_access_id = "<SUMOLOGIC ACCESS ID>" |
| 109 | + sumo_access_key = "<SUMOLOGIC ACCESS KEY>" |
| 110 | + sumo_api_endpoint = "<SUMOLOGIC ENDPOINT URI>" |
| 111 | + collector_id = sumologic_collector.atlassian_collector.id |
| 112 | + source_category = "Atlassian/Cloud/Jira" |
| 113 | + folder_id = sumologic_folder.folder.id |
| 114 | + jira_cloud_jql = "" # Optional |
| 115 | + jira_cloud_events = ["jira:issue_created", "jira:issue_updated"] # Optional. By default all events are configured. |
| 116 | + # version = "{revision}" |
| 117 | +} |
| 118 | +``` |
| 119 | +
|
| 120 | +See respective module readme and examples for more details. |
0 commit comments