python-lambda icon indicating copy to clipboard operation
python-lambda copied to clipboard

Provide option for multiple environments

Open prasannaboga opened this issue 8 years ago • 3 comments

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?

prasannaboga avatar Sep 04 '17 11:09 prasannaboga

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.

kilna-magento avatar Sep 07 '17 14:09 kilna-magento

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.

jmehnle avatar Jan 26 '18 22:01 jmehnle

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.

jmehnle avatar Feb 02 '18 20:02 jmehnle