从同一VPC中的Lambda连接到Elasticsearch Service [英] Connect to Elasticsearch Service from Lambda in the same VPC
本文介绍了从同一VPC中的Lambda连接到Elasticsearch Service的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在不应用IAM角色的情况下从Lambda函数访问Elasticsearch Service实例?
How can I access an Elasticsearch Service instance from a Lambda function without applying an IAM role?
推荐答案
您将要配置两个安全组:
You will want to configure two Security Groups:
- 配置Lambda函数以使用VPC.
- 创建Lambda安全组(
Lambda-SG
)并配置Lambda函数以使用它. - 创建一个ElasticSearch安全组(
ES-SG
)并将其配置为使用ElasticSearch. - 在
ES-SG
中,添加一条规则以允许来自端口9300(或您的ES正在使用的任何端口)上的Lambda-SG
的入站连接.
- Configure the Lambda function to use the VPC.
- Create a Lambda Security Group (
Lambda-SG
) and configure the Lambda function to use it. - Create an ElasticSearch Security Group (
ES-SG
) and configure ElasticSearch to use it. - In
ES-SG
, add a rule to permit inbound connections fromLambda-SG
on port 9300 (or whatever port your ES is using).
也就是说,ES-SG
应该引用Lambda-SG
以允许入站连接.
That is, ES-SG
should refer to Lambda-SG
to permit inbound connections.
这篇关于从同一VPC中的Lambda连接到Elasticsearch Service的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文