我需要使用aws客戶端創建api網關。我可以通過使用Web控制檯來創建和集成我的aws-lambda函數。但是iam與aws-client混淆了。這些是我遵循的步驟。使用aws-cli創建api-gateway lambda集成
- 創建api網關,並使用Web控制檯與我的示例lambda函數集成。
- 部署創建的API和出口爲JSON文件。
使用aws-cli使用導出的json文件創建新的api網關。像這樣的命令。
aws apigateway import-rest-api --body file://tmpfile.json --region us-east-1;
將api方法與我的lambda函數集成在一起。我執行命令,這樣
aws apigateway put-integration --rest-api-id 42ku123id8u3a --resource-id core-api-dev --http-method DELETE --type AWS --integration-http-method POST --uri 'arn:aws:lambda:us-east-1:my-lambda-function-arn' --region us-east-1
但它產生這樣
但是隻創造了資源的開發&方法。
An error occurred (NotFoundException) when calling the PutIntegration operation: Invalid Resource identifier specified
錯誤消息是可以集成使用AWS客戶現有的lambda函數API網關的方法?什麼是資源標識符?
該文檔有一個示例lambda集成:http://docs.aws.amazon.com/cli/latest/reference/apigateway/put-integration.html – mttdbrd