Skip to content

Commit

Permalink
chore: add lacework_metric_module datasource (#78)
Browse files Browse the repository at this point in the history
* chore: add lacework_metric_module datasource

Signed-off-by: Darren Murray <[email protected]>

* chore: add lacework_metric_module datasource

Signed-off-by: Darren Murray <[email protected]>

---------

Signed-off-by: Darren Murray <[email protected]>
  • Loading branch information
dmurray-lacework authored Jan 22, 2024
1 parent e01ebdd commit 3a5c1c8
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ The `main.tf` file will configure a Kubernetes Secret and DaemonSet which will t
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.0.0 |
| <a name="requirement_lacework"></a> [lacework](#requirement\_lacework) | ~> 1.18 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.0.0 |
| <a name="provider_lacework"></a> [lacework](#provider\_lacework) | ~> 1.18 |
| <a name="provider_random"></a> [random](#provider\_random) | n/a |

## Modules
Expand All @@ -45,6 +47,7 @@ No modules.
| [kubernetes_service_account.lacework_k8s_collector](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/service_account) | resource |
| [random_id.cluster_config_name_tail](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |
| [random_id.node_config_name_tail](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |
| [lacework_metric_module.lwmetrics](https://registry.terraform.io/providers/lacework/lacework/latest/docs/data-sources/metric_module) | data source |

## Inputs

Expand Down
2 changes: 1 addition & 1 deletion examples/custom-cluster-analysis/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
kubernetes = "~> 2.2"
lacework = {
source = "lacework/lacework"
version = "~> 1.0"
version = "~> 1.18"
}
}
}
2 changes: 1 addition & 1 deletion examples/custom-priority-class-name/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
kubernetes = "~> 2.2"
lacework = {
source = "lacework/lacework"
version = "~> 0.4"
version = "~> 1.18"
}
}
}
2 changes: 1 addition & 1 deletion examples/default/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
kubernetes = "~> 2.2"
lacework = {
source = "lacework/lacework"
version = "~> 0.4"
version = "~> 1.18"
}
}
}
2 changes: 1 addition & 1 deletion examples/with-syscall-config/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
kubernetes = "~> 2.2"
lacework = {
source = "lacework/lacework"
version = "~> 1.0"
version = "~> 1.18"
}
}
}
9 changes: 9 additions & 0 deletions lacework_node.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ locals {

# A list we can iterate on in our dynamic statement to mount config files
config_items = var.lacework_enable_default_syscall_config ? ["config.json", "syscall_config.yaml"] : ["config.json"]

version_file = "${abspath(path.module)}/VERSION"
module_name = basename(abspath(path.module))
module_version = fileexists(local.version_file) ? file(local.version_file) : ""
}

resource "random_id" "node_config_name_tail" {
Expand Down Expand Up @@ -313,3 +317,8 @@ resource "kubernetes_daemonset" "lacework_datacollector" {
}
}
}

data "lacework_metric_module" "lwmetrics" {
name = local.module_name
version = local.module_version
}
5 changes: 5 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ terraform {

required_providers {
kubernetes = ">= 2.0.0"

lacework = {
source = "lacework/lacework"
version = "~> 1.18"
}
}
}

0 comments on commit 3a5c1c8

Please sign in to comment.