diff --git a/README.md b/README.md index a70dd54..539a924 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,14 @@ A Terraform Module to create a Deployment and other resources necessary for depl |------|---------| | [terraform](#requirement\_terraform) | >= 0.12.31 | | [kubernetes](#requirement\_kubernetes) | >= 2.0.0 | +| [lacework](#requirement\_lacework) | ~> 1.18 | ## Providers | Name | Version | |------|---------| | [kubernetes](#provider\_kubernetes) | >= 2.0.0 | +| [lacework](#provider\_lacework) | ~> 1.18 | | [tls](#provider\_tls) | n/a | ## Modules @@ -47,6 +49,7 @@ No modules. | [tls_private_key.admission](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) | resource | | [tls_private_key.ca](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) | resource | | [tls_self_signed_cert.ca](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/self_signed_cert) | resource | +| [lacework_metric_module.lwmetrics](https://registry.terraform.io/providers/lacework/lacework/latest/docs/data-sources/metric_module) | data source | ## Inputs diff --git a/main.tf b/main.tf index d7537c8..9ab4553 100644 --- a/main.tf +++ b/main.tf @@ -1,3 +1,9 @@ +locals { + version_file = "${abspath(path.module)}/VERSION" + module_name = basename(abspath(path.module)) + module_version = fileexists(local.version_file) ? file(local.version_file) : "" +} + resource "kubernetes_deployment" "lacework_admission_controller" { metadata { name = var.admission_controller_name @@ -332,3 +338,8 @@ resource "kubernetes_service" "lacework_proxy_scanner_service" { } } } + +data "lacework_metric_module" "lwmetrics" { + name = local.module_name + version = local.module_version +} diff --git a/versions.tf b/versions.tf index e3ee9bf..6e13f28 100644 --- a/versions.tf +++ b/versions.tf @@ -3,5 +3,10 @@ terraform { required_providers { kubernetes = ">= 2.0.0" + + lacework = { + source = "lacework/lacework" + version = "~> 1.18" + } } }