How does AWS configure the 169.254.169.254 address on an instance?

Most linux distributions will already create a Zeroconf route, which is probably why Amazon figured they would "borrow" that particular IP address. For example, if you install CentOS 7 then "out of the box" your primary Ethernet will get a route added:

/etc/sysconfig/network-scripts/ifup-eth

# Add Zeroconf route.
if [ -z "${NOZEROCONF}" -a "${ISALIAS}" = "no" -a "${REALDEVICE}" != "lo" ]; then
    ip route add 169.254.0.0/16 dev ${REALDEVICE} metric $((1000 + $(cat /sys/class/net/${REALDEVICE}/ifindex))) scope link
fi

No doubt similar stuff exists in debian, ubuntu, etc...

You may wonder how it works when none of your local interface addresses are even in the correct subnet, but actually Linux doesn't care too much about that. Some servers generate a local Zeroconf address just using random numbers as per RFC3927, in which case they will use the generated address. Either way shouldn't make much difference, provided the thing at 169.254.169.254 is happy to answer.