Giter Club home page Giter Club logo

Comments (3)

SimonHoiberg avatar SimonHoiberg commented on July 27, 2024

+1 on this one.
I would love to be able to do something like this:

dotenv:
    path: 'deployment/${self:provider.stage}/.env'

from serverless-dotenv-plugin.

neverendingqs avatar neverendingqs commented on July 27, 2024

I think you might find more mileage with the built-in dotenv support? Unfortunately, it does not allow for custom paths - the dotenv file must live in the root directory of the project.

As noted in #38 (comment),

Variable references in the serverless instance are not resolved before a Plugin's constructor is called, so if you need these, make sure to wait to access those from your hooks.
~https://www.serverless.com/framework/docs/providers/aws/guide/plugins/#plugins/

. We do everything in the constructor today to try to be the first thing that happens when Serverless does its thing. However, that means. Serverless hasn't interpolated the values for us at that time.

There might be a way to trigger interpolation, but it might be via a non-public API, which isn't a great option.

Unfortunately, I do not have a workaround at time. Open to ideas!

from serverless-dotenv-plugin.

neverendingqs avatar neverendingqs commented on July 27, 2024

I thought about this more, and I think there are sufficient alternatives that I am comfortable closing this with wontfix. I added some workarounds in #106.

Please feel free to reopen if you have additional feedback. Thanks!

from serverless-dotenv-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.