0

I have a project with serverless framework compose following this architecture

/services
    --- infra
    --- service-a
    --- service-b

The 'infra' service create and share two api-gateway (a private and public one), but in each service a can use only one. In each service a have a public lambda for creating an object (public api) and a lambda to approuve the object by an admin (private api).

I need this specific pattern cause it's a medical project. How I can do select an api gateway for each lambda ?

  • possibly create multiple serverless.yaml files and use sls deploy --config infra-service.yml, sls deploy --config service-a-service.yml commands to deploy. You may have some code repetition but lambdas and most of the config code can be shared. – suman j Nov 03 '22 at 21:16

1 Answers1

1

there's no "good" way to do it if you need to have two different APIGWs in the same Serverless service. The best approach would be to separate it into more services, e.g. service-a-public, service-a-private, and so on.

If you really need to use a single service that uses two separate APIGWs, then you need to write the integration as raw CloudFormation.

pgrzesik
  • 1,869
  • 13
  • 14