Skip to content

Instantly share code, notes, and snippets.

@awssimplified
Created December 19, 2020 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save awssimplified/02d7c43a3ed9222312746138181e1af9 to your computer and use it in GitHub Desktop.
Save awssimplified/02d7c43a3ed9222312746138181e1af9 to your computer and use it in GitHub Desktop.
api gateway service proxy
DynamoDb Put Item Documentation - https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html
API Gateway Policy
---
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "apigateway.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
DynamoDB - Simple
---
{
"TableName": "Customers",
"Item": {
"customerId": {
"S": "1"
},
"date": {
"S": "2020"
},
"name": {
"S": "John Doe"
}
}
}
DynamoDB - Mapping Template
{
"TableName": "Customers",
"Item": {
"customerId": {
"S": "$context.requestId"
},
"date": {
"S": "$input.path('$.date')"
},
"name": {
"S": "$input.path('$.name')"
}
}
}
Stripped Down REST Request
---
{
"date": "2020",
"name": "Jane Doe"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment