Reputation: 179
How can I access an Elasticsearch Service instance from a Lambda function without applying an IAM role?
Upvotes: 1
Views: 2696
Reputation: 269171
You will want to configure two Security Groups:
Lambda-SG
) and configure the Lambda function to use it.ES-SG
) and configure ElasticSearch to use it.ES-SG
, add a rule to permit inbound connections from Lambda-SG
on port 9300 (or whatever port your ES is using).That is, ES-SG
should refer to Lambda-SG
to permit inbound connections.
Upvotes: 3
Reputation: 14029
If your Lambda runs within a VPC, you can configure the ElasticSearch access policy to an IP-based policy.
AWS does provide samples for various kinds of access policies.
Upvotes: -1
Reputation: 3018
You need to provide an IAM role for a lambda function and provide the IAM role access to ES.
Upvotes: 0