I have a lambda function that connects in an ec2 instance by ssh. Both lambda function and instance are in the same VPC. Lambda function has IAM Role with Administrator Access (full access). When I execute the function, I get "Error: Timed out while waiting for handshake".
I think I need to set security group in the instance to allow connections in port 22. But for which IPs? Do I need to configure something else to allow the ssh connection?