Skip to content

Commit

Permalink
chore: add lacework_metric_module datasource (#8)
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 c4e03b2 commit e7e8b23
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ A Terraform Module to create a Deployment and other resources necessary for depl
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <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_tls"></a> [tls](#provider\_tls) | n/a |

## Modules
Expand Down Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -332,3 +338,8 @@ resource "kubernetes_service" "lacework_proxy_scanner_service" {
}
}
}

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 e7e8b23

Please sign in to comment.