Unable to create ssh key in the terminal

I am doing the lab titled ’ Lab 4: Creating session policies with session tags and IAM conditions’

When trying to create ssh key in the terminal, I am using the aws cloudshell and gave the below command

ssh-keygen -t rsa -f ~/.ssh/Ec2instancekeypair

This created the ‘Ec2instancekeypair’ and ‘Ec2instancekeypair.pub’ under .ssh directory

But when I click on check in kodekloud lab, the task is getting failed

Two things here

  1. You created the key in the CloudShell console. It wants you to create it in the lab terminal - You would not be able to access EC2 from the lab terminal if the keys are not there.
  2. Is the key imported to the EC2 console?