From 85fe64f8b804b801729ec8b7c73229a1db0c1620 Mon Sep 17 00:00:00 2001 From: Eric Milford Date: Wed, 17 Jan 2024 12:18:46 -0600 Subject: [PATCH] Convert jmesPath `object_alias` to `objectAlias` The module expects jmesPath object` definitions with `object_alias` and `path` keys. To be a valid jmesPath, SecretsManager requires converting `object_alias` to its CamelCase equivalent. Prior to this change no conversion was done which resulted in errors if using `jmesPath`s. To maintain snakecase in the variable definition and keep the documentation accurate, update the module to do the conversion. --- aws/secret-provider-class/main.tf | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/aws/secret-provider-class/main.tf b/aws/secret-provider-class/main.tf index 67b7048e..d0fae358 100644 --- a/aws/secret-provider-class/main.tf +++ b/aws/secret-provider-class/main.tf @@ -7,13 +7,22 @@ locals { objectName = secret.name objectType = "secretsmanager" - jmesPath = coalescelist(secret.jmes_paths, [ - for key in secret.environment_variables : - { - path = key - objectAlias = key - } - ]) + jmesPath = coalescelist( + [ + for jmes_path in secret.jmes_paths : + { + path = jmes_path.path, + objectAlias : jmes_path.object_alias + } + ], + [ + for key in secret.environment_variables : + { + path = key + objectAlias = key + } + ] + ) } ]) }