简体   繁体   English

如何使用boto3创建api-gateway时添加命令“使用Lambda代理集成”

[英]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.

相关问题 使用boto3创建AWS Lambda函数 - Creating AWS Lambda function using boto3 如何在 lambda 函数中使用 boto3 和 python 调用胶水工作流时传递 RunProperties? - How to pass RunProperties while calling the glue workflow using boto3 and python in lambda function? 如何使用 boto3 更新 CloudFront 事件以触发 lambda - How to update CloudFront events to trigger lambda using boto3 Boto3 InvalidParameterException 执行 lambda function - Boto3 InvalidParameterException while executing the lambda function 尝试在 VSCode 中使用 boto3 python 3.7 创建 lambda 函数时出现“AttributeError: module 'boto3' has no attribute 'client'”错误 - "AttributeError: module 'boto3' has no attribute 'client'" error while trying to create lambda function using boto3 python 3.7 in VSCode 如何使用 Boto3 分页 - How to use Boto3 pagination 使用 boto3 在 DynamoDB 中创建“SS”项目 - Creating a 'SS' item in DynamoDB using boto3 在 Boto3 中使用 SSM send_command - Using the SSM send_command in Boto3 使用boto3列出S3对象时,强制AWS Lambda使用UTC - Force AWS Lambda to use UTC when listing S3 objects using boto3 在创建 EC2 实例时使用 boto3 在用户数据中传递变量 - Pass variable in user data using boto3 while creating EC2 Instance
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM