Ad
Creating Process.env Variables Using AWS Amplify?
With serverless we can add process.env
variables by creating a configuration file entry like this:
environment:
STRIPE_SECRET_KEY: ${self:custom.secrets.stripeSecretKey} # Stripe secret API key
And we can access it in our lambda function like this:
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
How do we do this with AWS Amplify?
Ad
Answer
You can add variables at your Amplify environment configuration. You can also add variable overrides and select a branch that's gonna use it.
DOCS: https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html
Ad
source: stackoverflow.com
Related Questions
- → Maximum call stack exceeded when instantiating class inside of a module
- → Browserify api: how to pass advanced option to script
- → Node.js Passing object from server.js to external modules?
- → gulp-rename makes copies, but does not replace
- → requiring RX.js in node.js
- → Remove an ObjectId from an array of objectId
- → Can not connect to Redis
- → React: How to publish page on server using React-starter-kit
- → Express - better pattern for passing data between middleware functions
- → Can't get plotly + node.js to stream data coming through POST requests
- → IsGenerator implementation
- → Async/Await not waiting
- → (Socket.io on nodejs) Updating div with mysql data stops without showing error
Ad