AWS CLI EMR get Master node Instance ID and tag it

后端 未结 4 1589
生来不讨喜
生来不讨喜 2021-01-06 22:20

I want to automate the running of a cluster and can use tags to get attributes of an EC2 instance like its instance-id.

The documentation on https://docs.aws.amazon.

4条回答
  •  臣服心动
    2021-01-06 22:28

    In an enviroinment where you does not have the aws cli, you can cat the following file:

    cat /mnt/var/lib/info/job-flow.json
    

    An example of the content is the following one:

    {
      "jobFlowId": "j-0000X0X0X00XX",
      "jobFlowCreationInstant": 1579512208006,
      "instanceCount": 2,
      "masterInstanceId": "i-00x0xx0000xxx0x00",
      "masterPrivateDnsName": "localhost",
      "masterInstanceType": "m5.xlarge",
      "slaveInstanceType": "m5.xlarge",
      "hadoopVersion": "2.8.5",
      "instanceGroups": [
        {
          "instanceGroupId": "ig-0XX00XX0X0XXX",
          "instanceGroupName": "Master - 1",
          "instanceRole": "Master",
          "marketType": "OnDemand",
          "instanceType": "m5.xlarge",
          "requestedInstanceCount": 1
        },
        {
          "instanceGroupId": "ig-000X0XXXXXXX",
          "instanceGroupName": "Core - 2",
          "instanceRole": "Core",
          "marketType": "OnDemand",
          "instanceType": "m5.xlarge",
          "requestedInstanceCount": 1
        }
      ]
    

    NOTE: i've omitted the ID of the jobs using 0 where a number is expected and X where a ltter is expected.

提交回复
热议问题