SlideShare a Scribd company logo
1 of 51
Download to read offline
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Cloud Support Engineer / Scott Li
2019/07
經驗分享: 客戶常見問題與解決
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
大綱
• 概念分享
• 最佳實踐
• 案例分享
• AWS Support 計畫
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
概念分享
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda 工作模型 – Push Model
Client
Mobile
client
Users
Internet AWS Lambda
CloudWatch
CloudWatch
Amazon API
Gateway
Amazon SNS
Amazon SNS
Amazon S3
Amazon S3
Amazon
EC2
4
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda 工作模型 – Pull Model
Client
Mobile
client
Users
Internet
AWS Lambda
CloudWatch
Amazon SNS
Amazon S3
Amazon
EC2
Amazon Kinesis
Data Streams
Event Source
Mapping
Lambda Service
5
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda 權限模型
- Resource policy
- Execution Role
誰可以來調用Lambda 函式
Lambda 函式被允許可以做什麼
6
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda 權限模型
Internet AWS LambdaCloudWatch
CloudWatch
Amazon API
Gateway
Amazon SNS
Amazon SNS
Amazon S3
Amazon S3
Amazon
EC2Execution Role
Resource Policy
7
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda 權限模型
Client
Mobile
client
Users
Internet
CloudWatch
Amazon SNS
Amazon S3
Amazon
EC2
Amazon Kinesis
Data Streams
Event Source
Mapping
Lambda Service
Execution Role
8
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda 權限模型 - Resource policy
- 控制台
- 單一步驟 : 自來源服務設定調用 Lambda 函式或是從Lambda
函式控制台進行設定Trigger時, 控制台自動協助新增
- 使用AWS CLI指令, SDK 或是 CloudFormation 進行配置
- Lambda 函式部分
$ aws lambda add-permission --function-name lab-demo --statement-id policy01 --action lambda:InvokeFunction
--principal events.amazonaws.com --source-arn arn:aws:events:ap-northeast-2: xxxxxxxxxxxx :rule/lab-demo-rule
- CloudWatch Event 部分
$ aws events put-targets --rule lambda-rule --targets "Id"="1","Arn"="arn:aws:lambda:ap-northeast-
2:399415179832:function:lab-demo"
9
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda 權限模型- Resource policy
- Example:
{
"Version": "2012-10-17",
"Id": "default",
"Statement": [
{
"Sid": "policy",
"Effect": "Allow",
"Principal": {
"Service": ”events.amazonaws.com"
},
"Action": "lambda:InvokeFunction",
"Resource": "arn:aws:lambda:ap-northeast-2:xxxxxxxxxxxx:function:lab-demo",
"Condition": {
"ArnLike": {
"AWS:SourceArn": "arn:aws:events:ap-northeast-2:xxxxxxxxxxxx:rule/lab-demo-rule"
}
}
}
]
}
10
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda 權限模型 – Execution Role
- Trusted Relationship: Lambda
- Example:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "*"
}
]
}
11
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
調用模式
- Request Response
- Event
- Dry-run
同步調用
非同步調用
測試請求,不執行
12
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
支援的事件源
- Push model
- 同步調用
- 非同步調用
- Pull model
- Stream 事件源
- None-stream事件源
- Using AWS Lambda with Other Services -
https://docs.aws.amazon.com/lambda/latest/dg/lambda-services.html
13
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda 發生 Throttles 或是 錯誤 時的重試行為
- Push model
- 同步調用的事件源
- 非同步調用的事件源
- Pull model
- Stream事件源 (Kinesis, DynamoDB Stream)
- None-stream事件源 (SQS queue)
429 Error, Client needs to retry [Throttle]
Retry automatically up to 6 hours [Throttle]
Keep retrying until succeeds, or event expired
in the stream or queue [Error] [Throttle]
Retry automatically up to 2 times [Error]
設定 DLQ ,當非同步調用事件錯誤三次時,發送到 DLQ(SNS or SQS)
Error, Client needs to retry [Error]
14
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
- 什麼是 AWS Lambda 的並行執行 (Concurrent Execution)?
- 如何計算?
- Push event source
- Pull, stream-based event source
- 如何從 CloudWatch Metric 做監控
Equals to active shards in the stream
AWS Lambda 如何拓展?
invocations per second * average execution duration in seconds
10 Requests / second
Average Duration: 3 seconds
Estimated Concurrency: 10 x 3 = 30
1st sec, 10 Requests
2nd sec, 10 Requests
3rd sec, 10 Requests
4th sec, 10 Requests
5th sec, 10 Requests從區域層級的 Metric 做監控,除非設定 Reserved
Concurrency 才能針對某函式做觀察
10
20
30
30
30
15
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
冷啟動現象
- AWS Lambda 協助管理與設定底層運行環境, 因此不管如何嘗試, 此現象必
然存在,因此應試著與之共存,追求目標應為降低冷啟動的影響而非擺脫
冷啟動。
- 當 Execution Context 開始被重複使用, 函式會恢復效能。
- 減少部署包的大小,降低複雜相依性與邏輯。
- 選擇一個較不受影響的 Runtime 如 Python 或是 Nodejs。
- 增加記憶體有一些的幫助,但是設定超過一定大小後,效果將變得不明顯。
- 除非必要,盡量不將函式置放於 VPC 中。
- 搭配其他 AWS 服務以降低冷啟動的影響。
- 如果應用對於冷啟動所造成的 Latency 非常敏感,則考慮可其他服務如:
EC2 或是 ECS。
16
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
最佳實踐
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
最佳實踐
- 實作日誌輸出
- /aws/lambda/<function name>
- START/END/REPORT
- Single purpose and stateless
- Anti-duplication
- 程式碼優化
- 使用與 Lambda 函式相同的環境建立程式碼部署包, 降低相容性問題
- 靜態初始化,全域變數
- 控制部署包大小
- 避免複雜相依性與邏輯
- 使用環境變數來儲存必要資訊, 亦可透過 KMS Key 加密
18
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
最佳實踐
- 適時調整記憶體大小
- 定時清理不用的函式,函式版本與 Layer
- 除非必要,盡量避免置放函式於 VPC 中
- 額外需要檢查可用 IP 地址數量 / 可用 ENI 數量
- 更長的 Cold Start, 也不會更安全
- 須透過 NAT Gateway 連接網路資源
- 盡量避免函式遞迴呼叫自身
- 日誌輸出結果複雜,除錯不易
- 無窮迴圈造成可怕帳單金額
- 小心來路不明的 Layer
19
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
案例分享
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
前言
• 由於客戶資料安全與保密原則, 分享的案例已經過修改或
是置換為本地復現後的結果
• 分享案例中所提到的Support後台工具, 無法提供實際畫面
僅能以口頭敘述, 敬請見諒
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
案例一:API Gateway 返回 "Missing Authentication Token"
當發送請求至 API Gateway 時,返回訊息不正確, 只取得 “Missing
Authentication Token” 訊息, 使用 cURL 做測試也是相同結果, 使用指令如下:
$ curl https://xxx.execute-api.us-east-1.amazonaws.com/abc
22
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
客戶的問題與困擾
API Gateway 返回結果異常, 訊息無法明確得知問題
23
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
A. 通常 “Missing Authentication Token” 發生於兩種情境
a) 請求的資源或是方法不存在
b) “AWS_IAM” 驗證方法已經啟用, 但是請求並未簽署包含 IAM 訊息以供驗證
B. 使用 Support 後台工具, 檢查客戶 API Gateway 配置, 發現資源abc並不存在, 客
戶的 API Gateway root 底下只有配置一個叫做 abcc 的資源(/abcc)並且配置的
是 POST 方法
C. 結論:
資源 /abc 並不存在, 因此導致錯誤而返回此一訊息
D. 解決方案:
解釋發生問題原因, 並提供正確命令以供測試
$ curl -v -X POST https://xxx.execute-api.us-east-1.amazonaws.com/abcc -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type:
application/json"
24
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
案例二:API Gateway 返回 "Internal Server Error"
當發送請求至 API Gateway 時,返回“Internal Server Error”異常訊息, 使用
cURL 做測試也是相同結果, 而且每次都是一樣結果, 沒有一次成功, 但是直接
在 Lambda 函式控制台上測試函式, 輸出結果卻是正常的.
用來測試 API Gateway 的指令如下:
$ curl https://ooo.execute-api.us-east-1.amazonaws.com/xyz
25
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
客戶的問題與困擾
API Gateway 返回結果異常, 訊息無法明確得知問題
26
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
A. 使用 Support 後台工具, 檢查客戶 API Gateway 配置, 資源 xyz 確實存在並且配
置有 GET 方法, 而且資源 xyz 設定的是 Proxy Integration
B. 結論:
雖然 Internal Server Error 有可能其他可能性, 但由於客戶每次都得到一樣的結
果, 且在 Lambda 函式控制台測試皆為正常, 即有可能為其 response 格式有問
題.
27
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
C. 解決方案:
a) 建議客戶啟用 API Gateway 日誌後重新做測試, 並觀察日誌是否有類似下
訊息:
Thu Dec 08 01:13:00 UTC 2016 : Execution failed due to configuration error: Malformed Lambda proxy response
Thu Dec 08 01:13:00 UTC 2016 : Method completed with status: 502
b) 若有觀察到類似內容, 即有可能是 proxy response 格式造成客戶問題, 須在
Lambda 函式中使返回內容符合以下格式
{
"isBase64Encoded": true|false,
"statusCode": httpStatusCode,
"headers": { "headerName": "headerValue", ... },
"body": "..."
}
28
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
案例三:Lambda 函式運行發生錯誤
當在 Lambda 函式 tag_resource 發生以下錯誤:
"errorMessage": 'Glue' object has no attribute 'tag_resource'",
"errorType": "AttributeError",
29
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
客戶的問題與困擾
Lambda 函式所使用的 SDK 似乎有問題或是不完整
30
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
A. 在本地使用 AWS Python Boto3 SDK 版本 1.7.74 可以成功復現客戶問題,使用
SDK 版本 1.9.118 則不會有問題
B. 由於客戶配置使用 Python 2.7, 因此根據 Lambda 環境資訊, 客戶必然遇上此問題
註: 更多關於 AWS Lambda 環境資訊請參考:
AWS Lambda Runtimes - https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
Runtime SDK Version
Python 2.7 雖然文件上標示 N/A , 但可從 runtime 執行時
讀出版本亦為: 1.7.74
Python 3.6 1.7.74
Python 3.7 1.9.42
31
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
D. 結論:
客戶的問題肇因於 Lambda 函式上的 SDK 版本過舊並未包含新版本所提供的功能
E. 解決方案:
a) 建議客戶自行打包 SDK 於 Deployment Package 中
b) 若客戶還有其他函式可能也會用到較新的 SDK 版本, 則可使用 Lambda
Layer 來打包新版本的 SDK, 並且附加到需要用到的函式
32
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
案例四:無法針對函式創建 CloudWatch Event Rule
針對 Lambda 函式創建
CloudWatch Event rule時發生
錯誤, 嘗試改配置 S3 事件依然
無法成功配置, 請協助調查原因,
詳情請看截圖.
註:即使自 Lambda Function
管理控制台也無法成功.
33
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
客戶的問題與困擾
唯一線索只有控制台上的錯誤訊息
There was an error while saving rule lab-demo.
Details: The final policy size (20526) is bigger than the limit (20480)..
缺乏明確訊息釐清哪裡出問題
34
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
A. 客戶使用場景:
a) CloudWatch Event 調用 Lambda function
b) 確認 Lambda Function 權限模型
- Resource Policy
- 並且從 Support 後台工具發現客戶函式設定有大量 CloudWatch
Event 作為事件源(Trigger)
35
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
B. 從 Support 後台工具確認客戶 API 呼叫紀錄 CloudTrail 紀錄
C. Lambda Function 限制
D. 結論:
使用 AWS 控制台新增 Lambda 函式的 Trigger 時, 控制台會協助新增
Resource Policy, 當函式的 Trigger 持續增加時, Policy 也會同步增長
最後將碰上此問題
Resource Limit
Function resource-based policy 20 KB
36
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
D. 解決方案:
a) 刪除已經沒在使用的 Trigger 以減少 Policy 數量
b) 在 Resource Policy 中對來源 ARN 使用 wildcard(*) , 但須透過 AWS
Lambda CLI 作配置
c) Lambda 函式部分
$ aws lambda add-permission --function-name lab-demo --statement-id policy01 --action
lambda:InvokeFunction --principal sns.amazonaws.com --source-arn arn:aws:sns:ap-northeast-
2:xxxxxxxxxxxx:lab-*
d) CloudWatch Event 部分
$ aws events put-targets --rule lambda-rule --targets "Id"="1","Arn"="arn:aws:lambda:ap-northeast-2:
xxxxxxxxxxxx:function:lab-demo"
e) 使用星字號的缺點是, 此後無法透過控制台來管理相關 Trigger 需使用
CLI 來做管理
37
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
案例五:遺失 Lambda 函式運行日誌
確認 Lambda 函式一直有在被調用,每秒調用約莫十次,平均每次運行約
五秒,但是在 2019/07/17 08:39 UTC 時,檢查 Log 時發現 08:37, 08:38,
08:39 在 Log Stream ”
2019/07/17/[$LATEST]6ff9dfe1517f4a9083fbeaed8e1bcbcb” 只有找到三筆
請求的紀錄,CloudWatch 的 Metric 也並沒有看到錯誤或是 Throttle 發生,
請問當時 Lambda 是否有發生問題?
38
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
客戶的問題與困擾
無法從該 Log Stream 中得知為什麼沒有日誌輸
出, 並且從 CloudWatch Metrics 上也沒有發現到
錯誤或是 Throttle
39
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
A. 從 Support 後台工具確認當時確實有調用紀錄並且沒有錯誤或是 Throttle 發生
B. 檢查客戶的 IAM Role 具備有適當的權限
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "*"
}
]
}
40
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
C. 客戶使用場景
a) 每秒調用十次,平均運行時間約五秒
b) 並行執行量(Concurrent Execution)的估算:
invocations per second * average execution duration in seconds
10 x 5 = 50
Understanding Scaling Behavior - https://docs.aws.amazon.com/lambda/latest/dg/scaling.html
c) 必定有多重 Execution Context (Container, Micro VM) 並行執行
d) 每一個 Execution Context 必會有一個 log stream 供日誌輸出
e) Execution Context 可以被重複使用(機制由 Lambda 服務控制)
D. 從 Support 後台工具確認多重 Log stream 存在
41
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
E. 結論:
由於 Lambda 函式會自動拓展,按照客戶的函式執行狀況,如果請求穩定的,
則最多將會有高達 50 個並行執行量 (Concurrent Execution),因此也可能多達
50 個 Log Stream,因此日誌並不會集於 Log group 中的某些 Log stream,根據
Execution Context 的 reuse 狀況 (由 Lambda 服務控制),日誌將會寫入不同
的 Log Stream
42
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
F. 解決方案:
a) 使用 AWS Log CLI
b) 指令:
$ aws logs filter-log-events --log-group-name /aws/lambda/lab-worker --
start-time 1563352740000 --end-time 1563352800000 --output text >
/tmp/exported.log
a) 結果:
43
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
案例六:Lambda 函式發生執行逾時錯誤
Lambda 函式啟用了 VPC 設定, 但函式在和第三方網路服務做連接發生錯誤,但
是位於相同 VPC 子網段的 EC2 執行個體卻不會發生這個問題, Lambda 所使用的
Subnet, Security Group 都和該 EC2 執行個體相同, 網路配置皆為正常, 即使重新
創建了一個新的 Subnet 為何 Lambda 函式還是無法存取網路服務?
44
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
客戶的問題與困擾
網路設定沒有問題,
為什麼Lambda函式還是不能存取網路資源?
45
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
A. 從Support後台工具確認客戶設定, 確認錯誤和調用 Metric 一致, 且錯誤發生
時 Duration 亦和客戶配置的 Timeout 設定相同.
B. 由於客戶函式配置有 VPC 設定,檢查客戶的 IAM Role 具備有適當的權限
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents”,
"ec2:CreateNetworkInterface",
"ec2:DescribeNetworkInterfaces",
"ec2:DeleteNetworkInterface"
],
"Resource": "*"
}
]
}
46
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support 提供的分析與協助
C. 確認 VPC 和 子網段設定時發現, 客戶所使用的子網段預設路由(0.0.0.0/0)指
向的是一個 Internet Gateway (IGW), 但是 VPC-enabled 的 Lambda 函式只
能使用 NAT Gateway 或是 NAT Instance 來達成存取網路資源的目的
D. 結論:
VPC-enabled 的 Lambda 函式不能透過 IGW 來與網路資源做連線
E. 解決方案:
C. 建議客戶建立一個 NAT Gateway 或是 NAT Instance 連接至 Public
Subnet ( 亦即配置有 IGW 的子網段 )
D. 建立專屬子網段給 Lambda 函式使用, 並修改其預設路由(0.0.0.0/0)並指
向在剛建立的 NAT Gateway.
47
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support
開立支援案例時
1. 函式名稱與使用區域(或直接提供 ARN)
2. 提供 Request ID 和 Timestamp 並註明時區
3. 日誌(文字檔提供,Support 無法直接存取)
48
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support
輸出日誌:
a) 使用 AWS Log CLI
b) 指令:
$ aws logs filter-log-events --log-group-name /aws/lambda/<function
name> --start-time 1563352740000 --end-time 1563352800000 --output
text > /tmp/exported.log
49
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Support
訂閱 Support Plan 的好處:
1. 各式各樣服務得專家提供指導, 協助使用 AWS 服務更順暢
2. 在發生問題時,AWS Support 可以透過後台工具, 更快定位問題
影響層級 狀況描述 回應時間
開發人員
(DS)
商業
(BS)
企業
(ES)
一般技術諮詢 一般開發問題,或您希望要求某項功能 24 小時內 V V V
系統受影響 非關鍵功能運作異常,或有時效性開發問題 12 小時內 V V V
生產系統受損 重要功能受損或效能受到影響 4 小時內 V V
生產系統當機 業務明顯受到影響,重要功能無法使用 1 小時內 V V
業務關鍵系統當機 有立即性風險,關鍵功能無法使用 15 分鐘內 V
50
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!

