Skip to content

Instantly share code, notes, and snippets.

@mridang
Created October 19, 2021 17:00
Show Gist options
  • Save mridang/fc63acd691224fa7ad221411af1455fc to your computer and use it in GitHub Desktop.
Save mridang/fc63acd691224fa7ad221411af1455fc to your computer and use it in GitHub Desktop.
Helper command to fetch the IP address of the master node of running EMR cluster
#!/bin/bash
aws emr describe-cluster --cluster-id @1 | jq --raw-output '.Cluster .MasterPublicDnsName | sub("ip-(?<ip1>[0-9]*)-(?<ip2>[0-9]*)-(?<ip3>[0-9]*)-(?<ip4>[0-9]*).*$"; "\(.ip1).\(.ip2).\(.ip3).\(.ip4)")'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment