pulumi / pulumi-aws-apigateway

Apache License 2.0
11 stars 5 forks source link

Update API resource to allow using POST http-method when using aws_proxy with lambda #23

Open danfhernandez opened 4 years ago

danfhernandez commented 4 years ago

When integrating API Gateway with lambda using aws_proxy type, only the ANY method type is supported and it requires POST to work.

Culprit: https://github.com/pulumi/pulumi-awsx/blob/6e41506897a3d7bf3985beb8ecdc596638047699/nodejs/awsx/apigateway/api.ts#L219.

Code to reproduce below:

const lambda = new aws.lambda.CallbackFunction("mylambda", {
    callback: async e => {
      console.log("Lambda called...")
    }
  }
);

let endpoint = new awsx.apigateway.API("example", {
    routes: [{
        path: "/",
        target: {
            uri: lambda.invokeArn,
            type: "aws_proxy"
        },
    }],
})