Skip to content

Find ec2 instance using public dns name #306

Open
@nitrocode

Description

@nitrocode

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions