Tutorial Highlights & Transcript
00:00 - Connect EC2 using Session Manager
What I’m going to discuss is what it is, the advantage of using it, and how we can differentiate it from regular SSH tunneling. As I said earlier, basic Session Manager is used to connect to your EC2 instance, just like SSH that we use. The key difference between both of them is that using SSH, you need to have a couple of things required like you must have both 22 available. Also, you need to have a key pair value, as well. But in the case of a Session Manager, you don’t need any kind of code to access it. Nor do you need any kind of key pair. The only thing that is required here is some IAM permissions attached to your role, like this one, which is AmazonSSMManagedInstanceCore. That’s all you need in order to connect with it. By doing that, we in a way set up an extra layer of security. As there is no key involved or no ports involved. It makes it more secure.
01:31 - Prerequisites
02:41 - Demo - Setting up the EC2 Instance
04:01 - Ways to connect with the EC2 Instance
The second way, which I’m using, is going through my terminal. In order to access using this, your AWS credentials are required here, as well. In order to access it, we need some AWS CLI command to start the session you could type “AWS SSM Start Session” and we are going to enter the target. The target is the EC2 instance ID, which we can fetch from here. If I copy it here, and if I paste it here, enter. It’s going to take a couple of seconds to start the SSH session. Let me just give it sudo permissions. This was another way you can access your Session Manager through your terminal SM. You need to have that agent installed on your system, whether you’re using Mac or Windows, you want to have that installed here.
05:39 - Accessing RDS
Muhammad is a DevOps Engineer at nClouds. He has a technical certification in AWS Certified Solutions Architect - Associate.