Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Gateway only has ProxyEndpoint #1423

Closed
kyeljmd opened this issue Feb 27, 2018 · 5 comments
Closed

API Gateway only has ProxyEndpoint #1423

kyeljmd opened this issue Feb 27, 2018 · 5 comments

Comments

@kyeljmd
Copy link

kyeljmd commented Feb 27, 2018

I'm fiddling with zappa, and I have followed through with the basic installation, and deployment.

The issue that I am having is although I have defined paths on my my_app.app, Zappa generates a proxy handler. Not /test, /hello/user

`from flask import Flask

from messages import person

app = Flask(name)

@app.route("/")
def hello():
p = person.Person()
return p.get_message()

@app.route("/test")
def test():
return "test"

@app.route("/hello/user")
def test_1():
return "hello, jomar"

if name == 'main':
app.run()
`

Upon deploying the app. the api gateway has this result.

https://imgur.com/a/Gvt9Y
I was expecting that /test, and /hello/user will be automatically defined in the API gateway

[Edit URL –@scoates]

@scoates
Copy link
Collaborator

scoates commented Feb 27, 2018

Zappa uses the proxy+ integration so that it can forward all requests to the lambda function that it uses to harness your app.

If it tried to do individual routes, the API gateway integration would need to change every time routes change, and Zappa would also need to know how to figure out an exhaustive list of all routes defined in the app.

Is there a specific problem you're trying to solve, here, or was it just unexpected?

@Miserlou
Copy link
Owner

Since your application can have dynamic routes, that wouldn't be very good.

In fact, before proxy+ existed, that's how Zappa worked - we literally enumerated 9-deep paths. Deploying took forever. Proxy+ was pretty much implemented by Amazon for us.

@masayang
Copy link

masayang commented May 9, 2019

When "iam_authorization" is set to true, API Gateway expects headers with V4 signature, however, according to this thread, aws-amplify/amplify-js#3168 , API signing doesn't work with proxy. Is there any workaround for this issue?

@chmelevskij
Copy link

@masayang iam signing does work with proxy integration of api gateway. What it doesn't work is using proxy in front of api gw.

Amplify actually uses the same approach, it uses proxy events on api gateway and signs the requests.

@gigi-at-zymergen
Copy link

We are using our own internal API Gateway using Gloo. It can discover our Lambdas, but we're having trouble invoking our Zappa Lambdas through it, though they work fine with AWS API Gateway and proxy+ ANY.

Gloo uses the Go AWS SDK to invoke, and I'm wondering if there is any documentation on what Zappa Lambdas expect in the InvokeInput ClientContext string ( https://docs.aws.amazon.com/sdk-for-go/api/service/lambda/#InvokeInput ) ?

Assuming the AWS API Gateway proxy+ invocation has some secret sauce in terms of the app.route that gets triggered, by passing in the request route in some way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants