Open
Description
Description:
When executing sam local start-api
command with an APIGateway and a Lambda Proxy Integration SAM injects a payload where the requestTimeEpoch
context variable is injected as epoch seconds. However, according to the AWS documentation This value should be passed in with millisecond resolution
Steps to reproduce:
- Create a cloudformation template with an ApiGatewa + Lambda Proxy integration which logs the event.
- Start the API with
sam local start-api
- Take a look at the logged event
Observed result:
The event contains requestTimeEpoch
with unit seconds
Example event payload:
Expected result:
The event contains requestTimeEpoch
with unit milliseconds
Example event payload:
{
// ... other properties
"requestContext": {
// ... other properties
"requestTime": "13/May/2025:18:26:58 +0000",
"requestTimeEpoch": 1747160818000
}
}
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: macOS-15.4.1-arm64-arm-64bit-Mach-O
sam --version
: SAM CLI, version 1.138.0- AWS region: us-east-1
{
"version": "1.138.0",
"system": {
"python": "3.13.3",
"os": "macOS-15.4.1-arm64-arm-64bit-Mach-O"
},
"additional_dependencies": {
"docker_engine": "28.1.1",
"aws_cdk": "Not available",
"terraform": "Not available"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_PACKAGE_PERFORMANCE",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}
Add --debug flag to command you are running