Issue Summary

Following the setup instructions for AWS and using the suggesting AMI for my region, I’ve successfully got an EC2 instance running that I can log in to and configure via web browser but I can’t get EC2 Instance Connect to work.

I’m creating the instance using CDK, and have this user data script:

sudo yum install ec2-instance-connect

According to the AWS docs, that should be all that’s needed but I still can’t connect. I haven’t configured the instance with a public key-pair, but have confirmed on an AWS Ubuntu image that this isn’t required.

In a terminal I’m trying:

$ aws ec2-instance-connect send-ssh-public-key --region eu-west-1 --instance-id i-<instance-id> --instance-os-user ubuntu --ssh-public-key file://id_rsa.pub
$ ssh -i id_rsa ubuntu@<instance-ip>
ubuntu@<instance-ip>: Permission denied (publickey)

AWS Console shows error

Failed to connect to your instance
Error establishing SSH connection to your instance. Please wait and try again later.

Has anyone got this to work?

Technical details:

  • Redash Version: 8.0.0+b32245 (a16f551e)
  • Browser/OS: macOS
  • How did you install Redash: AWS AMI ami-046c6a0123bf94619

Thanks for your question and welcome to the forum!

Can you check that traffic is allowed through the security group on port 22?

side note: I advise you to upgrade your V8 instance to V10 because V8 isn’t supported anymore (we’re working to update the AMI’s. More details soon).

Also I haven’t used EC2 instance connect but that looks like a cool tool. Will need to play around with it!

Thanks @jesse, it’s definitely open on port 22, that’s where the Permission denied (publickey) response comes from.

Looked at the system log and found an error like yum command not found, not that familiar with linux package management but guessing it’s just different on Ubuntu. Now trying to follow this guide using apt-get but no luck yet.

1 Like

I advise you to upgrade your V8 instance to V10 because V8 isn’t supported anymore (we’re working to update the AMI’s. More details soon).

Thanks, will take a look at this, updated AMI would be great!

1 Like

Success, used the following user data script and can now connect via AWS Console in the browser:

#!/bin/bash
apt-get update -y
apt-get upgrade -y
apt-get install -y git awscli ec2-instance-connect
1 Like

Thank you so much for posting your solution!