a2n-seattle / a2n-seattle/rms-app

Add GetHistory as AWS function

未關閉
#266 0 則留言 0 個 reaction 已指派 1 人 已被 @Turnonac 認領 在 GitHub 檢視
task
主要語言
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: GetHistory
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/GetHistory`
Delete `src/index.js`
In `GetItem-cloudformation-template.json`, change `resources.LambdaFunction.properties.handler` to `"./ts-output/handlers/api/GetHistory.handler"`
In `backend-build.js`, add "GetHistory" to API_NAMES
In `package.json`, change "main" to `"./ts-output/handlers/api/GetHistory.handler"`
In `package.json`, add
```
"dependencies": {
"aws-sdk": "^2.1692.0"
}
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

該 issue 描述了使用 Amplify CLI 新增一個名為 GetHistory 的 AWS Lambda 函式。首先導覽至 amplify/backend/function 目錄,並依照逐步指示建立函式及設定其對儲存資源的存取權。主要工作包括更新 GetItem-cloudformation-template.json、backend-build.js 和 package.json 等設定檔。透過檢查 AWS Amplify 設定,並確保 handler 路徑指向正確的 TypeScript 輸出位置,驗證函式是否正常運作。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
aws, javascript, typescript
領域
api, backend, cloud
Issue 類型
功能
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。