AWS Lambda is using an older version of boto3, which does not have rds-data yet.
You will have to create a deployment package containing a more recent version of boto3.
One way to do this would be to:
Create your lambda handler file (in this case named index.py).
def my_handler(event, context):
client = boto3.client('rds-data')
print(client)
# do stuff
return "hello world"
Add a requirements.txt file in the same folder, which will contain something like:
awscli >= 1.16.118
boto3 >= 1.9.108
Now run this (you can use pip instead of pip3) in the directory of your index and requirement file:
pip3 install -r requirements.txt -t .
zip -r somezipname .
Next, upload this zip and change your handler 'entry point' to index.my_handler. The code should now run without errors.
Want to learn more about AWS, then do check out AWS Course offered by Intellipaat.