Hi.
I can’t create key pairs in lab account 319385625986
You are not authorized to perform this operation. User: arn:aws:iam::319385625986:user/kk_labs_user_683141 is not authorized to perform: ec2:CreateKeyPair on resource: arn:aws:ec2:eu-north-1:319385625986:key-pair/Ec2instancekeypair with an explicit deny in a service control policy. Encoded authorization failure message: BF4UlR4gKDI_aKu5ajCsS1awZ7QHpXnzxsg45s4AFh1vtMwfYfnKstnJbK4yjf25tXbSzHCQ4bB-FDPwbz1Kb2HPf6LioVdhb0N_nYHZZ4rzh_VT7hmIdHowp3AIwHIo8HTEi3M4YiPrY_uPH1iv-I9RkkX_L7vfd_V69yvRSXw3Ku3keK2tsWNW-QxTkVdjMV5QT8cPS6gUhv8Qvi_6yRQtUu2ahCgZVPOSbXCyOs_UI-vs7nNf05OfrkNwRURMnmIcTmgycsA71AvEWmFAREW2W8yKcwPAzDKIFbGFzCd-BCXd3It35KDMdjh4IDWZDGRGoxRysMMxr9v5Vf8NeVcylrd54Znnb6rTh1vocKO7odY8ehlr-haKSp8GUpjHAzWzk5B3D93oo2yJ8jcREkZrhZMARvBuVpA9FUVtTVG095tyWDCHHjmkDcEIeIunT96kZ4Vt76VWR-R78ARuQAdCd-HO18IJcuuhRBOczCxCkCa__q4r4N1rBJdy3ioOjmnqXw38ChWpJQR7TjBMeeAAxZ6TtKNcBf_Rb0VxCRnQKqMVtmxfv1TO2yDh51jSx2Vb_Eq5kbMQUh5mTBBfGlo39SM5StRMkFNUOtsSKn4zo7g9gl7HyhH_u4wQ1ysGLc8yFGUGVNpIKfC0qnJmyOo5z6RbG4GUULjANNpkuj3ijOeLyXnkqk56HWqkzjO66LKaC7kSH3JR4OVqAR0AJSyYLdKsu_zqw0FxFkCQ6BW9NU9zwYlylNiI4WDd4Q
The second bullet says that I should import the key to EC2. In next steps it asks to create an EC2 instance and then connect to them using those key pairs…
I can’t create nor import the key created locally.
Well I see. But as you can see ion the screenshot, it says that I should use the AWS Console.
The title should change or the permission inside the account.
It doesn’t say to use the AWS console to create the key pair. The idea behind creating a local key pair is you never share the private key so it is more secure. You can use ssh-keygen to create the key pair then use the AWS GUI to upload only the public key.
Yes you can upload the key, I have done it - the lab works. Make sure you are in the correct region and in EC2 select Key Pairs and then select the Actions down down and select Import key pair. Paste the public key ensuring you have set the name correctly and click the Import key pair button.
However, when I click the ‘Check’ button on the lab UI, the first step (‘SSH Key is created in the terminal?’) passes but the second step (‘Ec2instancekeypair.pub is imported to AWS Console ?’) fails. If I create an EC2 instance with this imported Ec2instancekeypair.pub, the ssh to ec2-user@the-public-ip-of-the-ec2 fails.