want to create a folder structure in S3 with Terraform so that it defaults to all environments. The idea is to have structures similar to these:
locals {
folder = [
{
provider = "provider-1",
process = "batch-process",
final = ["people","cart"]
},
{
provider = "provider-1",
process = "online-process",
final = ["log","order"]
}]}
Bucket-1
- provider-1
- batch-process
- people
- cart
- online-process
- log
- order
- batch-process
I managed to create a list with all the S3 directories I would like to have, but I know this is not the most efficient way.
I tried to follow some examples found here but they returned an error. What is the correct way to do this iteration without having to write the entire directory?