Skip to content

Commit 1294dee

Browse files
authored
Adding doc description to EC2 plugin (#294)
Adding description about IMDSv2 session token timeout header
1 parent 48b2d08 commit 1294dee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

aws_xray_sdk/core/plugins/ec2_plugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ def initialize():
2828

2929

3030
def get_token():
31+
"""
32+
Get the session token for IMDSv2 endpoint valid for 60 seconds
33+
by specifying the X-aws-ec2-metadata-token-ttl-seconds header.
34+
"""
3135
token = None
3236
try:
3337
headers = {"X-aws-ec2-metadata-token-ttl-seconds": "60"}

0 commit comments

Comments
 (0)