Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

Custom domain name not working

Open ibachar-es opened this issue 1 year ago • 0 comments

Context

I'm trying to setup a custom domain name for my Zappa application while also removing the stage name from the URL. I'm using Flask and have added a /ping endpoint which should return "pong". The stage name is called dev. Using the Invoke URL of the api gateway works as expected (https://xxxxx.execute-api.eu-central-1.amazonaws.com/dev/ping returns "pong") I've followed the manual and verified my domain using ACM (I'm using CloudFlare). When going to the AWS console and trying to invoke the "API Gateway domain name" created by Zappa it doesn't work

Expected Behavior

I expect xxxx.cloudfront.net/ping to return "pong" and thus properly invoking my endpoint defined in the Flask application

Actual Behavior

  • When going to xxxxx.cloudfront.net/ping I get back "healthy" which I think is a route created automatically by Zappa
  • When going to xxxx.cloudfront.net/dev/ping I get 403 {"message":"Forbidden"}

Your Environment

  • Zappa version used: 0.57.0
  • Operating System and Python version: Windows 11, Python 3.10.11
  • The output of pip freeze:
argcomplete==3.1.2
astroid==2.15.8
black==23.7.0
blinker==1.6.3
boto3==1.28.44
botocore==1.31.70
certifi==2023.7.22
cfn-flip==1.3.0
charset-normalizer==3.3.1
click==8.1.7
colorama==0.4.6
dill==0.3.7
durationpy==0.5
Flask==2.3.3
hjson==3.1.0
idna==3.4
isort==5.12.0
itsdangerous==2.1.2
Jinja2==3.1.2
jmespath==1.0.1
kappa==0.6.0
lazy-object-proxy==1.9.0
MarkupSafe==2.1.3
mccabe==0.7.0
mypy-extensions==1.0.0
packaging==23.2
pathspec==0.11.2
placebo==0.9.0
platformdirs==3.11.0
pylint==2.16.0
python-dateutil==2.8.2
python-slugify==8.0.1
PyYAML==6.0.1
requests==2.31.0
s3transfer==0.6.2
six==1.16.0
text-unidecode==1.3
toml==0.10.2
tomli==2.0.1
tomlkit==0.12.1
tqdm==4.66.1
troposphere==4.5.0
typing_extensions==4.8.0
urllib3==1.26.18
Werkzeug==3.0.1
wrapt==1.15.0
zappa==0.57.0
  • Your zappa_settings.json:
{
  "dev": {
    "app_function": "app.app",
    "aws_region": "eu-central-1",
    "profile_name": "eks-dev-admin",
    "project_name": "xxx-dev",
    "runtime": "python3.10",
    "s3_bucket": "zappa-xxx-dev",
    "certificate_arn": "arn:aws:acm:us-east-1:xxxx:certificate/xxxx",
    "domain": "xxxx",
    "route53_enabled": false
  },
  "prod": {
    "extends": "dev",
    "profile_name": "eks-prod-admin",
    "project_name": "xxxx",
    "s3_bucket": "xxx"
  }
}

ibachar-es avatar Nov 05 '23 13:11 ibachar-es