Zappa: Issue while running lambda function

464 views Asked by At

I have a sample flask application and recently with the help of zappa i tryed deploying exiting flask application on lambda.

Basically, I performed these stuff

pip install zappa
provided zappa_settings.json file as a input
zappa package dev -o myproject.zip

zappa_setting.json file

{
    "dev": {
        "slim_handler": true,
        "app_function": "myproject.main.app",
        "aws_region": "us-east-1",
        "project_name": "myproject",
        "runtime": "python3.8",
        "s3_bucket": "mybucket-dev"
    },
    "stage": {
        "slim_handler": true,
        "app_function": "myproject.main.app",
        "aws_region": "us-east-1",
        "project_name": "myproject",
        "runtime": "python3.8",
        "s3_bucket": "mybucket-stage"
    },
    "master": {
        "slim_handler": true,
        "app_function": "myproject.main.app",
        "aws_region": "us-east-1",
        "project_name": "myproject",
        "runtime": "python3.8",
        "s3_bucket": "mybucket"
    }
}

when i run the zappa package dev -o myproject.zip, it is creating a myproject.zip file and i placed that zip file in s3 bucket mybucket-dev. then i provided this zip file as an input to lambda.

when i try to run lambda function i am experiencing an issue

Error

botocore.errorfactory.NoSuchKey: An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.

i gone through the logs and found that,

Calling s3:get_object with {'Bucket': 'mybucket-dev', 'Key': 'dev_mybucket_current_project.tar.gz'}

my zip file name is mybucket.zip and logs are showing this dev_mybucket_current_project.tar.gz.

from where this compressed file is coming?

can anyone suggest a solution for this?

0

There are 0 answers