http://169.254.169.254/latest/api/token \ -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" ${TOKEN} $ curl http://169.254.169.254/latest/meta-data/iam/security-credentials/ \ -H "X-aws-ec2-metadata-token: ${TOKEN}" hogehoge $ curl http://169.254.169.254/latest/meta-data/iam/security-credentials/hogehoge \ -H "X-aws-ec2-metadata-token: ${TOKEN}" { "Code" : "Success", "LastUpdated" : "2019-12-08T07:20:38Z", "Type" : "AWS-HMAC", "AccessKeyId" : "*****", "SecretAccessKey" : "******", "Token" : "*****", "Expiration" : "2019-12-08T13:49:31Z" } ヘッダにトークンをつけてアクセスをメタデータサーバにアクセス