Trying to fetch EC2 userdata from win EC2 instance
http://169.254.169.254/latest/user-data
I get 404 - Not Found error
Trying to fetch EC2 userdata from win EC2 instance
http://169.254.169.254/latest/user-data
I get 404 - Not Found error
I believe you are experiencing that because you have no EC2 user-data attached
I conducted an experiment in my AWS Console. I launched two identical EC2 instances based an Ubuntu 18.04 image. However with one of the instances I attached user-data, the other I didn't
$ curl http://169.254.169.254/latest
dynamic
meta-data
user-data
$ curl http://169.254.169.254/latest/user-data
(prints my specified user-data)
$ curl http://169.254.169.254/latest
dynamic
meta-data
(notice the absence of user-data)
$ curl http://169.254.169.254/latest/user-data
.... <title>404 - Not Found</title> ....
This answers the OPs questions, but not what John Bresnahan experienced
You MUST use the "/" at the end for all URIs.
curl http://169.254.169.254/latest/meta-data/
curl http://169.254.169.254/latest/user-data/
Alternatively, you can use the DNS record "instance-data" instead the IP. e.g.:
curl http://instance-data/latest/user-data/
I am seeing this as well:
root@ip-172-31-29-121:/var/lib/cloud# curl http://169.254.169.254/latest/
dynamic
meta-data
user-dataroot@ip-172-31-29-121:/var/lib/cloud#
root@ip-172-31-29-121:/var/lib/cloud# curl http://169.254.169.254/latest/user-data
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>404 - Not Found</title>
</head>
<body>
<h1>404 - Not Found</h1>
</body>
</html>
Note that the first curl command indicates that the data should be there.