File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,7 +89,6 @@ locals {
8989# }
9090
9191locals {
92- # Step 1: Flatten all secret_environment_variables lists into one
9392 all_secret_dicts = concat (
9493 local. function_tokens_config . secret_environment_variables ,
9594 local. function_process_validation_report_config . secret_environment_variables ,
@@ -101,13 +100,13 @@ locals {
101100 local. function_tasks_executor_config . secret_environment_variables
102101 )
103102
104- # Step 2: Create a map with key = secret.key, value = full secret (to deduplicate by key)
105- unique_secret_dict_map = {
106- for s in local . all_secret_dicts : s . key => s
107- }
108-
109- # Step 3: Convert the map back to a list
110- unique_secret_dicts = values (local . unique_secret_dict_map )
103+ # Remove duplicates by key, keeping the first occurrence
104+ unique_secret_dicts = [
105+ for i , s in local . all_secret_dicts :
106+ s if index ([
107+ for j in local . all_secret_dicts : j . key
108+ ], s . key ) == i
109+ ]
111110}
112111
113112
You can’t perform that action at this time.
0 commit comments