Skip to content

Commit

Permalink
chore: add lacework metrics data source (#69)
Browse files Browse the repository at this point in the history
* feat: add lacework metrics data source

Signed-off-by: Darren Murray <darren.murray@lacework.net>

* feat: add lacework metrics data source

Signed-off-by: Darren Murray <darren.murray@lacework.net>

* feat: add telemetry var

Signed-off-by: Darren Murray <darren.murray@lacework.net>

* docs: update Readme

Signed-off-by: Darren Murray <darren.murray@lacework.net>

* docs: update Readme

Signed-off-by: Darren Murray <darren.murray@lacework.net>

* feat: add date source

Signed-off-by: Darren Murray <darren.murray@lacework.net>

* docs: update Readme

Signed-off-by: Darren Murray <darren.murray@lacework.net>

* chore: add lacework_metric_module datasource

Signed-off-by: Darren Murray <darren.murray@lacework.net>

* chore: add lacework_metric_module datasource

Signed-off-by: Darren Murray <darren.murray@lacework.net>

---------

Signed-off-by: Darren Murray <darren.murray@lacework.net>
  • Loading branch information
dmurray-lacework authored Jan 19, 2024
1 parent bd44cbb commit ce3a1bc
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 3 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 an AWS Systems Manager document for installing the
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.0 |
| <a name="requirement_lacework"></a> [lacework](#requirement\_lacework) | ~> 1.18 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.0 |
| <a name="provider_lacework"></a> [lacework](#provider\_lacework) | ~> 1.18 |

## Modules

Expand All @@ -29,6 +31,7 @@ No modules.
| Name | Type |
|------|------|
| [aws_ssm_document.setup_lacework_agent](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_document) | 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/access-lacework-token-via-provider/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
aws = "~> 3.0"
lacework = {
source = "lacework/lacework"
version = "~> 0.4"
version = "~> 1.18"
}
}
}
4 changes: 4 additions & 0 deletions examples/additional-agent-configuration/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ terraform {

required_providers {
aws = "~> 4.0"
lacework = {
source = "lacework/lacework"
version = "~> 1.18"
}
}
}
2 changes: 1 addition & 1 deletion examples/custom-server-url/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
aws = "~> 3.0"
lacework = {
source = "lacework/lacework"
version = "~> 0.4"
version = "~> 1.18"
}
}
}
4 changes: 4 additions & 0 deletions examples/default/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ terraform {

required_providers {
aws = "~> 3.0"
lacework = {
source = "lacework/lacework"
version = "~> 1.18"
}
}
}
2 changes: 1 addition & 1 deletion examples/enable-syscall-default-config/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
aws = "~> 3.0"
lacework = {
source = "lacework/lacework"
version = "~> 0.4"
version = "~> 1.18"
}
}
}
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 "aws_ssm_document" "setup_lacework_agent" {
name = "${var.aws_resources_prefix}setup-lacework-agent"
document_type = "Command"
Expand Down Expand Up @@ -81,3 +87,8 @@ resource "aws_ssm_document" "setup_lacework_agent" {

tags = var.aws_resources_tags
}

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 @@ -3,5 +3,9 @@ terraform {

required_providers {
aws = ">= 3.0"
lacework = {
source = "lacework/lacework"
version = "~> 1.18"
}
}
}

0 comments on commit ce3a1bc

Please sign in to comment.