a2n-seattle / a2n-seattle/rms-app
Add GetReservation as AWS function
- 主要語言
- TypeScript
- 星號
- 1
- 分支
- 1
- 平均合併
- 27 分鐘
- 30 天內合併 PR
- 4
描述
Story Points: 1
# How?
1. in terminal, run `amplify add function`
2. Select which capability you want to add: Lambda function (serverless function)
3. Provide an AWS Lambda function name: GetReservation
4. Choose the runtime that you want to use: NodeJS
5. Choose the function template that you want to use: Hello World
6. Do you want to configure advanced settings? Yes
7. Do you want to access other resources in this project from your Lambda function? Yes
8. Select the categories you want this function to have access to. storage
9. Storage has 14 resources in this project. Select the one you would like your Lambda to access batch, history, items, main, schedule, tags
10. Select the operations you want to permit on batch create, read, update, delete
11. Select the operations you want to permit on history create, read, update, delete
12. Select the operations you want to permit on items create, read, update, delete
13. Select the operations you want to permit on main create, read, update, delete
14. Select the operations you want to permit on schedule create, read, update, delete
15. Select the operations you want to permit on tags create, read, update, delete
Navigate to `amplify/backend/function/GetReservation `
Delete `src/index.js`
In `GetItem-cloudformation-template.json`, change `resources.LambdaFunction.properties.handler` to `"./ts-output/handlers/api/GetReservation.handler"`
In `backend-build.js`, add "GetReservation" to API_NAMES
In `package.json`, change "main" to `"./ts-output/handlers/api/GetReservation.handler"`
In `package.json`, add
```
"dependencies": {
"aws-sdk": "^2.1692.0"
}
```
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
此 issue 描述如何使用 Amplify CLI 新增名為 GetReservation 的 AWS Lambda 函式。先在終端機中執行 `amplify add function`,並依照步驟建立一個可存取多個儲存資源的 Node.js Lambda。接著前往 `amplify/backend/function/GetReservation`,刪除 `src/index.js`,並依照指定內容更新 `GetItem-cloudformation-template.json`、`backend-build.js` 和 `package.json` 等設定檔。函式完成設定且相依套件已新增後,工作即告完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- aws, node.js, typescript
- 領域
- api, backend, cloud
- Issue 類型
- 功能
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 45/100