Skip to content

Commit bbfe4a7

Browse files
feat: add lacework_metric_module datasource (#153)
* feat: add lacework_metric_module datasource 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> --------- Signed-off-by: Darren Murray <darren.murray@lacework.net>
1 parent b989fcd commit bbfe4a7

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Terraform module for configuring an integration with Lacework and AWS for CloudT
1414
|------|---------|
1515
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14 |
1616
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0 |
17-
| <a name="requirement_lacework"></a> [lacework](#requirement\_lacework) | ~> 1.0 |
17+
| <a name="requirement_lacework"></a> [lacework](#requirement\_lacework) | >= 1.18 |
1818
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.1 |
1919
| <a name="requirement_time"></a> [time](#requirement\_time) | ~> 0.6 |
2020

@@ -23,7 +23,7 @@ Terraform module for configuring an integration with Lacework and AWS for CloudT
2323
| Name | Version |
2424
|------|---------|
2525
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |
26-
| <a name="provider_lacework"></a> [lacework](#provider\_lacework) | ~> 1.0 |
26+
| <a name="provider_lacework"></a> [lacework](#provider\_lacework) | >= 1.18 |
2727
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.1 |
2828
| <a name="provider_time"></a> [time](#provider\_time) | ~> 0.6 |
2929

@@ -72,6 +72,7 @@ Terraform module for configuring an integration with Lacework and AWS for CloudT
7272
| [aws_iam_policy_document.sns_topic_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
7373
| [aws_organizations_organization.organization](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/organizations_organization) | data source |
7474
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
75+
| [lacework_metric_module.lwmetrics](https://registry.terraform.io/providers/lacework/lacework/latest/docs/data-sources/metric_module) | data source |
7576

7677
## Inputs
7778

main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ locals {
3333
bucket_encryption_enabled = var.bucket_encryption_enabled && length(local.bucket_sse_key_arn) > 0
3434
bucket_versioning_enabled = var.bucket_versioning_enabled ? "Enabled" : "Suspended"
3535
bucket_sse_key_arn = var.use_existing_kms_key ? var.bucket_sse_key_arn : ((var.use_existing_cloudtrail || length(var.bucket_sse_key_arn) > 0) ? var.bucket_sse_key_arn : aws_kms_key.lacework_kms_key[0].arn)
36+
version_file = "${abspath(path.module)}/VERSION"
37+
module_name = basename(abspath(path.module))
38+
module_version = fileexists(local.version_file) ? file(local.version_file) : ""
3639
}
3740

3841
resource "random_id" "uniq" {
@@ -692,3 +695,8 @@ resource "lacework_integration_aws_ct" "default" {
692695

693696
depends_on = [time_sleep.wait_time]
694697
}
698+
699+
data "lacework_metric_module" "lwmetrics" {
700+
name = local.module_name
701+
version = local.module_version
702+
}

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ terraform {
1616
}
1717
lacework = {
1818
source = "lacework/lacework"
19-
version = "~> 1.0"
19+
version = ">= 1.18"
2020
}
2121
}
2222
}

0 commit comments

Comments
 (0)