Issue
I am new to AWS, and was wondering if I could leverage the services provided by AWS to spin up container on the fly. My current situation is- I have some dynamic(changing) environment variables that is required to run the container. The number of containers is also unknown to me, so I am confused about ECS definitions too. The number of containers may be 0 or be 100, and each of the container has different env. Also, is it possible to delete the container after use.
I looked into AWS ESC and fargate and honestly I am overwhelmed by all the new stuff
Solution
You can create a single ECS Task Definition for your containers, and then spin up an arbitrary number of containers (tasks) from that Task Definition via the ECS Run Task API, with different environment variables using the Container Override feature.
Answered By - Mark B Answer Checked By - Robin (WPSolving Admin)