Closed qinzhuxu closed 3 years ago
All the AWS data center metadata loading logic are follow the document here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
Because I have got no EC2 instances, I have no idea how it really works in fact.
I'm sorry that you have to find out why you can't access the amazon metadata service by yourself.
Thanks for your answer 😄
I fixed my problem. I stopped using the option data_center_name
. Instead of letting this library take care of getting amazon metadata, I am using curl xxx to access to instance metadata in a separate bash file and injecting them as environment variables.
Here is the link: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
I have problem connecting to amazon metadata services.
There is no exception thrown while trying to connect(
s.connect((_AWS_METADATA_SERVICE_IP, 80))
) to amazon metadata services. There a only a bunch of warnings.Is it possible that port 80 is not available? Any ideas?