Created
April 10, 2022 22:23
-
-
Save louislatreille/86c375ae2758706b0cc56533b3408627 to your computer and use it in GitHub Desktop.
Serverless Streamlined - postMessage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createFunctionHandler } from "@resources/createFunctionHandler"; | |
import { AwsCfInstruction } from "@serverless/typescript"; | |
export const postMessage = (mainTableArn: AwsCfInstruction, mainTableName: AwsCfInstruction) => | |
createFunctionHandler( | |
"postMessage", | |
"/messages", | |
"POST", | |
undefined, | |
[ | |
{ | |
Action: ["dynamodb:UpdateItem"], | |
Resource: [mainTableArn], | |
Effect: "Allow", | |
}, | |
], | |
{ | |
MAIN_TABLE_NAME: mainTableName, | |
}, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment