Amazon web services 将Lambda设置为在API网关Boto3上发布

Amazon web services 将Lambda设置为在API网关Boto3上发布,amazon-web-services,aws-lambda,aws-api-gateway,boto3,Amazon Web Services,Aws Lambda,Aws Api Gateway,Boto3,我正在尝试使用boto3将lambda端点设置到api网关。我正在使用API网关boto3文档中描述的方法put\u integration。我已经成功地设置了一个POST方法,但我无法集成lambda。特别是,我很难找到uri参数的命名。我有我的accountID、regionName和functionName,但我不知道如何正确设置此参数的格式 botoKwargs = { 'restApiId' : api_id, 'resourceId' : resource_id,

我正在尝试使用boto3将lambda端点设置到api网关。我正在使用API网关boto3文档中描述的方法
put\u integration
。我已经成功地设置了一个POST方法,但我无法集成lambda。特别是,我很难找到
uri
参数的命名。我有我的accountID、regionName和functionName,但我不知道如何正确设置此参数的格式

 botoKwargs = {
    'restApiId' : api_id,
    'resourceId' : resource_id,
    'httpMethod' : 'POST',
    'type' : 'AWS',
    'integrationHttpMethod' : 'POST',
    'uri' : uri,
    # 'credentials' : credentials,
}
apig_client = get_apig_client()
apig_client.put_integration(**botoKwargs)
我确信这是唯一的问题。我找不到设置
uri
参数的规范方法。以下摘录与此相关:

For AWS or AWS_PROXY integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api} . Here, {Region} is the API Gateway region (e.g., us-east-1 ); {service} is the name of the integrated AWS service (e.g., s3 ); and {subdomain} is a designated subdomain supported by certain AWS service for fast host-name lookup. action can be used for an AWS service action-based API, using an Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an AWS service path-based API. The ensuing service_api refers to the path to an AWS service resource, including the region of the integrated AWS service, if applicable. For example, for integration with the S3 API of `GetObject <https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectGET.html>`__ , the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key} or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}
当我给出lambda arn时,我得到了错误

AWS ARN for integration must contain path or action

非常感谢您的帮助。

这里有一个相关的GitHub问题
AWS ARN for integration must contain path or action