1

When I set CDK as following , and deploy them. the two content was generated in api gateway.

    new LambdaRestApi(this,"api",{
      handler:lambdaFunction
    });

I totally beginner this kind of API manipulation and have questions.

① what is {proxy+} ?

② what is the difference between following two API ?

③ How can I see payload which will be passed to lambda function ?

If someone has opinion or materials please let me know.

Thanks

api gateway

0

1 Answer 1

2

The purpose of the proxy+ is to enable the following URLs to work with your function:

https://44444.execute-api.gggg.amazonaws.com/test-invoke-stage/some/path1/path3
https://44444.execute-api.gggg.amazonaws.com/test-invoke-stage
https://44444.execute-api.gggg.amazonaws.com/test-invoke-stage/test/gggg
https://44444.execute-api.gggg.amazonaws.com/test-invoke-stage/test/5

without proxy+ only the following will work:

https://44444.execute-api.gggg.amazonaws.com/test-invoke-stage

So the proxy+ is able to accept everything past /test-invoke-stage as it matches every path starting with /test-invoke-stage.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for comment. I wonder why the two component were generated. it looks like only {proxy+} is needed ! thanks.
@Heisenberg I'm not sure how CDK does this under the hood.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.