Skip to content

Commit

Permalink
chore: add lacework_metric_module datasource (#52)
Browse files Browse the repository at this point in the history
Signed-off-by: Darren Murray <[email protected]>
  • Loading branch information
dmurray-lacework authored Jan 22, 2024
1 parent 0fd4a3e commit 6caa724
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ Lacework logins to Azure using a service principal (an App Registration) with Di
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14 |
| <a name="requirement_azuread"></a> [azuread](#requirement\_azuread) | ~> 2.25 |
| <a name="requirement_lacework"></a> [lacework](#requirement\_lacework) | ~> 1.18 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_azuread"></a> [azuread](#provider\_azuread) | ~> 2.25 |
| <a name="provider_lacework"></a> [lacework](#provider\_lacework) | ~> 1.18 |
| <a name="provider_time"></a> [time](#provider\_time) | n/a |

## Modules
Expand All @@ -37,6 +39,7 @@ No modules.
| [azuread_service_principal.lacework](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/service_principal) | resource |
| [time_sleep.wait_60_seconds](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
| [azuread_client_config.current](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/client_config) | data source |
| [lacework_metric_module.lwmetrics](https://registry.terraform.io/providers/lacework/lacework/latest/docs/data-sources/metric_module) | data source |

## Inputs

Expand Down
8 changes: 8 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ locals {
service_principal_id = var.create ? (
length(azuread_service_principal.lacework) > 0 ? azuread_service_principal.lacework[0].object_id : ""
) : ""
version_file = "${abspath(path.module)}/VERSION"
module_name = basename(abspath(path.module))
module_version = fileexists(local.version_file) ? file(local.version_file) : ""
}

data "azuread_client_config" "current" {}
Expand Down Expand Up @@ -57,3 +60,8 @@ resource "azuread_directory_role_assignment" "lacework_dir_reader" {
resource "time_sleep" "wait_60_seconds" {
create_duration = "60s"
}

data "lacework_metric_module" "lwmetrics" {
name = local.module_name
version = local.module_version
}
4 changes: 4 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ terraform {
source = "hashicorp/azuread"
version = "~> 2.25"
}
lacework = {
source = "lacework/lacework"
version = "~> 1.18"
}
}
}

0 comments on commit 6caa724

Please sign in to comment.