This commit is contained in:
Greg Fodor 2020-02-27 00:53:35 +00:00
Родитель 7309565e8e
Коммит 75cf7cab40
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -15,7 +15,7 @@ ENV=""
# There is a race condition on EC2 metadata, it can be not ready yet or have no tags yet. # There is a race condition on EC2 metadata, it can be not ready yet or have no tags yet.
while [[ -z "$EC2_INFO" || -z "$HAB_RING" || -z "$ENV" ]] ; do while [[ -z "$EC2_INFO" || -z "$HAB_RING" || -z "$ENV" ]] ; do
EC2_INFO=$(aws ec2 --region us-west-1 describe-instances --instance-ids $INSTANCE_ID) EC2_INFO=$(aws ec2 --region us-west-1 describe-instances --no-paginate)
# Get the ring name # Get the ring name
HAB_RING=$(echo "$EC2_INFO" | jq -r ".Reservations | map(.Instances) | flatten | .[] | select(.InstanceId == \"$INSTANCE_ID\") | .Tags | .[]? | select(.Key == \"hab-ring\") | .Value ") HAB_RING=$(echo "$EC2_INFO" | jq -r ".Reservations | map(.Instances) | flatten | .[] | select(.InstanceId == \"$INSTANCE_ID\") | .Tags | .[]? | select(.Key == \"hab-ring\") | .Value ")