python-lambda
python-lambda copied to clipboard
Provide option for multiple environments
I would like to deploy lambda function in multiple environments, like development, staging, and production.
Is there is a way to setup config.yaml for different working environments?
Proposed solution: Make the yaml file from which the configuration is read an optional command line parameter. If lambda is called with -c production.yaml it will use that file instead of config.yaml. I'd find this feature useful too.
Alternatively add a --profile parameter like the one supported by the aws CLI utility that controls which AWS credentials to read from ~/.aws/credentials (and, by extension, which AWS account to connect to). Additional profile-specific settings could be configured under a profiles dict in the config file, e.g., profiles.prod.subnet_ids, etc. This would be more consistent with existing aws workflows.
I've added a --profile option in https://github.com/nficano/python-lambda/pull/93 that you can use to switch between different environments, assuming you have configured those in your .aws/{config,credentials} files.