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

You can use terraform basename() function to get only the file name from the file path. basename() takes a string containing a filesystem path and removes all except the last portion from it.

Syntax: basename(file_path)

Example:

Leave a Reply

Close Menu