From 0280d33f9abac709d164b54b1e64623254eb876c Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Wed, 20 Dec 2023 16:06:25 -0500 Subject: [PATCH] Use the multi-variable `for` when walking a `map` type. (#23) --- 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}" } }