You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
merge takes an arbitrary number of maps or objects, and returns a single map or object that contains a merged set of elements from all arguments.
If more than one given map or object defines the same key or attribute, then the one that is later in the argument sequence takes precedence. If the argument types do not match, the resulting type will be an object matching the type structure of the attributes after the merging rules have been applied.
merge(): does not recursively merge values that are objects and maps
Kyle Kotowik's deepmerge module: is computationally intensive (since the tree must be flattened, merged, then re-created) and is currently not usable if infracost is used for PR costing […]
The merge algorithm for list_of_items_to_merge is as follows:
items of different types are handled based on the type_mismatch_strategy:
complex_wins: object and map win over lists which win over literals; the losers are removed from the merge;
abort: abort the terraform plan or apply
if all items are literals, the rightmost item is used
if the remaining items are lists, the list_merge_strategy specified (which defaults to "replace") is applied:
replace: the list of the right most argument applies
concat: the sequence of lists is concatenated in the same order as arguments
merge: each list is appended with null so they all have the same length, then the deepmerge() is applied to each slice through the lists
if the remaining items are maps or objects (the most common case), if more than one defines the same key or attribute, the deepmerge() is applied to the sequence of associated values across all the items
What functionality would you like to see?
From Terraform merge():
From hashicorp/terraform#31815:
Proposed UX
Problem
deepmerge
function opentofu/opentofu#790deepmerge()
function hashicorp/terraform#31815Possible solutions
The text was updated successfully, but these errors were encountered: