I have the following:
and in my env.yml I have the following:
As you can see it gets very repetitive duplicating variables into each stage. Is there a way I can have a second file for globals that I can merge with this file somehow? That way I can remove duplicates from each stage.
If you want the longer version I wrote it here
The better solution will be to use SSM parameters. It will help not only for yml file but also it will allow you to share variables between multiple serverless projects / lambda functions.
Following link might help you.
hey @buggy and @dhavalyours,
Thanks for your answers I am using following for my service level environment which will be shared across functions.
How can I add additional env variables which are not in my secrets manager or something I want to generate through serverless opts. example:
How to merge both so that I have secrets from secrets manager and additional variables provided in serverless.yml?
SECRET: "From Secrets Manager"
I tried merging yaml objects using tips provided in this post.