#1317·Zappa

Error - {"message":"Forbidden"}

Author: daxeelCreated Dec 26, 2017Updated Jun 14, 2024
Labelsquestiondocumentation

I deployed my flask hello world with zappa on aws.

server.py

python
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, Ieacon!'

if __name__ == '__main__':
    app.run()

API Endpoint https://hj9weg9e9g.execute-api.ap-south-1.amazonaws.com/devstage

Expected Behavior

Hello, Ieacon! (Works locally)

Actual Behavior

{"message":"Forbidden"}

Possible Fix

Your Environment

  • Zappa version used: 0.45.1

  • Operating System and Python version: OSX & Python 2.7.10

  • The output of pip freeze: argcomplete==1.9.2 base58==0.2.4 boto3==1.5.6 botocore==1.8.20 certifi==2017.11.5 cfn-flip==1.0.0 chardet==3.0.4 click==6.7 docutils==0.14 durationpy==0.5 Flask==0.12.2 future==0.16.0 futures==3.1.1 hjson==3.0.1 idna==2.6 itsdangerous==0.24 Jinja2==2.10 jmespath==0.9.3 kappa==0.6.0 lambda-packages==0.19.0 MarkupSafe==1.0 placebo==0.8.1 python-dateutil==2.6.1 python-slugify==1.2.4 PyYAML==3.12 requests==2.18.4 s3transfer==0.1.12 six==1.11.0 toml==0.9.4 tqdm==4.19.1 troposphere==2.1.2 Unidecode==0.4.21 urllib3==1.22 Werkzeug==0.12 wheel==0.30.0 wsgi-request-logger==0.4.6 zappa==0.45.1

  • Link to your project (optional): https://hj9weg9e9g.execute-api.ap-south-1.amazonaws.com/devstage

  • Your zappa_settings.py: { "devstage": { "api_key_required": true, "api_key": "xxxxxx", "s3_bucket": "ieaconbucket", "app_function": "server.app", "aws_region": "ap-south-1" } }

Please help me why i am not able to get the expected output. This is my second project. Previously i was able to deploy the app and was working perfectly. I don't know why it stopped working.

[Edit markdown for code listing –@scoates]