How to get only the file path without the file name in terraform?

You can use terraform dirname() to get only the file path without the file name. dirname() takes a string containing a filesystem path and removes the file name and returns only the directory name.

Syntax: dirname(file_path)

Example:

Leave a Reply

Close Menu