Skip to content

Instantly share code, notes, and snippets.

@r7kamura
Created August 13, 2015 17:11
Show Gist options
  • Save r7kamura/2a42ea3ad37d703a8597 to your computer and use it in GitHub Desktop.
Save r7kamura/2a42ea3ad37d703a8597 to your computer and use it in GitHub Desktop.
{
"json": $input.json('$.*'),
"accountId": "$context.identity.accountId",
"allParams": "$input.params()",
"apiId": "$context.apiId",
"apiKey": "$context.identity.apiKey",
"caller": "$context.identity.caller",
"headerParams": "$input.params().header",
"httpMethod": "$context.httpMethod",
"pathParams": "$input.params().path",
"queryParams": "$input.params().querystring",
"requestId": "$context.requestId",
"resourceId": "$context.resourceId",
"resourcePath": "$context.resourcePath",
"sourceIp": "$context.identity.sourceIp",
"stage": "$context.stage",
"user": "$context.identity.user",
"userAgent": "$context.identity.userAgent",
"userArn": "$context.identity.userArn"
}
@r7kamura
Copy link
Author

勝った感じがある

{
  "json": $input.json('$.*'),
  "accountId": "$context.identity.accountId",
  "allParams": "$input.params()",
  "apiId": "$context.apiId",
  "apiKey": "$context.identity.apiKey",
  "caller": "$context.identity.caller",
  "headerParams": {
#foreach( $key in $input.params().header.keySet() )
    "$key": "$input.params().header.get($key)"#if( $foreach.hasNext ),#end
#end
  },
  "httpMethod": "$context.httpMethod",
  "pathParams": "$input.params().path",
  "queryParams": "$input.params().querystring",
  "requestId": "$context.requestId",
  "resourceId": "$context.resourceId",
  "resourcePath": "$context.resourcePath",
  "sourceIp": "$context.identity.sourceIp",
  "stage": "$context.stage",
  "user": "$context.identity.user",
  "userAgent": "$context.identity.userAgent",
  "userArn": "$context.identity.userArn"
}

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