'Aws lambda not showing "Task timed out" error while connecting rds with boto3
I am getting a mysterious error of Tasked timing out as shown in the screenshot I attached

Here I tried to connect with my rds database with boto3 provided all the required params like secret keys arn etc but still, nothing seems to work.Connected with proper vpc's and given role to lambda with all required policies
here is the code on lamda
import json
import boto3
rds_data = boto3.client('rds-data')
database_name = ''
db_clust_arn = ''
db_secret_arn = ''
def lambda_handler(event, context):
sql = """"
response = rds_data.execute_statement(
resourceArn = db_clust_arn,
secretArn = db_secret_arn,
database = database_name,
sql = sql,
)
print(str(response))
enter code here
Solution 1:[1]
You need to use the RDS Lambda Proxy.
When you put your lambda in the VPC it won't have access to make HTTP calls by default so the request will never be routed to RDS, even though they are in the same VPC. That's because Lambda doesn't have an ENI attached which can route your requests.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Warren Parad |
