diff --git a/aws_xray_sdk/core/plugins/ec2_plugin.py b/aws_xray_sdk/core/plugins/ec2_plugin.py index 69c8c19e..763be1fc 100644 --- a/aws_xray_sdk/core/plugins/ec2_plugin.py +++ b/aws_xray_sdk/core/plugins/ec2_plugin.py @@ -28,6 +28,10 @@ def initialize(): def get_token(): + """ + Get the session token for IMDSv2 endpoint valid for 60 seconds + by specifying the X-aws-ec2-metadata-token-ttl-seconds header. + """ token = None try: headers = {"X-aws-ec2-metadata-token-ttl-seconds": "60"}