-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment Variables #79
Comments
What we do more or less is: custom:
stage: ${opt.stage, self:provider.stage}
config: ${file(./env/${opt:config, self:custom.stage}.yml)} This mens that you can We use profiles to manage account access, and the profile is done via some interpolation/lookup in the config. |
@dougmoscrop by account access do you mean AWS Key and Secret? Otherwise how do you change that? |
This is a plugin registry repository, where exchange should rather be limited to the state of this registry, and not to discuss ideas for plugins. I propose to discuss plugin ideas at https://github.com/serverless/serverless/discussions |
Hi there,
I'm thinking on developing a plugin which allows me to switch environments easily
The challenges:
I am developing multiple APIs which have different stages (dev, staging / testing, and production)
This stages might be deployed in different accounts, dev is for example my own Amazon account, but testing and production might rely on the client.
Serverless / AWS Cli stores the configuration on the ~/.aws/credentials and as far as I know it must be changed manually everytime you target a different account
Finally those environments might also need other custom parameters such as Database configurations
The possible solution:
Note: I already created a little NodeJS script which allows me to switch AWS config based on parameter.
a. Develop a plugin wich allows me to switch accounts based on configuration files.
b. Files would allow to give those configurations to certain users, for example a junior developer would only have dev and testing and only senior developers would have the prod environment files
c. All environments files would be placed on a specific folder, for example .slsenv
d. The command could be:
sls deploy --environment dev --alias aliasName
e. Environment file could also store DB variables
f. Finally some environments could require some extra confirmation
Are you sure you want to deploy on prod?
What do you think people?
Am I reinventing the wheel? Is this something I could already do in the main yml?
Thanks!
The text was updated successfully, but these errors were encountered: