Trying to use for_each to replicate multiple resources and contents within block

I have a question. So I am creating aws_batch_job_definition resources and I am trying to reduce the amount of unnecessary code that I have. I have about 3 blocks that use the same container_properties and I’m trying to understand how I can use a for_each to replicate all 3 as opposed to creating them manually? Any ideas? You can find the code below: