DEV Community

Abhishek Anand Amralkar
Abhishek Anand Amralkar

Posted on

1 1

Collection Functions

concat

concat functions take 2 lists as a input and returns a new list

``

## element

`element` function in TF is selects single element from a list. 


hcl
element(concat(aws_vpc.generic.*.id, [""]), 0)




In above code, we have used `concat` and `element` both with using `element` we are just selecting the value at the 0th index in the list.

## flatten

`flatten` function in 

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay