If your AWS resources management is done using both CloudFormation and Terraform, and if there is overlap/dependency between your team that uses CloudFormation and another team that uses Terraform, then do not just focus on your CloudFormation scripts.
Define the pre-conditions for your CloudFormation scripts. - What are the AWS…
Having started on functional programming from JavaScript, after transforming and filtering elements in a list/iterator, the approach that I tried to extract the final filtered value out of the iterator was to try reduce operations. Instead, what I needed was the headOption method.
A simple example of transforming a list and extracting one value out, and additionally being able to specify a default value if nothing is left after the filtering exercise.