File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1111 * @see https://docs.aws.amazon.com/de_de/lambda/latest/dg/runtimes-api.html
1212 */
1313class RunLambda {
14- const TRACE_ID = 'Root=1-5bef4de7-ad49b0e87f6ef6c87fc2e700;Parent=9a9197af755a6419;Sampled=1 ' ;
14+ const TRACE = 'Root=1-5bef4de7-ad49b0e87f6ef6c87fc2e700;Parent=9a9197af755a6419;Sampled=1 ' ;
15+ const REGION = 'test-local-1 ' ;
1516
1617 private $ impl , $ events ;
1718
@@ -30,7 +31,7 @@ public function __construct($handler= 'Handler', ... $events) {
3031 /** Runs this command */
3132 public function run (): int {
3233 $ name = $ this ->impl ->getSimpleName ();
33- $ region = getenv ('AWS_REGION ' ) ?: ' test-local-1 ' ;
34+ $ region = getenv ('AWS_REGION ' ) ?: self :: REGION ;
3435 $ functionArn = "arn:aws:lambda: {$ region }:123456789012:function: {$ name }" ;
3536 $ deadlineMs = (time () + 900 ) * 1000 ;
3637 $ environment = $ _ENV + ['AWS_LAMBDA_FUNCTION_NAME ' => $ name , 'AWS_REGION ' => $ region ];
@@ -48,7 +49,7 @@ public function run(): int {
4849 $ headers = [
4950 'Lambda-Runtime-Aws-Request-Id ' => [UUID ::randomUUID ()->hashCode ()],
5051 'Lambda-Runtime-Invoked-Function-Arn ' => [$ functionArn ],
51- 'Lambda-Runtime-Trace-Id ' => [self ::TRACE_ID ],
52+ 'Lambda-Runtime-Trace-Id ' => [self ::TRACE ],
5253 'Lambda-Runtime-Deadline-Ms ' => [$ deadlineMs ],
5354 'Content-Length ' => [strlen ($ event )],
5455 ];
You can’t perform that action at this time.
0 commit comments