Multiple files as environment variables

I have two JSON files containing some values that I’d like to set as environment variables.

The current syntax according to the documentation allows only one reference to a file:

functions:
  great_function:
    handler: main
    events:
      - http: path
    environment: ${file(credentials/config.json)}

What I’d like to do is to reference multiple files as environment variables:

environment:
  - ${file(credentials/config.json)}
  - ${file(credentials/keys.json)}

When I tried this got a a type error, so my current solution is to set one file at the function level and the other at the provider level, which is working but I don’t think it’s a great solution.

Is it possible to reference both files at the function level?

2 Likes

I also with this problem, any solution to import two files in provider.environment ?