gjbae1212 / gossm

💻Interactive CLI tool that you can connect to ec2 using commands same as start-session, ssh in AWS SSM Session Manager
MIT License
418 stars 51 forks source link

Fix bug where instance only has either public or private ip. #42

Closed ocampeau closed 3 years ago

ocampeau commented 3 years ago

This pull request fixes a bug where, if an EC2 instance only have a private or a public IP, it gets ignored.

if inst.PublicIpAddress == nil || inst.PrivateIpAddress == nil {
   continue
}

Since it's an OR, it means it only accepts instance with both a public and a private IP.

My pull request fixes this bug by looking at each IP individually