https://pulumi.com logo
#typescript
Title
# typescript
m

magnificent-accountant-19074

05/11/2020, 9:57 AM
Hello, I'm trying to create api gateway connected to lambda with alias , and here it says only allowed method is
any
but it looks like when api invokes lambda only allowed method is
POST
is that so? I'm getting error from AWS api Unable to put integration on 'ANY' for resource at path '/': Integrations of type 'AWS_PROXY' currently only supports Lambda function and Firehose stream invocations. here is my SO question https://stackoverflow.com/questions/61724909/pulumi-aws-proxy-currently-only-supports-lambda-function
f

future-barista-68134

05/11/2020, 2:26 PM
I expect you’ll get the same error, but can you try:
Copy code
return new API(name, {
        routes: [
            {
                path: "/",
                target: {
            uri: "arn:aws:apigateway:eu-central-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-central-1:051069080387:function:deploy-test-4-lambda/invocations",
            type: "aws_proxy",
        },
        ],
        stageName: name + "-stage"
    }, { provider });
Also to ensure the right format you could call
getFunction
and use the
invokeArn
property from the result to input into the API gateway integration route. See: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/aws/lambda/#GetFunctionResult-invokeArn
m

magnificent-accountant-19074

05/11/2020, 3:10 PM
thank you Dan, yes, that's where I got it from
f

future-barista-68134

05/11/2020, 3:41 PM
This looks like an improvement that can be made to the awsx package. I’ve documented it here: https://github.com/pulumi/pulumi-awsx/issues/534. In the meantime, I’d recommend trying out the resources in the raw aws package here: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/aws/apigateway/#RestApiArgs. This will align 1:1 with what you’d expect in the AWS console.
m

magnificent-accountant-19074

05/11/2020, 3:42 PM
okay, thanks, I will do that
2 Views