Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. `
  2. ## See http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html
  3. ## This template will pass through all parameters including path, querystring, header, stage variables, and context through to the integration endpoint via the body/payload
  4. #set($allParams = $input.params())
  5. {
  6. "body-json" : $input.json('$'),
  7. "params" : {
  8. #foreach($type in $allParams.keySet())
  9. #set($params = $allParams.get($type))
  10. "$type" : {
  11. #foreach($paramName in $params.keySet())
  12. "$paramName" : "$util.escapeJavaScript($params.get($paramName))"
  13. #if($foreach.hasNext),#end
  14. #end
  15. }
  16. #if($foreach.hasNext),#end
  17. #end
  18. },
  19. "stage-variables" : {
  20. #foreach($key in $stageVariables.keySet())
  21. "$key" : "$util.escapeJavaScript($stageVariables.get($key))"
  22. #if($foreach.hasNext),#end
  23. #end
  24. },
  25. "context" : {
  26. "account-id" : "$context.identity.accountId",
  27. "api-id" : "$context.apiId",
  28. "api-key" : "$context.identity.apiKey",
  29. "authorizer-principal-id" : "$context.authorizer.principalId",
  30. "caller" : "$context.identity.caller",
  31. "cognito-authentication-provider" : "$context.identity.cognitoAuthenticationProvider",
  32. "cognito-authentication-type" : "$context.identity.cognitoAuthenticationType",
  33. "cognito-identity-id" : "$context.identity.cognitoIdentityId",
  34. "cognito-identity-pool-id" : "$context.identity.cognitoIdentityPoolId",
  35. "http-method" : "$context.httpMethod",
  36. "stage" : "$context.stage",
  37. "source-ip" : "$context.identity.sourceIp",
  38. "user" : "$context.identity.user",
  39. "user-agent" : "$context.identity.userAgent",
  40. "user-arn" : "$context.identity.userArn",
  41. "request-id" : "$context.requestId",
  42. "resource-id" : "$context.resourceId",
  43. "resource-path" : "$context.resourcePath"
  44. }
  45. }
  46. `
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement