1

I am creating an api for my lambda function in aws using boto3. SO how do i add the option of having lambda proxy integration while creating the resource for that api.

I am using put_method for creating the resource for my api and its method type

api_client.put_method(restApiId=api_id,
                              resourceId=name_api_id,
                              httpMethod='ANY',
                              authorizationType='NONE')

1 Answer 1

1

For aws lambda integration use put_integration instead.

below you should specify your strings, just keep in mind that for lambda proxy integration you should specify

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
)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.