I have a directory locally with a set of files e.g.
/workload/test1.json
/workload/test2.json
/workload/test3.json
...
For each file in the directory I want to create a folder in Azure File Share, and then place each file inside.
e.g. azurefileshare/test1/test1.json azurefileshare/test2/test2.json azurefileshare/test3/test3.json
I dont know how to make it dynamic. I can create a directory using azurerm_storage_share_directory and then upload the file to the directory using azurerm_storage_share_file but i dont now how to make a dynamic iteration
Any examples / tips how to achieve this?
Here the terraform code that copies the files from the
local directoryto theAzure Filesharewith the correct structure.Terraform apply:
After running the terraform code, all files has been copied to
Azure File sharefromlocal directory.