arabold / serverless-export-env

Serverless plugin to export environment variables into a .env file
MIT License
102 stars 34 forks source link

Support for serverless v3 #51

Open pokryfka opened 1 year ago

pokryfka commented 1 year ago

Has the plugin been tested with serverless v3?

I just updated to serverless v3 and noticed a few issues:

1.

environment values at function level are not exported, for example:

provider:
  environment:
    TEST1 = 1 # exported

functions:
  testFunc:
    environment:
       TEST2 = 2 # NOT exported
  1. Outputs are not exported, for example:
  - Outputs:
      AwsRegion:
        Value: ${self:custom.region} # NOT exported
  1. Resolving of some properties does not work anymore, in my case:

stopped working, which is reported as:

Fn::GetAttResolvers not found in params file: RedisReplicationGroup.PrimaryEndPoint.Address
Fn::GetAttResolvers not found in params file: devGraphQlApi.GraphQLUrl
pelssersconsultancy commented 1 year ago

I am experiencing the same issue

rennehir commented 8 months ago

Anyone managed to get this plugin working on v3? Or does someone have any other solutions similar to this?

I have multiple stacks, some of which export some values used in other stacks. Namely I have stacks for db and auth related things which export values and references to be used with the api stack. And I use serverless-offline to run the api stack locally. This plugin did the job in another project before upgrading to Serverless v3.

zirkelc commented 8 months ago

I created an alternative plugin that works for me: https://github.com/zirkelc/serverless-exports-plugin

It exports the global environment variables and resource outputs during sls info and sls deploy. It's not feature complete with this plugin, mainly because I didn't require all of it.

rennehir commented 8 months ago

I actually managed to fix my issues by using ${cf:StackName.ExportName}