Skip to content

Find ec2 instance using public dns name #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nitrocode opened this issue Jan 20, 2021 · 0 comments
Open

Find ec2 instance using public dns name #306

nitrocode opened this issue Jan 20, 2021 · 0 comments

Comments

@nitrocode
Copy link
Contributor

nitrocode commented Jan 20, 2021

Problem

In AWS emr, we get the public dns name and frequently need to get the instance id to get the private dns. We do this by searching for the public dns directly in the aws console > ec2 page.

I could not find a way to get the instance id from a public dns record using bma. The list of items that the bma instances command searches

https://github.com/bash-my-aws/bash-my-aws/blob/12109ec65a5c76d8242fd4839c7d89e3b3bfd9d5/lib/instance-functions#L30-L39

does not have the NetworkInterfaces[0].PrivateIpAddresses[0].Association.PublicDnsName key so it does not find the records when using

instances ec2-snip.us-east-1.compute.amazonaws.com

Proposed solution

I propose a bma dns-instance command that would do exactly this.

Or would it be better to add the NetworkInterfaces[0].PrivateIpAddresses[0].Association.PublicDnsName key to the bma instances command ?

Related

PR #299

@nitrocode nitrocode changed the title Search for public dns name to get ec2 instance Find ec2 instance using public dns name Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant