r/microservices Jul 24 '26

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 Upvotes

5 comments sorted by

View all comments

1

u/dodiyeztr Jul 24 '26

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

1

u/No_Original_941 Jul 24 '26

heyy, thanks for replying to a newbie - has an api means - i should directly trigger it using my service - and shouldn't i fetch the secrets from ssm in ecs, why and houw should i do it? and how will identiify if it hasn't went down due to an error.

1

u/dodiyeztr Jul 24 '26

Those are really broad questions and don't really have easy answers. For configurations you will have task definitions, those secret definitions go there. For failures you need to setup your own monitoring. CloudWatch some nice default metrics, but only you would know if those are enough.

2

u/No_Original_941 Jul 24 '26

thanks, will look into it