Closed miztiik closed 3 years ago
Lambda-Extension-Name
is simply the header key under which you provide the name of your extension. If you look at the registration call to the Extensions API, the header value for that key is your extension's name kept in variable agent_unique_name
:
The agent_unique_name
, is actually set through a contructor in main() using os.path.basename(__file__)
:
That's because the extension name has to match the filename. To summarise:
Thanks for clarification. I was able to get it work after modifying just the main file name and not updating the header key.
Is this variable customizable?
LAMBDA_AGENT_NAME_HEADER_KEY = "Lambda-Extension-Name"
https://github.com/aws-samples/aws-lambda-extensions/blob/main/s3-logs-extension-demo-zip-archive/extensionssrc/extensions/logs_api_http_extension/extensions_api_client.py#L11
or
https://github.com/aws-samples/aws-lambda-extensions/blob/main/python-example-logs-api-extension/extensions/logs_api_http_extension/extensions_api_client.py#L12
When i change this value for example to this,
LAMBDA_AGENT_NAME_HEADER_KEY = "Custom-Lambda-Extension-Name"
I am getting "Failed to register extensionsAPI" errors