Skip to content

Commit

Permalink
feat: add telemetry var
Browse files Browse the repository at this point in the history
Signed-off-by: Darren Murray <darren.murray@lacework.net>
  • Loading branch information
dmurray-lacework committed Jan 17, 2024
1 parent 3002000 commit 24b0d8d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 9 additions & 2 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 "aws_ssm_document" "setup_lacework_agent" {
name = "${var.aws_resources_prefix}setup-lacework-agent"
document_type = "Command"
Expand Down Expand Up @@ -83,6 +89,7 @@ resource "aws_ssm_document" "setup_lacework_agent" {
}

data "lacework_metrics" "lwmetrics" {
name = basename(abspath(path.module))
version = file("${abspath(path.module)}/VERSION")
count = var.lacework_telemetry_disabled ? 0 : 1
name = local.module_name
version = local.module_version
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ variable "lacework_enable_default_syscall_config" {
default = "false"
description = "A flag to enable the default syscall config"
}

variable "lacework_telemetry_disabled" {
type = bool
default = false
description = "Disable Lacework telemetry"
}

0 comments on commit 24b0d8d

Please sign in to comment.