More Related Content

What's hot

2016 AWS Summit TPE - Hiiir 如何透過 AWS IAM 做好雲端權限控管
2016 AWS Summit TPE - Hiiir 如何透過 AWS IAM 做好雲端權限控管2016 AWS Summit TPE - Hiiir 如何透過 AWS IAM 做好雲端權限控管
2016 AWS Summit TPE - Hiiir 如何透過 AWS IAM 做好雲端權限控管ChiaHsien Lee
 
Aws容器服务详解
Aws容器服务详解Aws容器服务详解
Aws容器服务详解Leon Li
 
2021 二月 Kasten K10 介紹與概觀
2021 二月 Kasten K10 介紹與概觀2021 二月 Kasten K10 介紹與概觀
2021 二月 Kasten K10 介紹與概觀Wales Chen
 
零到千万可扩展架构 AWS Architecture Overview
零到千万可扩展架构 AWS Architecture Overview零到千万可扩展架构 AWS Architecture Overview
零到千万可扩展架构 AWS Architecture OverviewLeon Li
 
低延遲多人遊戲的全球佈署
低延遲多人遊戲的全球佈署低延遲多人遊戲的全球佈署
低延遲多人遊戲的全球佈署Amazon Web Services
 
如何規劃與執行大型資料中心遷移和案例分享
如何規劃與執行大型資料中心遷移和案例分享如何規劃與執行大型資料中心遷移和案例分享
如何規劃與執行大型資料中心遷移和案例分享Amazon Web Services
 
