如何找到lambda函数的API端点? [英] How do I find the API endpoint of a lambda function?

查看:89
本文介绍了如何找到lambda函数的API端点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Lambda函数,该函数具有一个公开的API网关终端节点,并且可以通过AWS控制台获取该URL的URL.但是,我想通过API调用获取该URL. Lambda API文档

I have a Lambda function that has an exposed API Gateway endpoint, and I can get the URL for that via the AWS console. However, I would like to get that URL via API call. Neither the Lambda API documentation nor the API Gateway documentation seem to have that information (or perhaps I've missed it), so is this even possible in the first place?

推荐答案

您的API网关端点URL不会通过API调用公开.但是,由于API的URL遵循某种结构,因此您可以获取所有必要的代码并在代码中创建URI.

Your API Gateway endpoint URL doesn't get exposed via an API call. However, since the URL of the API follows a certain structure, you could get all the necessary pieces and create the URI within your code.

https://API-ID.execute-api.REGION.amazonaws. com/STAGE

您可以使用 apigateway:rest- apis 获取您的API-ID和 restapi:stages 获取阶段对应的标识符.

You could use apigateway:rest-apis to get your API-ID and restapi:stages to get the stage corresponding identifier.

这篇关于如何找到lambda函数的API端点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