简体   繁体   中英

How to access MySQL running on an EC2 instance from Lambda?

Is it possible to use Lambda(triggered by AWS IoT) to read/write to a MySQL server running on an EC2 instance? If so how would you do that? All info I see on internet seems to relate specifically to Amazon RDS rather than EC2 instances.

Thanks, Marcus

You need to connect the Lambda to the subnet where the MySQL server is running. See https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html .

Once that is done, you can connect to it using the server's private IP, as you normally would any MySQL server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM