I'm trying to write my first Python code in Lambda function that will check whether i'm able to SSH (port 22) in to an EC2 instance.
I have created an EC2 instance with Security Group 22 CidrIP my public IP then, created a Lambda function with python 3.8 as runtime in the same account
Now, through code i,m trying to SSH into EC2 by passing EC2 Public IP, Username, Key pair
and execute one command, example: sudo su
Question:
- Where should i place my keypair?
- What is the code to SSH in to EC2 from lambda funtion?