EC2で自身のドメイン、アドレス周り表示

ABとリージョンも出るように変更した。

vim /usr/local/bin/desc_info.sh
------------------------------------------------------
#/bin/bash

# ec2 parameter set
INSTACE_ID=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
PUBLIC_DOMAIN=`curl -s http://169.254.169.254/latest/meta-data/public-hostname`
PUBLIC_IPV4=`curl -s http://169.254.169.254/latest/meta-data/public-ipv4`
LOCAL_IPV4=`curl -s http://169.254.169.254/latest/meta-data/local-ipv4`

EC2_AVAIL_ZONE=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
EC2_REGION="`echo \"$EC2_AVAIL_ZONE\" | sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`"

echo "INSTACE_ID: $INSTACE_ID"
echo "PUBLIC_DOMAIN: $PUBLIC_DOMAIN"
echo "PUBLIC_IPV4: $PUBLIC_IPV4"
echo "LOCAL_IPV4: $LOCAL_IPV4"

echo "AB: $EC2_AVAIL_ZONE"
echo "REGION: $EC2_REGION"
------------------------------------------------------