User Tools

Site Tools


cloud:aws:apigateway

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cloud:aws:apigateway [2021/04/30 18:48] skipidarcloud:aws:apigateway [2023/11/01 07:13] (current) – ↷ Page moved from business_process_management:camunda:cloud:aws:apigateway to cloud:aws:apigateway skipidar
Line 154: Line 154:
  
  
-=== Return structure ===+=== Return format of Lambda ===
  
 Lambdas needs to return JSON, to be capable to be used from the gateway. Lambdas needs to return JSON, to be capable to be used from the gateway.
 +https://docs.amazonaws.cn/en_us/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-output-format
  
 <sxh java> <sxh java>
Line 178: Line 179:
  
 ====  Use Lambda Proxy integration ====  ====  Use Lambda Proxy integration ==== 
-https://docs.amazonaws.cn/en_us/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html 
  
 +When a client submits an API request, API Gateway passes to the integrated Lambda function the raw request as-is:
  
-The option <code>Use Lambda Proxy integration</code> + 
-  * activates or deactivates the **"Mapping Templates"**+That means, that the option `Use Lambda Proxy integration` 
 +  * **deactivates** the **"Mapping Templates"**
   * https://aws.amazon.com/premiumsupport/knowledge-center/custom-headers-api-gateway-lambda/   * https://aws.amazon.com/premiumsupport/knowledge-center/custom-headers-api-gateway-lambda/
  
Line 189: Line 191:
  
  
 +This is the most powerful integration:
 +  - **\{{proxy}}** sends all resources - to the Lambda
 +  - **ANY** - accepts all methods
 +
 +https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html#api-gateway-proxy-resource%3Ficmpid=docs_apigateway_console
 +
 +{{https://s3.eu-central-1.amazonaws.com/alf-digital-wiki-pics/sharex/M51LDfQis7.png}}
 +
 +  * <color #ed1c24>Still the API must be deployed to a "stage"</color>
 +  * <color #ed1c24>Minimum one resource must be present after the stage - or you will get "{"message":"Missing Authentication Token"}"</color>
 +
 +After that the lambda reacts on
 +<code>
 +curl -X POST https://s5oi8r61hk.execute-api.eu-west-1.amazonaws.com/stage/someresourcehere/1/2/bla/blub/enigma21/
 +curl -X GET https://s5oi8r61hk.execute-api.eu-west-1.amazonaws.com/stage/2/
 +</code>
  
 ==== Mapping Templates ==== ==== Mapping Templates ====
Line 198: Line 216:
  
 https://aws.amazon.com/premiumsupport/knowledge-center/custom-headers-api-gateway-lambda/ https://aws.amazon.com/premiumsupport/knowledge-center/custom-headers-api-gateway-lambda/
 +
 +
 +
 +
 +==== Token Exchange =====
 +The token exchange is possible with 2 pieces:
 +
 +  * obtain a new token at the lambda authorizer
 +  * set the header via VLT as in 
 +
 +https://stackoverflow.com/questions/40585016/is-it-possible-to-add-an-http-header-from-aws-custom-auth-on-api-gateway
 +
 +
 +
 +===== A Detailed Overview of AWS API Gateway =====
 +An overview of the API gateway functions.
 +https://www.alexdebrie.com/posts/api-gateway-elements/
 +
 +{{https://s3.eu-central-1.amazonaws.com/alf-digital-wiki-pics/sharex/44ovAxhCbW.png}}
 +
 +{{https://s3.eu-central-1.amazonaws.com/alf-digital-wiki-pics/sharex/QuF6kGfybF.png}}
  
  
cloud/aws/apigateway.1619808534.txt.gz · Last modified: by skipidar