Unable to deploy flask app via Zappa. IAM roles created but nothing else happens

62 Views Asked by At

Python: Python 3.9

I'm attempting to deploy a flask application to AWS Lambda + API Gateway using Zappa. The app was originally deployed to AWS Lightsail, but I need more control over VPC and security group settings.

My init worked fine, so I have a Zappa settings file:

{
    "dev2": {
        "app_function": "app.app",
        "aws_region": "ap-southeast-2",
        "profile_name": "xxxx",
        "project_name": "product-assista",
        "runtime": "python3.9",
        "s3_bucket": "zappa-xxxx"
    }
}

The app is correctly detected as Flask etc. I then run a zappa deploy, and it starts fine, but only gets this far and seems to just hang. I have waited a good 30mins for anything to happen.

(.venv39) PS C:\Users\JMatson\source\repos\product_assistant> zappa deploy dev2
Calling deploy for stage dev2..
Creating product-assista-dev2-ZappaLambdaExecutionRole IAM Role..
Creating zappa-permissions policy on product-assista-dev2-ZappaLambdaExecutionRole IAM Role.
C:\Users\JMatson\source\repos\product_assistant\.venv39\lib\site-packages\_distutils_hack\__init__.py:33: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")

I've gone into AWS and can see the role and policy has been created fine, but nothing else has happened. The role hasn't been accessed post creation.

I've tried zappa tail dev2, but of course it fails because the CloudWatch log group hasn't been created yet. All the information on the Setuptools warning I can find suggests it's just informational, it shouldn't effect the deployment. Additionally, the IAM user attached to the profile I'm using is for all intents and purposes an Administrator, so should have all the access required.

0

There are 0 best solutions below