Serverless api gateway + lambda
Serverless api gateway + lambdaServerless api gateway + lambda
Serverless api gateway + lambdaLeon Li
 
AWS re:Invent Recap 2016 Taiwan part 1
AWS re:Invent Recap 2016 Taiwan part 1AWS re:Invent Recap 2016 Taiwan part 1
AWS re:Invent Recap 2016 Taiwan part 1Amazon Web Services
 
基于AWS Lambda的无服务器架构在Strikingly中的应用
基于AWS Lambda的无服务器架构在Strikingly中的应用基于AWS Lambda的无服务器架构在Strikingly中的应用
基于AWS Lambda的无服务器架构在Strikingly中的应用Daniel Gong
 
AwSome day 分享
AwSome day 分享AwSome day 分享
AwSome day 分享得翔 徐
 
Track 2 Session 2_ 電商平台的資安維運與成本管理
Track 2 Session 2_ 電商平台的資安維運與成本管理Track 2 Session 2_ 電商平台的資安維運與成本管理
Track 2 Session 2_ 電商平台的資安維運與成本管理Amazon Web Services
 
深入淺出 AWS 大數據工具
深入淺出 AWS 大數據工具深入淺出 AWS 大數據工具
深入淺出 AWS 大數據工具Amazon Web Services
 
