![Query AWS resources using Amazon Q Developer, interact with them on the CLI](/_next/image?url=https%3A%2F%2Fassets.community.aws%2Fa%2F2j77B2jbXdY7dexw41v22jls4l4%2FScre.webp%3FimgSize%3D1126x851&w=3840&q=75)
Query AWS resources using Amazon Q Developer, interact with them on the CLI
Follow along as I debug an SSH connection failure, and fix it using Amazon Q Developer
Nathan Peck
Amazon Employee
Published Jul 11, 2024
Today I temporarily lost access to an EC2 instance I often connect to. Fortunately, Amazon Q Developer just launched the ability to chat with your AWS resources. I opened up the Q chat in the AWS console and asked a quick question to see whether my EC2 instance was actually running:
![](/_next/image?url=https%3A%2F%2Fassets.community.aws%2Fa%2F2j76uzEuwLme2FgAzSt8mQfXAuP%2FScre.webp%3FimgSize%3D1126x851&w=3840&q=75)
Okay, I can see that my EC2 instance is there and running, but why can't I connect to it? Let's check the security group to see if there is a connectivity issue there:
![](/_next/image?url=https%3A%2F%2Fassets.community.aws%2Fa%2F2j76mByk55VRXm73SK88LEPv3aI%2FScre.webp%3FimgSize%3D1134x1018&w=3840&q=75)
Ah that makes sense... that's not my current IP address, so my attempt to SSH is being blocked by the security group! To solve this problem, I open up the command line and run
q chat
to launch Amazon Q Developer on the CLI to ask how to solve this. I don't remember the right command and I am very lazy:![](/_next/image?url=https%3A%2F%2Fassets.community.aws%2Fa%2F2j75tNRtEHA5zGsdabmTf8fn8O3%2FScre.webp%3FimgSize%3D1920x1750&w=3840&q=75)
Just like that I've got commands to run, and all I have to do is make a small customization so that it uses the security group name from above:
A minute later I was in on my EC2 instance!
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.