From a2f91a55f1ea28cde1eb70b8b7afdd39e811af75 Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Wed, 20 Dec 2023 16:03:00 -0500 Subject: [PATCH] Use the multi-variable `for` when walking a `map` type. The previous "fix" was still broken, but this cleanly applies with my local example changed to use the recorder. Signed-off-by: Matt Moore --- cloudevent-recorder/README.md | 8 ++++---- cloudevent-recorder/recorder.tf | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cloudevent-recorder/README.md b/cloudevent-recorder/README.md index bce32b78..7d26a853 100644 --- a/cloudevent-recorder/README.md +++ b/cloudevent-recorder/README.md @@ -36,10 +36,10 @@ module "foo-emits-events" { retention-period = 30 // keep around 30 days worth of event data - types = { - "com.example.foo": file("${path.module}/foo.schema.json"), - "com.example.bar": file("${path.module}/bar.schema.json"), - } + types = { + "com.example.foo": file("${path.module}/foo.schema.json"), + "com.example.bar": file("${path.module}/bar.schema.json"), + } } ``` diff --git a/cloudevent-recorder/recorder.tf b/cloudevent-recorder/recorder.tf index ff117410..cc1e6fc8 100644 --- a/cloudevent-recorder/recorder.tf +++ b/cloudevent-recorder/recorder.tf @@ -126,6 +126,6 @@ module "recorder-dashboard" { service_name = var.name triggers = { - for type in var.types : "type: ${type}" => "${var.name}-${random_id.trigger-suffix[type].hex}" + for type, schema in var.types : "type: ${type}" => "${var.name}-${random_id.trigger-suffix[type].hex}" } }