Skip to content

Commit

Permalink
Merge pull request #4 from quantum-sec/revert-3-feature/XDR-4570
Browse files Browse the repository at this point in the history
Revert "XDR-4570: Remove inutile terraform package module"
  • Loading branch information
chrisjaimon2012 authored Sep 27, 2023
2 parents a020896 + eff5d8e commit a1abdeb
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 0 deletions.
27 changes: 27 additions & 0 deletions modules/sentinel-workbooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.2 |
| <a name="requirement_null"></a> [null](#requirement\_null) | ~> 3.2.1 |
| <a name="requirement_template"></a> [template](#requirement\_template) | ~> 2.2.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_custom_sentinel_workbooks"></a> [custom\_sentinel\_workbooks](#module\_custom\_sentinel\_workbooks) | ../sentinel-workbook | n/a |
| <a name="module_sentinel_workbooks"></a> [sentinel\_workbooks](#module\_sentinel\_workbooks) | ../sentinel-workbook | n/a |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_default_workbook_path"></a> [default\_workbook\_path](#input\_default\_workbook\_path) | The path of the default workbooks. | `string` | n/a | yes |
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | The name of the resource group in which this resource will be provisioned. | `string` | n/a | yes |
| <a name="input_workbook_source_id"></a> [workbook\_source\_id](#input\_workbook\_source\_id) | The resource id of log analytics workspace on which the workbook will be deployed. | `string` | n/a | yes |
| <a name="input_custom_workbook_path"></a> [custom\_workbook\_path](#input\_custom\_workbook\_path) | The path of the custom workbooks. | `string` | `""` | no |
| <a name="input_custom_workbooks"></a> [custom\_workbooks](#input\_custom\_workbooks) | A list of custom workbooks to be deployed from the custom-workbooks folder. | `set(string)` | `[]` | no |
| <a name="input_default_workbooks"></a> [default\_workbooks](#input\_default\_workbooks) | A list of default workbooks to be deployed. | `set(string)` | `[]` | no |
<!-- END_TF_DOCS -->
39 changes: 39 additions & 0 deletions modules/sentinel-workbooks/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
terraform {
required_version = ">= 1.2"

required_providers {
null = {
source = "hashicorp/null"
version = "~> 3.2.1"
}

template = {
source = "hashicorp/template"
version = "~> 2.2.0"
}
}
}

# Deploy default workbooks
module "sentinel_workbooks" {
source = "../sentinel-workbook"

for_each = var.default_workbooks

content_path_workbooks = var.default_workbook_path
workbook_source_id = var.workbook_source_id
name = replace(basename(each.value), ".json", "")
resource_group_name = var.resource_group_name
}

# Deploy custom workbooks
module "custom_sentinel_workbooks" {
source = "../sentinel-workbook"

for_each = var.custom_workbooks

content_path_workbooks = var.custom_workbook_path
workbook_source_id = var.workbook_source_id
name = replace(basename(each.value), ".json", "")
resource_group_name = var.resource_group_name
}
36 changes: 36 additions & 0 deletions modules/sentinel-workbooks/vars.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# ---------------------------------------------------------------------------------------------------------------------
# MODULE VARIABLES
# ---------------------------------------------------------------------------------------------------------------------

variable "workbook_source_id" {
description = "The resource id of log analytics workspace on which the workbook will be deployed."
type = string
}

variable "resource_group_name" {
description = "The name of the resource group in which this resource will be provisioned."
type = string
}

variable "default_workbooks" {
type = set(string)
default = []
description = "A list of default workbooks to be deployed."
}

variable "custom_workbooks" {
type = set(string)
default = []
description = "A list of custom workbooks to be deployed from the custom-workbooks folder."
}

variable "custom_workbook_path" {
description = "The path of the custom workbooks."
type = string
default = ""
}

variable "default_workbook_path" {
description = "The path of the default workbooks."
type = string
}

0 comments on commit a1abdeb

Please sign in to comment.