如何利用 Amazon EMR 及Athena 打造高成本效益的大數據環境
如何利用 Amazon EMR 及Athena 打造高成本效益的大數據環境如何利用 Amazon EMR 及Athena 打造高成本效益的大數據環境
如何利用 Amazon EMR 及Athena 打造高成本效益的大數據環境Amazon Web Services
 
Track 2 Session 6_利用 Amazon Personalize 個人化推薦提升玩家體驗
Track 2 Session 6_利用 Amazon Personalize 個人化推薦提升玩家體驗Track 2 Session 6_利用 Amazon Personalize 個人化推薦提升玩家體驗
Track 2 Session 6_利用 Amazon Personalize 個人化推薦提升玩家體驗Amazon Web Services
 
雲端上的遊戲伺服器營運秘笈
雲端上的遊戲伺服器營運秘笈雲端上的遊戲伺服器營運秘笈
雲端上的遊戲伺服器營運秘笈Amazon Web Services
 
2021 四月 Veeam 多雲解決方案 (四頁版本)
2021 四月 Veeam 多雲解決方案 (四頁版本)2021 四月 Veeam 多雲解決方案 (四頁版本)
2021 四月 Veeam 多雲解決方案 (四頁版本)Wales Chen
 
Nextlink 加值服務與資安建置方案
Nextlink 加值服務與資安建置方案Nextlink 加值服務與資安建置方案
Nextlink 加值服務與資安建置方案Amazon Web Services
 
Partner Solutions: Trend Micro - Deep Security
Partner Solutions: Trend Micro - Deep SecurityPartner Solutions: Trend Micro - Deep Security
Partner Solutions: Trend Micro - Deep SecurityAmazon Web Services
 

What's hot (20)

2016 AWS Summit TPE - Hiiir 如何透過 AWS IAM 做好雲端權限控管
2016 AWS Summit TPE - Hiiir 如何透過 AWS IAM 做好雲端權限控管2016 AWS Summit TPE - Hiiir 如何透過 AWS IAM 做好雲端權限控管
2016 AWS Summit TPE - Hiiir 如何透過 AWS IAM 做好雲端權限控管
 
Aws容器服务详解
Aws容器服务详解Aws容器服务详解
Aws容器服务详解
 
2021 二月 Kasten K10 介紹與概觀
2021 二月 Kasten K10 介紹與概觀2021 二月 Kasten K10 介紹與概觀
2021 二月 Kasten K10 介紹與概觀
 
零到千万可扩展架构 AWS Architecture Overview
零到千万可扩展架构 AWS Architecture Overview零到千万可扩展架构 AWS Architecture Overview
零到千万可扩展架构 AWS Architecture Overview
 
低延遲多人遊戲的全球佈署
低延遲多人遊戲的全球佈署低延遲多人遊戲的全球佈署
低延遲多人遊戲的全球佈署
 
如何規劃與執行大型資料中心遷移和案例分享
如何規劃與執行大型資料中心遷移和案例分享如何規劃與執行大型資料中心遷移和案例分享
如何規劃與執行大型資料中心遷移和案例分享
 
Serverless api gateway + lambda
Serverless api gateway + lambdaServerless api gateway + lambda
Serverless api gateway + lambda
 
AWS re:Invent Recap 2016 Taiwan part 1
AWS re:Invent Recap 2016 Taiwan part 1AWS re:Invent Recap 2016 Taiwan part 1
AWS re:Invent Recap 2016 Taiwan part 1
 
基于AWS Lambda的无服务器架构在Strikingly中的应用
基于AWS Lambda的无服务器架构在Strikingly中的应用基于AWS Lambda的无服务器架构在Strikingly中的应用
基于AWS Lambda的无服务器架构在Strikingly中的应用
 
AwSome day 分享
AwSome day 分享AwSome day 分享
AwSome day 分享
 
Building IoT Backends
Building IoT BackendsBuilding IoT Backends
Building IoT Backends
 
Track 2 Session 2_ 電商平台的資安維運與成本管理
Track 2 Session 2_ 電商平台的資安維運與成本管理Track 2 Session 2_ 電商平台的資安維運與成本管理
Track 2 Session 2_ 電商平台的資安維運與成本管理
 
深入淺出 AWS 大數據工具
深入淺出 AWS 大數據工具深入淺出 AWS 大數據工具
深入淺出 AWS 大數據工具
 
如何利用 Amazon EMR 及Athena 打造高成本效益的大數據環境
如何利用 Amazon EMR 及Athena 打造高成本效益的大數據環境如何利用 Amazon EMR 及Athena 打造高成本效益的大數據環境
如何利用 Amazon EMR 及Athena 打造高成本效益的大數據環境
 
Track 2 Session 6_利用 Amazon Personalize 個人化推薦提升玩家體驗
Track 2 Session 6_利用 Amazon Personalize 個人化推薦提升玩家體驗Track 2 Session 6_利用 Amazon Personalize 個人化推薦提升玩家體驗
Track 2 Session 6_利用 Amazon Personalize 個人化推薦提升玩家體驗
 
雲端上的遊戲伺服器營運秘笈
雲端上的遊戲伺服器營運秘笈雲端上的遊戲伺服器營運秘笈
雲端上的遊戲伺服器營運秘笈
 
災難演練@AWS 實戰分享
災難演練@AWS 實戰分享 災難演練@AWS 實戰分享
災難演練@AWS 實戰分享
 
2021 四月 Veeam 多雲解決方案 (四頁版本)
2021 四月 Veeam 多雲解決方案 (四頁版本)2021 四月 Veeam 多雲解決方案 (四頁版本)
2021 四月 Veeam 多雲解決方案 (四頁版本)
 
Nextlink 加值服務與資安建置方案
Nextlink 加值服務與資安建置方案Nextlink 加值服務與資安建置方案
Nextlink 加值服務與資安建置方案
 
Partner Solutions: Trend Micro - Deep Security
Partner Solutions: Trend Micro - Deep SecurityPartner Solutions: Trend Micro - Deep Security
Partner Solutions: Trend Micro - Deep Security
 

Similar to 客戶常見問題分享與解決

AWS_Educate_NTU_Rekognition_Analysis_S3_Image.pptx
AWS_Educate_NTU_Rekognition_Analysis_S3_Image.pptxAWS_Educate_NTU_Rekognition_Analysis_S3_Image.pptx
AWS_Educate_NTU_Rekognition_Analysis_S3_Image.pptx土撥 JIE
 
CKmates - AWS 三大 AI 解決方案:應用影像辨識、聊天機器人與語音轉換以及 Serverless 應用
CKmates - AWS 三大 AI 解決方案:應用影像辨識、聊天機器人與語音轉換以及 Serverless 應用CKmates - AWS 三大 AI 解決方案:應用影像辨識、聊天機器人與語音轉換以及 Serverless 應用
CKmates - AWS 三大 AI 解決方案:應用影像辨識、聊天機器人與語音轉換以及 Serverless 應用均民 戴
 
twMVC#29 | 當.Net Core 遇到AWS Lambda
twMVC#29 | 當.Net Core 遇到AWS LambdatwMVC#29 | 當.Net Core 遇到AWS Lambda
twMVC#29 | 當.Net Core 遇到AWS LambdatwMVC
 
20230829 - 探索職涯,複利人生
20230829 - 探索職涯,複利人生20230829 - 探索職涯,複利人生
20230829 - 探索職涯,複利人生Rick Hwang
 
Aws reinvent 2015 - day 2
Aws reinvent 2015 - day 2Aws reinvent 2015 - day 2
Aws reinvent 2015 - day 2Bruce Chen
 
AWS Career Exploration Day
AWS Career Exploration DayAWS Career Exploration Day
AWS Career Exploration DayRick Hwang
 
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集ASUSCloud
 
AWS Summit: Strikingly analytics
AWS Summit:  Strikingly analyticsAWS Summit:  Strikingly analytics
AWS Summit: Strikingly analyticsChase Zhang
 
AWS雲端架構師 培訓&考試課程介紹
AWS雲端架構師 培訓&考試課程介紹AWS雲端架構師 培訓&考試課程介紹
AWS雲端架構師 培訓&考試課程介紹QCloudMentor
 
Paas研究介绍
Paas研究介绍Paas研究介绍
Paas研究介绍snakebbf
 
AWS 雲端環境的資安佈局.pdf
AWS 雲端環境的資安佈局.pdfAWS 雲端環境的資安佈局.pdf
AWS 雲端環境的資安佈局.pdfssuser293781
 
01-aws-雲端服務介紹與案例分享-justine-peng.pdf
01-aws-雲端服務介紹與案例分享-justine-peng.pdf01-aws-雲端服務介紹與案例分享-justine-peng.pdf
01-aws-雲端服務介紹與案例分享-justine-peng.pdfHuangAndy6
 
IDC大会:新浪SAE架构与设计
IDC大会:新浪SAE架构与设计IDC大会:新浪SAE架构与设计
IDC大会:新浪SAE架构与设计Xi Zeng
 
twMVC 47_Elastic APM 的兩三事
twMVC 47_Elastic APM 的兩三事twMVC 47_Elastic APM 的兩三事
twMVC 47_Elastic APM 的兩三事twMVC
 
Pm 04 华胜天成openstack实践汇报-20120808
Pm 04 华胜天成openstack实践汇报-20120808Pm 04 华胜天成openstack实践汇报-20120808
Pm 04 华胜天成openstack实践汇报-20120808OpenCity Community
 
Introduction to ngn sce
Introduction to ngn sceIntroduction to ngn sce
Introduction to ngn scegdems
 
Using google appengine (2)
Using google appengine (2)Using google appengine (2)
Using google appengine (2)Wei Sun
 

Similar to 客戶常見問題分享與解決 (20)

AWS_Educate_NTU_Rekognition_Analysis_S3_Image.pptx
AWS_Educate_NTU_Rekognition_Analysis_S3_Image.pptxAWS_Educate_NTU_Rekognition_Analysis_S3_Image.pptx
AWS_Educate_NTU_Rekognition_Analysis_S3_Image.pptx
 
CKmates - AWS 三大 AI 解決方案:應用影像辨識、聊天機器人與語音轉換以及 Serverless 應用
CKmates - AWS 三大 AI 解決方案:應用影像辨識、聊天機器人與語音轉換以及 Serverless 應用CKmates - AWS 三大 AI 解決方案:應用影像辨識、聊天機器人與語音轉換以及 Serverless 應用
CKmates - AWS 三大 AI 解決方案:應用影像辨識、聊天機器人與語音轉換以及 Serverless 應用
 
twMVC#29 | 當.Net Core 遇到AWS Lambda
twMVC#29 | 當.Net Core 遇到AWS LambdatwMVC#29 | 當.Net Core 遇到AWS Lambda
twMVC#29 | 當.Net Core 遇到AWS Lambda
 
20230829 - 探索職涯,複利人生
20230829 - 探索職涯,複利人生20230829 - 探索職涯,複利人生
20230829 - 探索職涯,複利人生
 
Aws reinvent 2015 - day 2
Aws reinvent 2015 - day 2Aws reinvent 2015 - day 2
Aws reinvent 2015 - day 2
 
AWS Career Exploration Day
AWS Career Exploration DayAWS Career Exploration Day
AWS Career Exploration Day
 
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
0527 asus cloud day 開放。引領數位內容進軍國際 – 華碩雲端市集
 
AWS Summit: Strikingly analytics
AWS Summit:  Strikingly analyticsAWS Summit:  Strikingly analytics
AWS Summit: Strikingly analytics
 
AWS雲端架構師 培訓&考試課程介紹
AWS雲端架構師 培訓&考試課程介紹AWS雲端架構師 培訓&考試課程介紹
AWS雲端架構師 培訓&考試課程介紹
 
Paas研究介绍
Paas研究介绍Paas研究介绍
Paas研究介绍
 
深入探討雲端安全
深入探討雲端安全深入探討雲端安全
深入探討雲端安全
 
AWS 雲端環境的資安佈局.pdf
AWS 雲端環境的資安佈局.pdfAWS 雲端環境的資安佈局.pdf
AWS 雲端環境的資安佈局.pdf
 
01-aws-雲端服務介紹與案例分享-justine-peng.pdf
01-aws-雲端服務介紹與案例分享-justine-peng.pdf01-aws-雲端服務介紹與案例分享-justine-peng.pdf
01-aws-雲端服務介紹與案例分享-justine-peng.pdf
 
IDC大会:新浪SAE架构与设计
IDC大会:新浪SAE架构与设计IDC大会:新浪SAE架构与设计
IDC大会:新浪SAE架构与设计
 
twMVC 47_Elastic APM 的兩三事
twMVC 47_Elastic APM 的兩三事twMVC 47_Elastic APM 的兩三事
twMVC 47_Elastic APM 的兩三事
 
AWS入門
AWS入門AWS入門
AWS入門
 
Pm 04 华胜天成openstack实践汇报-20120808
Pm 04 华胜天成openstack实践汇报-20120808Pm 04 华胜天成openstack实践汇报-20120808
Pm 04 华胜天成openstack实践汇报-20120808
 
Introduction to ngn sce
Introduction to ngn sceIntroduction to ngn sce
Introduction to ngn sce
 
Retrive&amp;rank
Retrive&amp;rankRetrive&amp;rank
Retrive&amp;rank
 
Using google appengine (2)
Using google appengine (2)Using google appengine (2)
Using google appengine (2)
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

