Giter Site home page Giter Site logo

terraform-sumologic-sumo-logic-integrations's Introduction

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.28.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

terraform-sumologic-sumo-logic-integrations's People

Contributors

akhil-sumologic avatar arunpatyal avatar duchatran avatar himanshu219 avatar himsharma01 avatar npande avatar parabolic avatar perk-sumo avatar sumosourabh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-sumologic-sumo-logic-integrations's Issues

cloudtrail module is not validating enymore

reproduce steps:
git clone clone https://github.com/SumoLogic/terraform-sumologic-sumo-logic-integrations.git
git checkout v1.0.7 -b v1.0.7
terraform --version

Terraform v1.1.4
on darwin_amd64

terraform validate

╷
│ Error: Value for unconfigurable attribute
│
│   with aws_s3_bucket.s3_bucket,
│   on cloudtrail.tf line 21, in resource "aws_s3_bucket" "s3_bucket":
│   21:   policy = templatefile("${path.module}/templates/cloudtrail_bucket_policy.tmpl", {
│   22:     BUCKET_NAME = local.bucket_name
│   23:   })
│
│ Can't configure a value for "policy": its value will be decided automatically based on the result of applying this configuration.
╵

invalid iam role error when creating the cloudwatchmetrics module resources

Issue Summary

Error Message

Error: { "status" : 400, "id" : "2XJ56-R5THO-8IWKT", "code" : "collectors.validation.fields.invalid", "message" : "Invalid IAM role: 'errorMessage=null'." }
with module.sumologic.module.cloudwatch_metrics.sumologic_cloudwatch_source.cloudwatch_metrics_sources
on .terraform/modules/sumologic.cloudwatch_metrics/aws/cloudwatchmetrics/cloudwatchmetrics.tf line 45, in resource "sumologic_cloudwatch_source" "cloudwatch_metrics_sources":

Steps to Reproduce

  1. Implement cloudwatchmetrics module locally.
  2. Run terraform apply.
  3. See error and frown.

Resource and Local Versions

In my module:

module "cloudwatch_metrics" {
  source = "git::https://github.com/SumoLogic/terraform-sumologic-sumo-logic-integrations.git//aws/cloudwatchmetrics"

  create_collector          = true
  sumologic_organization_id = var.sumologic_organization_id
  wait_for_seconds          = 300 # tried increasing this from the default of 180 with no luck
}

Local version of tf:

infra on  main [$] via 💠 infra on ☁️  (us-east-1) on ☁️
❯ tf version
Terraform v1.1.5
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v3.75.1
+ provider registry.terraform.io/hashicorp/random v3.1.2
+ provider registry.terraform.io/hashicorp/time v0.7.2
+ provider registry.terraform.io/launchdarkly/launchdarkly v2.5.0
+ provider registry.terraform.io/mongodb/mongodbatlas v1.3.0
+ provider registry.terraform.io/sumologic/sumologic v2.14.0

aws_kinesis_firehose_delivery_stream resources should have server_side_encryption enabled by default

Why? Because compliance/config policy sets will pick up on encryption at rest violations.

See https://github.com/SumoLogic/terraform-sumologic-sumo-logic-integrations/blob/master/aws/kinesisfirehoseformetrics/kinesisfirehoseformetrics.tf#L97

And https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kinesis_firehose_delivery_stream#server_side_encryption

Could be AWS managed key (default) or a CMK (pass the ARN into the module as an argument)?

error thrown upon subsequent apply of cloudwatchlogsforwarder module

Issue Summary

Error Message

Error: error creating Serverless Application Repository CloudFormation Stack (arn:aws:cloudformation:us-east-1:$REDACTED:stack/serverlessrepo-Auto-Enable-Logs-Subscription-fk7p6hrzd8/0cb5d400-b147-11ec-b7f7-0e3a1717c7b1) change set: unexpected state 'FAILED', wanted target 'CREATE_COMPLETE'. last error: No updates are to be performed.
with module.sumologic.module.cloudwatch_logs.aws_serverlessapplicationrepository_cloudformation_stack.auto_enable_logs_subscription["auto_enable_logs_subscription"]
on .terraform/modules/sumologic.cloudwatch_logs/aws/cloudwatchlogsforwarder/cloudwatchlogsforwarder.tf line 188, in resource "aws_serverlessapplicationrepository_cloudformation_stack" "auto_enable_logs_subscription":

Steps to Reproduce

  1. Implement cloudwatchlogsforwarder module locally.
  2. Run terraform apply.
  3. Verify resources exist and logs stream in.
  4. Make changes to a different resource that's not a dependency.
  5. Run terraform apply once more.
  6. See error and frown.

Resource and Local Versions

In my module:

module "cloudwatch_logs" {
  source = "git::https://github.com/SumoLogic/terraform-sumologic-sumo-logic-integrations.git//aws/cloudwatchlogsforwarder"

  # Email used for Cloudwatch Alerts
  email_id         = var.email_id
  create_collector = true
}

Local version of tf:

infra on  main [$] via 💠 infra on ☁️  (us-east-1) on ☁️
❯ tf version
Terraform v1.1.5
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v3.75.1
+ provider registry.terraform.io/hashicorp/random v3.1.2
+ provider registry.terraform.io/hashicorp/time v0.7.2
+ provider registry.terraform.io/launchdarkly/launchdarkly v2.5.0
+ provider registry.terraform.io/mongodb/mongodbatlas v1.3.0
+ provider registry.terraform.io/sumologic/sumologic v2.14.0

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.