# configure environment with AWS info {% raw %} export INSTANCE_ID=`curl -sf http://169.254.169.254/latest/meta-data/instance-id` if ! export PUBLIC_HOSTNAME=`curl -sf http://169.254.169.254/latest/meta-data/public-hostname` then export PUBLIC_HOSTNAME='' fi if ! export PUBLIC_IP=`curl -sf http://169.254.169.254/latest/meta-data/public-ipv4` then export PUBLIC_IP='' fi export PRIVATE_IP=`curl -sf http://169.254.169.254/latest/meta-data/local-ipv4` export EC2_AZ=`curl -sf http://169.254.169.254/latest/meta-data/placement/availability-zone/` TMP="${#EC2_AZ}" export EC2_REGION="${EC2_AZ:0:$TMP-1}" unset TMP {% endraw %} # hard-code here for systems without userdata export CLOUD_ACCOUNT={{ ACCT_NAME }} export CLOUD_MODULE={{ my_tags['tags']['module']|default('(no module)') }} export CLOUD_STACK={{ my_tags['tags']['stack']|default() }} export CLOUD_PHASE={{ my_tags['tags']['phase']|default('None') }} export CLOUD_AUTO_SCALE_GROUP={{ my_tags['tags']['aws:autoscaling:groupName']|default() }} # export CLOUD_LAUNCH_CONFIG=module-stack-country-phase-version