客戶常見問題分享與解決

  • 1. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Cloud Support Engineer / Scott Li 2019/07 經驗分享: 客戶常見問題與解決
  • 2. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 大綱 • 概念分享 • 最佳實踐 • 案例分享 • AWS Support 計畫
  • 3. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 概念分享
  • 4. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda 工作模型 – Push Model Client Mobile client Users Internet AWS Lambda CloudWatch CloudWatch Amazon API Gateway Amazon SNS Amazon SNS Amazon S3 Amazon S3 Amazon EC2 4
  • 5. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda 工作模型 – Pull Model Client Mobile client Users Internet AWS Lambda CloudWatch Amazon SNS Amazon S3 Amazon EC2 Amazon Kinesis Data Streams Event Source Mapping Lambda Service 5
  • 6. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda 權限模型 - Resource policy - Execution Role 誰可以來調用Lambda 函式 Lambda 函式被允許可以做什麼 6
  • 7. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda 權限模型 Internet AWS LambdaCloudWatch CloudWatch Amazon API Gateway Amazon SNS Amazon SNS Amazon S3 Amazon S3 Amazon EC2Execution Role Resource Policy 7
  • 8. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda 權限模型 Client Mobile client Users Internet CloudWatch Amazon SNS Amazon S3 Amazon EC2 Amazon Kinesis Data Streams Event Source Mapping Lambda Service Execution Role 8
  • 9. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda 權限模型 - Resource policy - 控制台 - 單一步驟 : 自來源服務設定調用 Lambda 函式或是從Lambda 函式控制台進行設定Trigger時, 控制台自動協助新增 - 使用AWS CLI指令, SDK 或是 CloudFormation 進行配置 - Lambda 函式部分 $ aws lambda add-permission --function-name lab-demo --statement-id policy01 --action lambda:InvokeFunction --principal events.amazonaws.com --source-arn arn:aws:events:ap-northeast-2: xxxxxxxxxxxx :rule/lab-demo-rule - CloudWatch Event 部分 $ aws events put-targets --rule lambda-rule --targets "Id"="1","Arn"="arn:aws:lambda:ap-northeast- 2:399415179832:function:lab-demo" 9
  • 10. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda 權限模型- Resource policy - Example: { "Version": "2012-10-17", "Id": "default", "Statement": [ { "Sid": "policy", "Effect": "Allow", "Principal": { "Service": ”events.amazonaws.com" }, "Action": "lambda:InvokeFunction", "Resource": "arn:aws:lambda:ap-northeast-2:xxxxxxxxxxxx:function:lab-demo", "Condition": { "ArnLike": { "AWS:SourceArn": "arn:aws:events:ap-northeast-2:xxxxxxxxxxxx:rule/lab-demo-rule" } } } ] } 10
  • 11. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda 權限模型 – Execution Role - Trusted Relationship: Lambda - Example: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource": "*" } ] } 11
  • 12. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 調用模式 - Request Response - Event - Dry-run 同步調用 非同步調用 測試請求,不執行 12
  • 13. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 支援的事件源 - Push model - 同步調用 - 非同步調用 - Pull model - Stream 事件源 - None-stream事件源 - Using AWS Lambda with Other Services - https://docs.aws.amazon.com/lambda/latest/dg/lambda-services.html 13
  • 14. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Lambda 發生 Throttles 或是 錯誤 時的重試行為 - Push model - 同步調用的事件源 - 非同步調用的事件源 - Pull model - Stream事件源 (Kinesis, DynamoDB Stream) - None-stream事件源 (SQS queue) 429 Error, Client needs to retry [Throttle] Retry automatically up to 6 hours [Throttle] Keep retrying until succeeds, or event expired in the stream or queue [Error] [Throttle] Retry automatically up to 2 times [Error] 設定 DLQ ,當非同步調用事件錯誤三次時,發送到 DLQ(SNS or SQS) Error, Client needs to retry [Error] 14
  • 15. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. - 什麼是 AWS Lambda 的並行執行 (Concurrent Execution)? - 如何計算? - Push event source - Pull, stream-based event source - 如何從 CloudWatch Metric 做監控 Equals to active shards in the stream AWS Lambda 如何拓展? invocations per second * average execution duration in seconds 10 Requests / second Average Duration: 3 seconds Estimated Concurrency: 10 x 3 = 30 1st sec, 10 Requests 2nd sec, 10 Requests 3rd sec, 10 Requests 4th sec, 10 Requests 5th sec, 10 Requests從區域層級的 Metric 做監控,除非設定 Reserved Concurrency 才能針對某函式做觀察 10 20 30 30 30 15
  • 16. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 冷啟動現象 - AWS Lambda 協助管理與設定底層運行環境, 因此不管如何嘗試, 此現象必 然存在,因此應試著與之共存,追求目標應為降低冷啟動的影響而非擺脫 冷啟動。 - 當 Execution Context 開始被重複使用, 函式會恢復效能。 - 減少部署包的大小,降低複雜相依性與邏輯。 - 選擇一個較不受影響的 Runtime 如 Python 或是 Nodejs。 - 增加記憶體有一些的幫助,但是設定超過一定大小後,效果將變得不明顯。 - 除非必要,盡量不將函式置放於 VPC 中。 - 搭配其他 AWS 服務以降低冷啟動的影響。 - 如果應用對於冷啟動所造成的 Latency 非常敏感,則考慮可其他服務如: EC2 或是 ECS。 16
  • 17. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 最佳實踐
  • 18. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 最佳實踐 - 實作日誌輸出 - /aws/lambda/<function name> - START/END/REPORT - Single purpose and stateless - Anti-duplication - 程式碼優化 - 使用與 Lambda 函式相同的環境建立程式碼部署包, 降低相容性問題 - 靜態初始化,全域變數 - 控制部署包大小 - 避免複雜相依性與邏輯 - 使用環境變數來儲存必要資訊, 亦可透過 KMS Key 加密 18
  • 19. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 最佳實踐 - 適時調整記憶體大小 - 定時清理不用的函式,函式版本與 Layer - 除非必要,盡量避免置放函式於 VPC 中 - 額外需要檢查可用 IP 地址數量 / 可用 ENI 數量 - 更長的 Cold Start, 也不會更安全 - 須透過 NAT Gateway 連接網路資源 - 盡量避免函式遞迴呼叫自身 - 日誌輸出結果複雜,除錯不易 - 無窮迴圈造成可怕帳單金額 - 小心來路不明的 Layer 19
  • 20. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 案例分享
  • 21. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 前言 • 由於客戶資料安全與保密原則, 分享的案例已經過修改或 是置換為本地復現後的結果 • 分享案例中所提到的Support後台工具, 無法提供實際畫面 僅能以口頭敘述, 敬請見諒
  • 22. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 案例一:API Gateway 返回 "Missing Authentication Token" 當發送請求至 API Gateway 時,返回訊息不正確, 只取得 “Missing Authentication Token” 訊息, 使用 cURL 做測試也是相同結果, 使用指令如下: $ curl https://xxx.execute-api.us-east-1.amazonaws.com/abc 22
  • 23. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 客戶的問題與困擾 API Gateway 返回結果異常, 訊息無法明確得知問題 23
  • 24. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 A. 通常 “Missing Authentication Token” 發生於兩種情境 a) 請求的資源或是方法不存在 b) “AWS_IAM” 驗證方法已經啟用, 但是請求並未簽署包含 IAM 訊息以供驗證 B. 使用 Support 後台工具, 檢查客戶 API Gateway 配置, 發現資源abc並不存在, 客 戶的 API Gateway root 底下只有配置一個叫做 abcc 的資源(/abcc)並且配置的 是 POST 方法 C. 結論: 資源 /abc 並不存在, 因此導致錯誤而返回此一訊息 D. 解決方案: 解釋發生問題原因, 並提供正確命令以供測試 $ curl -v -X POST https://xxx.execute-api.us-east-1.amazonaws.com/abcc -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" 24
  • 25. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 案例二:API Gateway 返回 "Internal Server Error" 當發送請求至 API Gateway 時,返回“Internal Server Error”異常訊息, 使用 cURL 做測試也是相同結果, 而且每次都是一樣結果, 沒有一次成功, 但是直接 在 Lambda 函式控制台上測試函式, 輸出結果卻是正常的. 用來測試 API Gateway 的指令如下: $ curl https://ooo.execute-api.us-east-1.amazonaws.com/xyz 25
  • 26. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 客戶的問題與困擾 API Gateway 返回結果異常, 訊息無法明確得知問題 26
  • 27. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 A. 使用 Support 後台工具, 檢查客戶 API Gateway 配置, 資源 xyz 確實存在並且配 置有 GET 方法, 而且資源 xyz 設定的是 Proxy Integration B. 結論: 雖然 Internal Server Error 有可能其他可能性, 但由於客戶每次都得到一樣的結 果, 且在 Lambda 函式控制台測試皆為正常, 即有可能為其 response 格式有問 題. 27
  • 28. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 C. 解決方案: a) 建議客戶啟用 API Gateway 日誌後重新做測試, 並觀察日誌是否有類似下 訊息: Thu Dec 08 01:13:00 UTC 2016 : Execution failed due to configuration error: Malformed Lambda proxy response Thu Dec 08 01:13:00 UTC 2016 : Method completed with status: 502 b) 若有觀察到類似內容, 即有可能是 proxy response 格式造成客戶問題, 須在 Lambda 函式中使返回內容符合以下格式 { "isBase64Encoded": true|false, "statusCode": httpStatusCode, "headers": { "headerName": "headerValue", ... }, "body": "..." } 28
  • 29. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 案例三:Lambda 函式運行發生錯誤 當在 Lambda 函式 tag_resource 發生以下錯誤: "errorMessage": 'Glue' object has no attribute 'tag_resource'", "errorType": "AttributeError", 29
  • 30. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 客戶的問題與困擾 Lambda 函式所使用的 SDK 似乎有問題或是不完整 30
  • 31. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 A. 在本地使用 AWS Python Boto3 SDK 版本 1.7.74 可以成功復現客戶問題,使用 SDK 版本 1.9.118 則不會有問題 B. 由於客戶配置使用 Python 2.7, 因此根據 Lambda 環境資訊, 客戶必然遇上此問題 註: 更多關於 AWS Lambda 環境資訊請參考: AWS Lambda Runtimes - https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html Runtime SDK Version Python 2.7 雖然文件上標示 N/A , 但可從 runtime 執行時 讀出版本亦為: 1.7.74 Python 3.6 1.7.74 Python 3.7 1.9.42 31
  • 32. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 D. 結論: 客戶的問題肇因於 Lambda 函式上的 SDK 版本過舊並未包含新版本所提供的功能 E. 解決方案: a) 建議客戶自行打包 SDK 於 Deployment Package 中 b) 若客戶還有其他函式可能也會用到較新的 SDK 版本, 則可使用 Lambda Layer 來打包新版本的 SDK, 並且附加到需要用到的函式 32
  • 33. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 案例四:無法針對函式創建 CloudWatch Event Rule 針對 Lambda 函式創建 CloudWatch Event rule時發生 錯誤, 嘗試改配置 S3 事件依然 無法成功配置, 請協助調查原因, 詳情請看截圖. 註:即使自 Lambda Function 管理控制台也無法成功. 33
  • 34. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 客戶的問題與困擾 唯一線索只有控制台上的錯誤訊息 There was an error while saving rule lab-demo. Details: The final policy size (20526) is bigger than the limit (20480).. 缺乏明確訊息釐清哪裡出問題 34
  • 35. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 A. 客戶使用場景: a) CloudWatch Event 調用 Lambda function b) 確認 Lambda Function 權限模型 - Resource Policy - 並且從 Support 後台工具發現客戶函式設定有大量 CloudWatch Event 作為事件源(Trigger) 35
  • 36. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 B. 從 Support 後台工具確認客戶 API 呼叫紀錄 CloudTrail 紀錄 C. Lambda Function 限制 D. 結論: 使用 AWS 控制台新增 Lambda 函式的 Trigger 時, 控制台會協助新增 Resource Policy, 當函式的 Trigger 持續增加時, Policy 也會同步增長 最後將碰上此問題 Resource Limit Function resource-based policy 20 KB 36
  • 37. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 D. 解決方案: a) 刪除已經沒在使用的 Trigger 以減少 Policy 數量 b) 在 Resource Policy 中對來源 ARN 使用 wildcard(*) , 但須透過 AWS Lambda CLI 作配置 c) Lambda 函式部分 $ aws lambda add-permission --function-name lab-demo --statement-id policy01 --action lambda:InvokeFunction --principal sns.amazonaws.com --source-arn arn:aws:sns:ap-northeast- 2:xxxxxxxxxxxx:lab-* d) CloudWatch Event 部分 $ aws events put-targets --rule lambda-rule --targets "Id"="1","Arn"="arn:aws:lambda:ap-northeast-2: xxxxxxxxxxxx:function:lab-demo" e) 使用星字號的缺點是, 此後無法透過控制台來管理相關 Trigger 需使用 CLI 來做管理 37
  • 38. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 案例五:遺失 Lambda 函式運行日誌 確認 Lambda 函式一直有在被調用,每秒調用約莫十次,平均每次運行約 五秒,但是在 2019/07/17 08:39 UTC 時,檢查 Log 時發現 08:37, 08:38, 08:39 在 Log Stream ” 2019/07/17/[$LATEST]6ff9dfe1517f4a9083fbeaed8e1bcbcb” 只有找到三筆 請求的紀錄,CloudWatch 的 Metric 也並沒有看到錯誤或是 Throttle 發生, 請問當時 Lambda 是否有發生問題? 38
  • 39. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 客戶的問題與困擾 無法從該 Log Stream 中得知為什麼沒有日誌輸 出, 並且從 CloudWatch Metrics 上也沒有發現到 錯誤或是 Throttle 39
  • 40. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 A. 從 Support 後台工具確認當時確實有調用紀錄並且沒有錯誤或是 Throttle 發生 B. 檢查客戶的 IAM Role 具備有適當的權限 { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource": "*" } ] } 40
  • 41. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 C. 客戶使用場景 a) 每秒調用十次,平均運行時間約五秒 b) 並行執行量(Concurrent Execution)的估算: invocations per second * average execution duration in seconds 10 x 5 = 50 Understanding Scaling Behavior - https://docs.aws.amazon.com/lambda/latest/dg/scaling.html c) 必定有多重 Execution Context (Container, Micro VM) 並行執行 d) 每一個 Execution Context 必會有一個 log stream 供日誌輸出 e) Execution Context 可以被重複使用(機制由 Lambda 服務控制) D. 從 Support 後台工具確認多重 Log stream 存在 41
  • 42. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 E. 結論: 由於 Lambda 函式會自動拓展,按照客戶的函式執行狀況,如果請求穩定的, 則最多將會有高達 50 個並行執行量 (Concurrent Execution),因此也可能多達 50 個 Log Stream,因此日誌並不會集於 Log group 中的某些 Log stream,根據 Execution Context 的 reuse 狀況 (由 Lambda 服務控制),日誌將會寫入不同 的 Log Stream 42
  • 43. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 F. 解決方案: a) 使用 AWS Log CLI b) 指令: $ aws logs filter-log-events --log-group-name /aws/lambda/lab-worker -- start-time 1563352740000 --end-time 1563352800000 --output text > /tmp/exported.log a) 結果: 43
  • 44. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 案例六:Lambda 函式發生執行逾時錯誤 Lambda 函式啟用了 VPC 設定, 但函式在和第三方網路服務做連接發生錯誤,但 是位於相同 VPC 子網段的 EC2 執行個體卻不會發生這個問題, Lambda 所使用的 Subnet, Security Group 都和該 EC2 執行個體相同, 網路配置皆為正常, 即使重新 創建了一個新的 Subnet 為何 Lambda 函式還是無法存取網路服務? 44
  • 45. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 客戶的問題與困擾 網路設定沒有問題, 為什麼Lambda函式還是不能存取網路資源? 45
  • 46. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 A. 從Support後台工具確認客戶設定, 確認錯誤和調用 Metric 一致, 且錯誤發生 時 Duration 亦和客戶配置的 Timeout 設定相同. B. 由於客戶函式配置有 VPC 設定,檢查客戶的 IAM Role 具備有適當的權限 { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents”, "ec2:CreateNetworkInterface", "ec2:DescribeNetworkInterfaces", "ec2:DeleteNetworkInterface" ], "Resource": "*" } ] } 46
  • 47. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 提供的分析與協助 C. 確認 VPC 和 子網段設定時發現, 客戶所使用的子網段預設路由(0.0.0.0/0)指 向的是一個 Internet Gateway (IGW), 但是 VPC-enabled 的 Lambda 函式只 能使用 NAT Gateway 或是 NAT Instance 來達成存取網路資源的目的 D. 結論: VPC-enabled 的 Lambda 函式不能透過 IGW 來與網路資源做連線 E. 解決方案: C. 建議客戶建立一個 NAT Gateway 或是 NAT Instance 連接至 Public Subnet ( 亦即配置有 IGW 的子網段 ) D. 建立專屬子網段給 Lambda 函式使用, 並修改其預設路由(0.0.0.0/0)並指 向在剛建立的 NAT Gateway. 47
  • 48. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 開立支援案例時 1. 函式名稱與使用區域(或直接提供 ARN) 2. 提供 Request ID 和 Timestamp 並註明時區 3. 日誌(文字檔提供,Support 無法直接存取) 48
  • 49. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 輸出日誌: a) 使用 AWS Log CLI b) 指令: $ aws logs filter-log-events --log-group-name /aws/lambda/<function name> --start-time 1563352740000 --end-time 1563352800000 --output text > /tmp/exported.log 49
  • 50. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Support 訂閱 Support Plan 的好處: 1. 各式各樣服務得專家提供指導, 協助使用 AWS 服務更順暢 2. 在發生問題時,AWS Support 可以透過後台工具, 更快定位問題 影響層級 狀況描述 回應時間 開發人員 (DS) 商業 (BS) 企業 (ES) 一般技術諮詢 一般開發問題,或您希望要求某項功能 24 小時內 V V V 系統受影響 非關鍵功能運作異常,或有時效性開發問題 12 小時內 V V V 生產系統受損 重要功能受損或效能受到影響 4 小時內 V V 生產系統當機 業務明顯受到影響,重要功能無法使用 1 小時內 V V 業務關鍵系統當機 有立即性風險,關鍵功能無法使用 15 分鐘內 V 50
  • 51. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you!