curl http://100.100.100.200/latest/meta-data/ram/security-credentials/<Name of the instance RAM role>
More secure method via X-aliyun-ecs-metadata-token is not work:
# Obtain the access credentials of the metadata server for authentication.
TOKEN=`curl -X PUT "http://100.100.100.200/latest/api/token" -H "X-aliyun-ecs-metadata-token-ttl-seconds:<Validity period of the metadata server access credentials>"`
# Obtain a temporary authorization token for the instance RAM role.
curl -H "X-aliyun-ecs-metadata-token: $TOKEN" http://100.100.100.200/latest/meta-data/ram/security-credentials/<Name of the instance RAM role>
The SDK only works with direct fetch STS token:
More secure method via
X-aliyun-ecs-metadata-token
is not work:Reference: https://www.alibabacloud.com/help/en/ecs/user-guide/obtain-a-temporary-authorization-token