0

Is there a way to capture the master public DNS of an AWS EMR cluster after it's been created via CLI? I'm using these scripts to accomplish this.

A second question, that may be outside SO guidelines, what are best practices for capturing variables from the command line and then editing a bash script? I've considered environmental variables but my understanding is that custom variables don't persist beyond the shell session.

Thanks!

willwrighteng
  • 1,411
  • 11
  • 25

1 Answers1

3

For capturing EMR master public DNS:

  • Wait for the cluster to be in running state:
  • aws emr wait cluster-running --cluster-id $ID
  • Describe the cluster and get the master public DNS name:
  • MASTER_DNS=$(aws emr describe-cluster --cluster-id $ID --query 'Cluster.MasterPublicDnsName' --output text)

You may pass environment variables from one script to the other or use some external storage. More details on sharing variables

amsh
  • 3,097
  • 2
  • 12
  • 26