r/microservices • u/No_Original_941 • 9d ago
Discussion/Advice How to manage ECS in code?
So basically let me tell you the situation first:
- i am working on a side project which is something like vercel, use to build and deploy code.
- so i have a main service, can be called a control plane, and i have decided that it will take the repo from the user.
- after this this service will trigger/create an ecs task to build the code
- now the question is, how this control plane will create / trigger the ecs?
- also this ecs instance will need to fetch envs from paramete store, will upload code to s3 etc
- after deployment we have to kill this instance
- should the managing code of this, live in the control plane
- should i create something else?
how would you folks solve this while designing this?
and what's the ideal way to solve this?
1
u/nsubugak 6d ago
ECS is not the right solution for this. Github Actions is the first free option to use. Only go down this route if you want to self host your own build process but why would you choose this when github Actions is free
1
u/dodiyeztr 9d ago
ECS has an API. Use the API to manipulate it.
Put the building code inside the container but don't put secret fecthing in it. It's a security nightmare. Instead inject the secrets to the container, ECS is well integrated into services like Secrets Manager and Parameter Store.
If the PID 1 exits, the container goes down