0

I have a lambda function (lambda-invoker) that invoke another lambda (my-lambda-function). Before making the invoke call, I need to know some information of my-lambda-function, in order to pass these informations in the payload of the invoke function (and then find them in the request event of my-lambda-function). One of the informations I need to know is the full api gateway endpoint of my-lambda-function, something like:

https://YOUR-REST-API-ID.execute-api.YOUR-REGION.amazonaws.com/STAGE/RESOURCE-PATH

that is, with my function, something like this:

https://YOUR-REST-API-ID.execute-api.YOUR-REGION.amazonaws.com/test/my-lambda-function/info

What interest me is the 'stage/resource-path', so the '/test/my-lambda-function/info' part of the endpoint.

I know the function name of my-lambda-function, so I can get some information of this lambda calling the 'getFunction' api from aws sdk, but not the endpoint. I've searched in the sdk of the api gateway, and with that i can find the resource path, but I have to know the resource id (and I didi not find an sdk api that give me the resource id of my-lambda-function from the function name).

Someone know how to get the resource path of a lambda using aws sdk (for javascript in my case)?

Thanks

1 Answer 1

0

An easier solution would be to use the function URL in order to invoke it.

It seems that GetFunctionUrlConfigCommand is what you need.

You can provide the function name and you'll get the URL for it.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi Bogdan, thanks for the answer, but I think it is relate to the new URL feature that permit to attach an endpoint directly to the lambda, without using api gateway. In my case I don't use this feature, I use ApiGateway (also for for authorizathion), and I need the endpoint url created by ApiGateway
Yep. It was an alternative solution in case you don't find one for finding the API Gateway trigger for your lambda

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.