I have a flask_application which will do some simple task.
My Requirement: I want to deploy this flask_application as a aws lambda_function with the help of zappa
To run my flask_application as a lambda function, i am performing
- zappa init
- zappa package
and then i am uploading that zipped file into lambda and running my lambda function.
My Issue:
when ever i run zappa init command, it is creating a zappa_setting.json file with some info like below
{
"dev": {
"app_function": "flask.main.app",
"aws_region": "us-east-1",
"profile_name": "dev",
"project_name": "flask",
"runtime": "python3.6",
"s3_bucket": "zappa-p5m0kuurp"
}
}
I have 3 aws environments and seperate buckets for each environment like
test ==> zappa_test_bucket
stage ==> zappa_stage_bucket
prod ==> zappa_prod_bucket
I want to deploy my flask application in all 3 aws environments by providing custom zappa_settings.json.
Question:
Is there a way to provide zappa_settings.json as a file and then whenever i run zappa init, zappa will take this file as a input and set these environmental varible according to environment.
zappa_settings.json
{
"test": {
"app_function": "flask.main.app",
"aws_region": "us-east-1",
"profile_name": "dev",
"project_name": "flask",
"runtime": "python3.6",
"s3_bucket": "zappa_test_bucket"
},
"stage": {
"app_function": "flask.main.app",
"aws_region": "us-east-1",
"profile_name": "dev",
"project_name": "flask",
"runtime": "python3.6",
"s3_bucket": "zappa_stage_bucket"
},
"prod": {
"app_function": "flask.main.app",
"aws_region": "us-east-1",
"profile_name": "dev",
"project_name": "flask",
"runtime": "python3.6",
"s3_bucket": "zappa_prod_bucket"
}
}
if anyone have an idea, please let me know