Skip to content

Commit

Permalink
chore: add lacework_metric_module datasource (#51)
Browse files Browse the repository at this point in the history
* chore: 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>

---------

Signed-off-by: Darren Murray <darren.murray@lacework.net>
  • Loading branch information
dmurray-lacework authored Jan 19, 2024
1 parent 0051eb6 commit c361855
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ A Terraform Module to integrate Amazon Container Registries (ECR) with Lacework.
|------|---------|
| <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.1 |
| <a name="requirement_lacework"></a> [lacework](#requirement\_lacework) | ~> 1.18 |
| <a name="requirement_time"></a> [time](#requirement\_time) | ~> 0.6 |

## Providers

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

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

Expand Down
8 changes: 8 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {}
Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
time = "~> 0.6"
lacework = {
source = "lacework/lacework"
version = "~> 1.1"
version = "~> 1.18"
}
}
}

0 comments on commit c361855

Please sign in to comment.