You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The (DynamoDB Operation)[https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Operations.html] is automatically mapped by the `method` with following HTTP specification if you omit the `action`.
306
-
307
-
| Method | Mapped action | Note |
308
-
----|----|----
309
-
| post | PutItem | hashkey is set apigateway requestid automatically by default |
310
-
| put | PutItem | hashkey is set `pathParam` or `queryStringParam` |
311
-
| patch | UpdateItem ||
312
-
| get | GetItem ||
313
-
| delete | DeleteItem ||
314
-
315
-
Sample syntax for DynamoDB proxy in `serverless.yml`.
312
+
Sample syntax for DynamoDB proxy in `serverless.yml`. Currently, the supported (DynamoDB Operations)[https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Operations.html] are `PutItem`, `GetItem` and `DeleteItem`.
316
313
317
314
```yaml
318
315
custom:
319
316
apiGatewayServiceProxies:
320
-
- dynamodb:
321
-
path: /dynamodb
322
-
method: post
323
-
tableName: { Ref: 'YourTable' }
324
-
hashKey: 'id' # You must define hashKey attribute with `post` method
325
-
cors: true
326
-
- dynamodb:
327
-
path: /dynamodb/{id}
328
-
method: put
329
-
tableName: { Ref: 'YourTable' }
330
-
hashKey:
331
-
pathParam: id
332
-
attributeType: S
333
-
action: PutItem # optional
334
-
cors: true
335
317
- dynamodb:
336
318
path: /dynamodb/{id}/{sort}
337
-
method: patch
319
+
method: put
338
320
tableName: { Ref: 'YourTable' }
339
-
hashKey:
321
+
hashKey: # set pathParam or queryStringParam as a partitionkey.
340
322
pathParam: id
341
323
attributeType: S
342
-
rangeKey:
324
+
rangeKey: # required if also using sort key. set pathParam or queryStringParam.
343
325
pathParam: sort
344
326
attributeType: S
345
-
action: UpdateItem
327
+
action: PutItem # specify actions to the table what you want
328
+
condition: attribute_not_exists(Id) # optional Condition Expressions parameter for the table
0 commit comments