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

Support multiple applications in copilot .workspace

Open AndrchiamusI opened this issue 3 years ago • 5 comments

This is a feature request to support multiple copilot applications in a workspace.

We operate a monorepo and are therefore forced to split up our repository in order to create new load balanced applications.

The --app flag is already standard throughout the CLI.

AndrchiamusI avatar Jun 16 '22 12:06 AndrchiamusI

Hello @Andrchiamus ! 👋🏼

Thank you very much for the feature request. We'd love to learn more about your use case. Would you mind giving us a rough description of how you set up your monorepo, for example, the structure of the repo?

in order to create new load balanced applications. You may have some requirements that I'm not aware yet, but normally, if you want to create multiple load-balanced web services, you could add them into the same app. That is, this should work:

copilot svc init --app my-app --type "Load-Balanced Web Service" --name serviceA
copilot svc init --app my-app --type "Load-Balanced Web Service" --name serviceB

Lou1415926 avatar Jun 17 '22 21:06 Lou1415926

Certainly, we have a monorepo which has jobs, backend and load balanced services using pnpm.

.git
package.json
copilot
services/serviceA
services/serviceB
applications/appA
jobs/jobby

AndrchiamusI avatar Jun 24 '22 08:06 AndrchiamusI

Thanks - just to clarify, does services/ contain your backend services and applications/ contains your load balanced services?

Also, I'm curious if creating multiple Load Balanced Web Services in a single copilot app would work for your use case? If not, what functionality are you looking for in having multiple apps instead?

dannyrandall avatar Jun 24 '22 18:06 dannyrandall

Thanks for the reply.

\services contains both backend services and load balanced public APIs that leverage the path based routing.

\Applications contains front end applications which typically written in React. When we are quickly prototyping we appreciate being able to deploying to a new load balancer so that we can put it at root path.

App runner is an obvious alternative but it is still pre-mature in my opinion as it does not yet integrate with Secrets Manager or Param Store nor is it in London. I am watching the space though and I am pleased that it can communicate between VPCs now.

AndrchiamusI avatar Jul 01 '22 07:07 AndrchiamusI

Hi @Andrchiamus !

If I'm understanding correctly, it sounds like you'd want separate load balancers for the applications/ folder and another load balancer of the services under services/ is that correct?

I wonder if hostname based routing would be possible in this situation if there is a domain associated with the application?

For example,

  • https://example.com -> applications/appA
  • https://api.example.com -> services/serviceA
  • https://login.example.com -> services/serviceB

efekarakus avatar Jul 01 '22 19:07 efekarakus

Yes, please support multiple apps and redo the directory structure because it's misleading. It would be perfect to have copilot/apps/app-1/services/service-1, copilot/apps/app-1/environments/dev.

Also I want to be able to use copilot either at the root of my monorepo, either inside each of my monorepo's apps, meaning .manifest should support an array of applications

pax-k avatar May 18 '23 17:05 pax-k