Wednesday, October 23, 2013

Using the AWS CLI to get a public hostname

We use this for the next step,  amending Putty.

  • Assumptions : 
  • We know the instance-id 
  • We have a working CLI. 
So we use ec2-describe-instances 

We use a filter to only get info for our instance. 
We use a query to only output the Public DNSNAME 
aws ec2 describe-instances 

--filters "Name=instance-id,
--output  text

C:\Users\Chris\.aws>aws ec2 describe-instances --filters "Name=instance-id,Value
s=i-xxxxxxxx" --query "Reservations[*].Instances[*].{dz:PublicDnsName}" --output

So now we have our public DNSNAME, and with that we can change our putty settings ! 

No comments: