Skip to content

Instantly share code, notes, and snippets.

@postkin
Created February 11, 2020 04:08
Show Gist options
  • Save postkin/48df44b4edd1cbaf2a2eca4a0bcecf75 to your computer and use it in GitHub Desktop.
Save postkin/48df44b4edd1cbaf2a2eca4a0bcecf75 to your computer and use it in GitHub Desktop.
aws-api-gateway-dynamodb
{
"x-amazon-apigateway-integration": {
"uri": "arn:aws:apigateway:us-east-1:dynamodb:action/Scan",
"responses": {
"default": {
"statusCode": "200",
"responseTemplates": {
"application/json": "#set($inputRoot = $input.path('$'))\n[\n #foreach($elem in $inputRoot.Items) {\n \"id\": \"$elem.id.S\",\n \"given_name\": \"$elem.given_name.S\",\n \"description\": \"$elem.description.S\",\n \"website_url\": \"$elem.website_url.S\"\n }#if($foreach.hasNext),#end\n#end\n]"
}
}
},
"passthroughBehavior": "when_no_templates",
"httpMethod": "POST",
"type": "aws",
"credentials": "arn:aws:iam::879370021840:role/aws-api-gateway-lambda-2",
"requestTemplates": {
"application/json": "{\n \"TableName\": \"planets\",\n \"ReturnConsumedCapacity\": \"TOTAL\"\n}"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment