I have a lambda function that calls the parameter store to retrieve a credential. The code is as follows:
import boto3
ssm = boto3.client('ssm')
parameter = ssm.get_parameter(Name='credentials', WithDecryption=True)
print(parameter['Parameter']['Value'])
I have given AmazonSSMFullAccess to the lambda role. The lambda has a VPC which later I'll use it to connect to a Redshift database without public access. The inbound and outbound rules are as follows:

There is a post AWS Lambda cannot connect to Parameter Store which mentions that if the lambda requires VPC, then add a NAT gateway.
In the lambda subnet route table:
, there seems to be already a route that goes to the internet?
But I am still getting lambda time-out errors :(