【发布时间】:2020-12-01 05:01:22
【问题描述】:
我已经使用 boto3 import 命令从我现有的 api 创建了一个 api 网关。
apiClient = boto3.client('apigateway', awsregion)
api_response=apiClient.import_rest_api
(
failOnWarnings=True,
body=open('apifileswagger.json', 'rb').read()
)
但我无法修改集成请求。我尝试使用以下 Boto3 命令。
apiClient = boto3.client('apigateway', awsregion)
api_response=apiClient.put_integration
(
restApiId=apiName,
resourceId='/api/v1/hub',
httpMethod='GET',
integrationHttpMethod='GET',
type='AWS',
uri='arn:aws:lambda:us-east-1:141697213513:function:test-lambda',
)
但是我遇到了这样的错误
Unexpected error: An error occurred () when calling the PutIntegration operation:
我需要使用 Boto3 命令更改 lambda 函数区域和名称。可能吗? .
如果可能的话,这个命令的实际问题是什么?
【问题讨论】:
标签: python amazon-web-services aws-lambda aws-api-gateway boto3