Access AWS Athena from lambda function in a VPC

0

Hi,

I have a lambda function written in Python3.7 which will submit SQL to Athena using the boto3 library. If the lambda function is not in VPC, it works fine. But, if we attach the lambda function to a VPC, it will time out while submitting a query to Athena. We have a similar problem before with AWS system manager, which was solved by creating VPC endpoints. But VPC endpoints are not available for Athena. What should I do? Any help will be appreciated!

cli
feita há 5 anos955 visualizações
2 Respostas
0

The request to the athena api needs to route over the internet. You'll need a nat instance or nat gateway in your vpc to provide that route for the lambda. https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat.html

Ellison
respondido há 5 anos
0

I see. Thank you for your reply, Ellison!
If anyone runs into a similar situation, this simple tutorial shows how to create a NAT gateway: https://gist.github.com/reggi/dc5f2620b7b4f515e68e46255ac042a7
(The NAT gateway document on AWS is long and complicated for me.)

cli
respondido há 5 anos
profile picture
ESPECIALISTA
avaliado há 6 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas