Events path are different for environments

I need find a way to deal with this request, which need your suggestion.

I worked with http paths to lambda functions in serverless.yml, now I need deploy it to production.

I realised, the paths are different with development environment.

In development environment,

  - http:
      path:  path-1 
  - http:
      path:  path-2 
  - http:
      path:  path-3

But in production environment, it only requires path-1 and path-2. How to deal with the differences between the environments.

There is no for loop I can define the paths on fly.

I understand I can define different serverless.yml for each environment, but are there any better way to deal with it?

Hope I explain the problem clearly.

1 Like