如何疑難排解 API Gateway 的 "Execution failed due to configuration error: Invalid endpoint address (執行因組態錯誤失敗:端點地址無效)"?

2 分的閱讀內容
0

我看到 "Execution failed due to configuration error: Invalid endpoint address (執行因組態錯誤失敗:端點地址無效)" 錯誤出現於 Amazon API Gateway 的 Amazon CloudWatch 執行日誌中。導致錯誤的原因是什麼,我該如何解決?

簡短說明

與後端 HTTP 或 HTTPS 端點通訊時,API Gateway 會使用方法請求的 Endpoint URL (端點網址) 值中設定的網域。在傳送請求至端點網址之前,API Gateway 會透過執行網域名稱伺服器 (DNS) 解析來解析網域。如果 API Gateway 無法解析端點網址中的網域,CloudWatch 執行日誌中就會出現下列錯誤:

Execution failed due to configuration error: Invalid endpoint address

解決方法

若要對此錯誤進行疑難排解,請執行以下操作:

1.    若要確認 DNS 解析成功,請執行名稱解析指令,例如 dignslookup。如果 DNS 解析成功,指令回應則會傳回有效的公用 IP 地址。
**注意:**透過系統的預設指令提示字元,在 Linux 作業系統使用 dig,在 Windows 作業系統使用 nslookup

dig 指令範例:

$ dig www.amazon.com

; <<>> DiG 9.10.6 <<>> amazon.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13150
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.amazon.com.    IN    A

;; ANSWER SECTION:
www.amazon.com.        41    IN    A    54.239.17.6

;; Query time: 1 msec
;; SERVER: 10.3.9.10#53(10.3.9.10)
;; MSG SIZE rcvd: 48

nslookup 指令範例:

$ nslookup amazon.com
Server: 10.3.9.10
Address: 10.3.9.10#53

Name: amazon.com
Address: 54.239.25.192

2.    如果指令傳回您 Amazon Virtual Private Cloud (Amazon VPC) 內的私有 IP 地址,請設定 API 私有整合。 **注意:**API Gateway 私有整合可讓 Amazon VPC 以外的用戶端存取您的 HTTP 和 HTTPS 資源。

-或-

如果指令未傳回有效的公用 IP 地址,請連絡您的 DNS 供應商。要求其確認網域的 DNS 對應設定正確。


AWS 官方
AWS 官方已更新 2 年前