Looks like you need to set up Instance Connect on the instance for the browser connection to work. Judging by the guide you linked, I would assume you are using Ubuntu 16.04-based AMI.
The following was taken from this guide.
- Install
ec2-instance-connect
package.
ubuntu:~$ sudo apt-get update
ubuntu:~$ sudo apt-get install ec2-instance-connect
You should see four new files in the /usr/share/ec2-instance-connect/
folder:
eic_curl_authorized_keys
eic_harvest_hostkeys
eic_parse_authorized_keys
eic_run_authorized_keys
- Configure IAM permissions for the user that will be using Instance Connect.
Create a policy with the following content and attach it to your IAM user (replace instance ARNs with appropriate values for your instances).
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2-instance-connect:SendSSHPublicKey",
"Resource": [
"arn:aws:ec2:region:account-id:instance/i-1234567890abcdef0",
"arn:aws:ec2:region:account-id:instance/i-0598c7d356eba48d7"
],
"Condition": {
"StringEquals": {
"ec2:osuser": "ubuntu"
}
}
},
{
"Effect": "Allow",
"Action": "ec2:DescribeInstances",
"Resource": "*"
}
]
}
Browser connection should work now.