copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

different environment variable for a subset of the replicas in ECS

Open faisalil opened this issue 1 year ago • 3 comments

Hello,

one service I have on ECS is called "workers", currently, all those workers listen to the same queue of tasks that we have. I have 3 replicas. I want to do a change and make 2 of the machines listen to 1 queue and the other machine listen to a new queue.

What I need to to spin up 2 replicas with a different environment variables than the other machine. I want to avoid creating new service since there is just a lot of env variables and configs that I don't want to change.

faisalil avatar Apr 16 '24 02:04 faisalil

Hi @faisalil!

You can configure env vars in the manifest for each worker service: https://aws.github.io/copilot-cli/docs/manifest/worker-service/#variables

You can configure the subscriptions in the manifests: https://aws.github.io/copilot-cli/docs/manifest/worker-service/#subscribe

See more about worker services here: https://aws.github.io/copilot-cli/docs/concepts/services/#worker-service

Hope this helps!

huanjani avatar Apr 19 '24 17:04 huanjani

@huanjani : I am not using AWS queues, my question is simple: can I have a subset of the replicas in 1 service have different env variables than other ones?

faisalil avatar Apr 19 '24 19:04 faisalil

Related: https://github.com/aws/copilot-cli/issues/4122, https://github.com/aws/copilot-cli/issues/5525, https://github.com/aws/copilot-cli/issues/2699

huanjani avatar Apr 19 '24 22:04 huanjani