diff --git a/download_reporter_package.tf b/download_reporter_package.tf index 1e861f1..b852e08 100644 --- a/download_reporter_package.tf +++ b/download_reporter_package.tf @@ -3,19 +3,14 @@ locals { downloaded = "downloaded_package_${md5(local.package_url)}.zip" } -resource "null_resource" "download_package" { - triggers = { - downloaded = local.downloaded - } +resource "terraform_data" "download_package" { + input = local.downloaded + + triggers_replace = [ + local.downloaded + ] provisioner "local-exec" { command = "curl -L -o ${local.downloaded} ${local.package_url}" } -} - -data "null_data_source" "downloaded_package" { - inputs = { - id = null_resource.download_package.id - filename = local.downloaded - } } \ No newline at end of file diff --git a/examples/ecs/main.tf b/examples/ecs/main.tf index 4579f44..b0cb194 100644 --- a/examples/ecs/main.tf +++ b/examples/ecs/main.tf @@ -25,11 +25,11 @@ module "lambda_reporter" { source = "kosli-dev/kosli-reporter/aws" version = "0.5.0" - name = local.reporter_name - kosli_environment_type = "ecs" - kosli_cli_version = "v2.7.8" - kosli_environment_name = "staging" - kosli_org = "my_org" + name = local.reporter_name + kosli_environment_type = "ecs" + kosli_cli_version = "v2.7.8" + kosli_environment_name = "staging" + kosli_org = "my_org" # kosli_host = "https://app.kosli.com" # defaulted to app.kosli.com reported_aws_resource_name = "my_ecs_cluster" kosli_command_optional_parameters = "-s my-service" diff --git a/examples/lambda-report-selectively/main.tf b/examples/lambda-report-selectively/main.tf index 0818d8e..4ff3c50 100644 --- a/examples/lambda-report-selectively/main.tf +++ b/examples/lambda-report-selectively/main.tf @@ -30,11 +30,11 @@ module "lambda_reporter" { source = "kosli-dev/kosli-reporter/aws" version = "0.5.0" - name = local.reporter_name - kosli_environment_type = "lambda" - kosli_cli_version = "v2.7.8" - kosli_environment_name = "staging" - kosli_org = "my_org" + name = local.reporter_name + kosli_environment_type = "lambda" + kosli_cli_version = "v2.7.8" + kosli_environment_name = "staging" + kosli_org = "my_org" # kosli_host = "https://app.kosli.com" # defaulted to app.kosli.com reported_aws_resource_name = var.my_lambda_functions use_custom_eventbridge_pattern = true diff --git a/examples/s3/main.tf b/examples/s3/main.tf index cb69359..806c675 100644 --- a/examples/s3/main.tf +++ b/examples/s3/main.tf @@ -25,11 +25,11 @@ module "lambda_reporter" { source = "kosli-dev/kosli-reporter/aws" version = "0.5.0" - name = local.reporter_name - kosli_environment_type = "s3" - kosli_cli_version = "v2.7.8" - kosli_environment_name = "staging" - kosli_org = "my_org" + name = local.reporter_name + kosli_environment_type = "s3" + kosli_cli_version = "v2.7.8" + kosli_environment_name = "staging" + kosli_org = "my_org" # kosli_host = "https://app.kosli.com" # defaulted to app.kosli.com reported_aws_resource_name = "my_s3_bucket" } diff --git a/main.tf b/main.tf index 439d45a..112a5fe 100644 --- a/main.tf +++ b/main.tf @@ -1,15 +1,16 @@ module "reporter_lambda" { source = "terraform-aws-modules/lambda/aws" - version = "4.18.0" + version = "7.7.0" attach_policy_json = true policy_json = var.create_role ? data.aws_iam_policy_document.combined[0].json : null - function_name = var.name - description = "Send reports to the Kosli app" - handler = "function.handler" - runtime = "provided.al2" - local_existing_package = data.null_data_source.downloaded_package.outputs["filename"] + function_name = var.name + description = "Send reports to the Kosli app" + handler = "function.handler" + runtime = "provided.al2" + # local_existing_package = data.null_data_source.downloaded_package.outputs["filename"] + local_existing_package = terraform_data.download_package.output role_name = var.create_role ? var.name : null timeout = var.lambda_timeout