[英]how to add the command 'Use Lambda Proxy integration' while creating api-gateway using boto3
I am creating an api for my lambda function in aws using boto3. 我正在使用boto3在aws中为我的lambda函数创建一个api。 SO how do i add the option of having lambda proxy integration while creating the resource for that api. 所以我如何在为该API创建资源时添加具有lambda代理集成的选项。
I am using put_method for creating the resource for my api and its method type 我正在使用put_method为我的api及其方法类型创建资源
api_client.put_method(restApiId=api_id,
resourceId=name_api_id,
httpMethod='ANY',
authorizationType='NONE')
For aws lambda integration use put_integration instead. 对于AWS Lambda集成,请改用put_integration。
below you should specify your strings, just keep in mind that for lambda proxy integration you should specify 在下面,您应该指定您的字符串,请记住,对于lambda代理集成,您应该指定
type='AWS_PROXY'
integrationHttpMethod='POST'
uri = lambda url
here is the whole 这是整个
response = client.put_integration(
restApiId='string',
resourceId='string',
httpMethod='string',
type='HTTP'|'AWS'|'MOCK'|'HTTP_PROXY'|'AWS_PROXY',
integrationHttpMethod='string',
uri='string',
connectionType='INTERNET'|'VPC_LINK',
connectionId='string',
credentials='string',
requestParameters={
'string': 'string'
},
requestTemplates={
'string': 'string'
},
passthroughBehavior='string',
cacheNamespace='string',
cacheKeyParameters=[
'string',
],
contentHandling='CONVERT_TO_BINARY'|'CONVERT_TO_TEXT',
timeoutInMillis=123
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.