From c7f7b6e8f3d4ec5e1dd44adf592ea21bc6f8ff25 Mon Sep 17 00:00:00 2001 From: Lei Wilson <305842734+leiwilson@users.noreply.github.com> Date: Mon, 20 Jul 2026 17:18:55 +0100 Subject: [PATCH] docs(metadata): clarify public import path for get_lambda_metadata --- docs/utilities/metadata.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/utilities/metadata.md b/docs/utilities/metadata.md index 4959d81d8c7..434277e1f82 100644 --- a/docs/utilities/metadata.md +++ b/docs/utilities/metadata.md @@ -21,6 +21,17 @@ The Metadata utility allows you to fetch data from the [AWS Lambda Metadata Endp You can fetch data from the Lambda Metadata Endpoint using the `get_lambda_metadata` function. +Import it from `aws_lambda_powertools.utilities.metadata` (the public package path): + +```python +from aws_lambda_powertools.utilities.metadata import get_lambda_metadata +``` + +???+ warning "Import path is `utilities.metadata`" + The correct module path is `aws_lambda_powertools.utilities.metadata`. + + Do **not** import from `aws_lambda_powertools.utilities.lambda_metadata` — that path is not part of the public API (even though the implementation file and `get_lambda_metadata` helper share a similar name). + ???+ tip Metadata is cached for the duration of the Lambda sandbox, so subsequent calls to `get_lambda_metadata` will return the cached data.