diff --git a/README.md b/README.md
index a748d5b..89bde1c 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ A Terraform Module to integrate Amazon Container Registries (ECR) with Lacework.
|------|---------|
| [terraform](#requirement\_terraform) | >= 0.14 |
| [aws](#requirement\_aws) | >= 3.0 |
-| [lacework](#requirement\_lacework) | ~> 1.1 |
+| [lacework](#requirement\_lacework) | ~> 1.18 |
| [time](#requirement\_time) | ~> 0.6 |
## Providers
@@ -22,7 +22,7 @@ A Terraform Module to integrate Amazon Container Registries (ECR) with Lacework.
| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >= 3.0 |
-| [lacework](#provider\_lacework) | ~> 1.1 |
+| [lacework](#provider\_lacework) | ~> 1.18 |
| [time](#provider\_time) | ~> 0.6 |
## Modules
@@ -40,6 +40,7 @@ A Terraform Module to integrate Amazon Container Registries (ECR) with Lacework.
| [time_sleep.wait_time](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
+| [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 b1e0ccc..51b8648 100644
--- a/main.tf
+++ b/main.tf
@@ -5,6 +5,9 @@ locals {
iam_role_arn = module.lacework_ecr_iam_role.created ? module.lacework_ecr_iam_role.arn : var.iam_role_arn
iam_role_name = module.lacework_ecr_iam_role.created ? module.lacework_ecr_iam_role.name : var.iam_role_name
iam_role_external_id = module.lacework_ecr_iam_role.created ? module.lacework_ecr_iam_role.external_id : var.iam_role_external_id
+ version_file = "${abspath(path.module)}/VERSION"
+ module_name = basename(abspath(path.module))
+ module_version = fileexists(local.version_file) ? file(local.version_file) : ""
}
data "aws_region" "current" {}
@@ -52,3 +55,8 @@ resource "lacework_integration_ecr" "iam_role" {
limit_num_imgs = var.limit_num_imgs
depends_on = [time_sleep.wait_time]
}
+
+data "lacework_metric_module" "lwmetrics" {
+ name = local.module_name
+ version = local.module_version
+}
\ No newline at end of file
diff --git a/versions.tf b/versions.tf
index fe6c732..0664af7 100644
--- a/versions.tf
+++ b/versions.tf
@@ -6,7 +6,7 @@ terraform {
time = "~> 0.6"
lacework = {
source = "lacework/lacework"
- version = "~> 1.1"
+ version = "~> 1.18"
}
}
}