Skip to content

Commit 7d4903a

Browse files
authored
cli: pull durable execution history (#17)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. ### Issue Link, if available ### Description Updating the integration test workflow to pull the execution history events for the example. We'll use this in a subsequent change to assert the example has the expected history. ### Demo/Screenshots See GitHub action. ### Checklist - [X] I have filled out every section of the PR template - [X] I have thoroughly tested this change
1 parent 147682d commit 7d4903a

File tree

2 files changed

+252
-0
lines changed

2 files changed

+252
-0
lines changed

.github/model/lambda.json

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,22 @@
475475
],
476476
"documentation":"<p>Returns details about a Lambda function URL.</p>"
477477
},
478+
"GetDurableExecutionHistory":{
479+
"name":"GetDurableExecutionHistory",
480+
"http":{
481+
"method":"GET",
482+
"requestUri":"/2025-12-01/durable-executions/{DurableExecutionArn}/history",
483+
"responseCode":200
484+
},
485+
"input":{"shape":"GetDurableExecutionHistoryRequest"},
486+
"output":{"shape":"GetDurableExecutionHistoryResponse"},
487+
"errors":[
488+
{"shape":"InvalidParameterValueException"},
489+
{"shape":"TooManyRequestsException"},
490+
{"shape":"ServiceException"},
491+
{"shape":"ResourceNotFoundException"}
492+
]
493+
},
478494
"GetLayerVersion":{
479495
"name":"GetLayerVersion",
480496
"http":{
@@ -667,6 +683,21 @@
667683
],
668684
"documentation":"<p>Lists event source mappings. Specify an <code>EventSourceArn</code> to show only event source mappings for a single event source.</p>"
669685
},
686+
"ListDurableExecutions":{
687+
"name":"ListDurableExecutions",
688+
"http":{
689+
"method":"GET",
690+
"requestUri":"/2025-12-01/durable-executions",
691+
"responseCode":200
692+
},
693+
"input":{"shape":"ListDurableExecutionsRequest"},
694+
"output":{"shape":"ListDurableExecutionsResponse"},
695+
"errors":[
696+
{"shape":"InvalidParameterValueException"},
697+
{"shape":"TooManyRequestsException"},
698+
{"shape":"ServiceException"}
699+
]
700+
},
670701
"ListFunctionEventInvokeConfigs":{
671702
"name":"ListFunctionEventInvokeConfigs",
672703
"http":{
@@ -2096,6 +2127,21 @@
20962127
},
20972128
"documentation":"<p>A configuration object that specifies the destination of an event after Lambda processes it.</p>"
20982129
},
2130+
"DurableExecutionArn":{
2131+
"type":"string",
2132+
"max":1024,
2133+
"min":1
2134+
},
2135+
"DurableExecutionName":{
2136+
"type":"string",
2137+
"max":64,
2138+
"min":1,
2139+
"pattern":"[a-zA-Z0-9-_]+"
2140+
},
2141+
"DurableExecutions":{
2142+
"type":"list",
2143+
"member":{"shape":"Execution"}
2144+
},
20992145
"EC2AccessDeniedException":{
21002146
"type":"structure",
21012147
"members":{
@@ -2394,6 +2440,53 @@
23942440
"min":0,
23952441
"pattern":"[a-zA-Z0-9._\\-]+"
23962442
},
2443+
"Event":{
2444+
"type":"structure",
2445+
"members":{
2446+
"EventType":{"shape":"EventType"},
2447+
"EventId":{"shape":"EventId"},
2448+
"EventTimestamp":{"shape":"ExecutionTimestamp"}
2449+
}
2450+
},
2451+
"EventId":{
2452+
"type":"integer",
2453+
"box":true,
2454+
"min":1
2455+
},
2456+
"Events":{
2457+
"type":"list",
2458+
"member":{"shape":"Event"}
2459+
},
2460+
"EventType":{
2461+
"type":"string",
2462+
"enum":[
2463+
"ExecutionStarted",
2464+
"ExecutionSucceeded",
2465+
"ExecutionFailed"
2466+
]
2467+
},
2468+
"Execution":{
2469+
"type":"structure",
2470+
"members":{
2471+
"DurableExecutionArn":{"shape":"DurableExecutionArn"},
2472+
"DurableExecutionName":{"shape":"DurableExecutionName"},
2473+
"FunctionArn":{"shape":"FunctionArn"},
2474+
"Status":{"shape":"ExecutionStatus"},
2475+
"StartDate":{"shape":"ExecutionTimestamp"},
2476+
"StopDate":{"shape":"ExecutionTimestamp"}
2477+
}
2478+
},
2479+
"ExecutionStatus":{
2480+
"type":"string",
2481+
"enum":[
2482+
"RUNNING",
2483+
"SUCCEEDED",
2484+
"FAILED",
2485+
"TIMED_OUT",
2486+
"STOPPED"
2487+
]
2488+
},
2489+
"ExecutionTimestamp":{"type":"timestamp"},
23972490
"FileSystemArn":{
23982491
"type":"string",
23992492
"max":200,
@@ -2829,6 +2922,44 @@
28292922
}
28302923
}
28312924
},
2925+
"GetDurableExecutionHistoryRequest":{
2926+
"type":"structure",
2927+
"required":["DurableExecutionArn"],
2928+
"members":{
2929+
"DurableExecutionArn":{
2930+
"shape":"DurableExecutionArn",
2931+
"location":"uri",
2932+
"locationName":"DurableExecutionArn"
2933+
},
2934+
"IncludeExecutionData":{
2935+
"shape":"IncludeExecutionData",
2936+
"location":"querystring",
2937+
"locationName":"IncludeExecutionData"
2938+
},
2939+
"MaxItems":{
2940+
"shape":"ItemCount",
2941+
"location":"querystring",
2942+
"locationName":"MaxItems"
2943+
},
2944+
"Marker":{
2945+
"shape":"PaginationMarker",
2946+
"location":"querystring",
2947+
"locationName":"Marker"
2948+
},
2949+
"ReverseOrder":{
2950+
"shape":"ReverseOrder",
2951+
"location":"querystring",
2952+
"locationName":"ReverseOrder"
2953+
}
2954+
}
2955+
},
2956+
"GetDurableExecutionHistoryResponse":{
2957+
"type":"structure",
2958+
"members":{
2959+
"Events":{"shape":"Events"},
2960+
"NextMarker":{"shape":"PaginationMarker"}
2961+
}
2962+
},
28322963
"GetFunctionCodeSigningConfigRequest":{
28332964
"type":"structure",
28342965
"required":["FunctionName"],
@@ -3525,6 +3656,15 @@
35253656
"InvalidImage"
35263657
]
35273658
},
3659+
"IncludeExecutionData":{
3660+
"type":"boolean",
3661+
"box":true
3662+
},
3663+
"Integer":{"type":"integer"},
3664+
"ItemCount":{
3665+
"type":"integer",
3666+
"min":0
3667+
},
35283668
"Layer":{
35293669
"type":"structure",
35303670
"members":{
@@ -3768,6 +3908,68 @@
37683908
}
37693909
}
37703910
},
3911+
"ListDurableExecutionsRequest":{
3912+
"type":"structure",
3913+
"members":{
3914+
"FunctionName":{
3915+
"shape":"FunctionName",
3916+
"location":"querystring",
3917+
"locationName":"FunctionName"
3918+
},
3919+
"FunctionVersion":{
3920+
"shape":"Version",
3921+
"location":"querystring",
3922+
"locationName":"FunctionVersion"
3923+
},
3924+
"DurableExecutionName":{
3925+
"shape":"DurableExecutionName",
3926+
"location":"querystring",
3927+
"locationName":"DurableExecutionName"
3928+
},
3929+
"StatusFilter":{
3930+
"shape":"ExecutionStatus",
3931+
"location":"querystring",
3932+
"locationName":"StatusFilter"
3933+
},
3934+
"TimeFilter":{
3935+
"shape":"TimeFilter",
3936+
"location":"querystring",
3937+
"locationName":"TimeFilter"
3938+
},
3939+
"TimeAfter":{
3940+
"shape":"ExecutionTimestamp",
3941+
"location":"querystring",
3942+
"locationName":"TimeAfter"
3943+
},
3944+
"TimeBefore":{
3945+
"shape":"ExecutionTimestamp",
3946+
"location":"querystring",
3947+
"locationName":"TimeBefore"
3948+
},
3949+
"ReverseOrder":{
3950+
"shape":"ReverseOrder",
3951+
"location":"querystring",
3952+
"locationName":"ReverseOrder"
3953+
},
3954+
"Marker":{
3955+
"shape":"PaginationMarker",
3956+
"location":"querystring",
3957+
"locationName":"Marker"
3958+
},
3959+
"MaxItems":{
3960+
"shape":"ItemCount",
3961+
"location":"querystring",
3962+
"locationName":"MaxItems"
3963+
}
3964+
}
3965+
},
3966+
"ListDurableExecutionsResponse":{
3967+
"type":"structure",
3968+
"members":{
3969+
"DurableExecutions":{"shape":"DurableExecutions"},
3970+
"NextMarker":{"shape":"PaginationMarker"}
3971+
}
3972+
},
37713973
"ListEventSourceMappingsRequest":{
37723974
"type":"structure",
37733975
"members":{
@@ -4284,6 +4486,11 @@
42844486
"min":1,
42854487
"pattern":".*"
42864488
},
4489+
"PaginationMarker":{
4490+
"type":"string",
4491+
"max":1024,
4492+
"min":1
4493+
},
42874494
"PackageType":{
42884495
"type":"string",
42894496
"enum":[
@@ -4797,6 +5004,10 @@
47975004
"type":"string",
47985005
"pattern":"arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+"
47995006
},
5007+
"ReverseOrder":{
5008+
"type":"boolean",
5009+
"box":true
5010+
},
48005011
"Runtime":{
48015012
"type":"string",
48025013
"enum":[
@@ -5025,6 +5236,13 @@
50255236
"CallerRateLimitExceeded"
50265237
]
50275238
},
5239+
"TimeFilter":{
5240+
"type":"string",
5241+
"enum":[
5242+
"START",
5243+
"END"
5244+
]
5245+
},
50285246
"Timeout":{
50295247
"type":"integer",
50305248
"min":1

.github/workflows/integration-tests.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,40 @@ jobs:
188188
echo "Response:"
189189
cat /tmp/response.json
190190
191+
- name: Find Durable Execution - ${{ matrix.example.name }}
192+
env:
193+
LAMBDA_ENDPOINT: ${{ secrets.LAMBDA_ENDPOINT }}
194+
run: |
195+
echo "Listing durable executions for function: $FUNCTION_NAME"
196+
aws lambda list-durable-executions \
197+
--function-name "$FUNCTION_NAME" \
198+
--region "${{ env.AWS_REGION }}" \
199+
--endpoint-url "$LAMBDA_ENDPOINT" \
200+
--cli-binary-format raw-in-base64-out \
201+
--status-filter SUCCEEDED \
202+
> /tmp/executions.json
203+
echo "Durable Executions:"
204+
cat /tmp/executions.json
205+
206+
# Extract the first execution ARN for history retrieval
207+
EXECUTION_ARN=$(jq -r '.DurableExecutions[0].DurableExecutionArn // empty' /tmp/executions.json)
208+
echo "EXECUTION_ARN=$EXECUTION_ARN" >> $GITHUB_ENV
209+
210+
- name: Get Durable Execution History - ${{ matrix.example.name }}
211+
if: env.EXECUTION_ARN != ''
212+
env:
213+
LAMBDA_ENDPOINT: ${{ secrets.LAMBDA_ENDPOINT }}
214+
run: |
215+
echo "Getting execution history for: $EXECUTION_ARN"
216+
aws lambda get-durable-execution-history \
217+
--durable-execution-arn "$EXECUTION_ARN" \
218+
--region "${{ env.AWS_REGION }}" \
219+
--endpoint-url "$LAMBDA_ENDPOINT" \
220+
--cli-binary-format raw-in-base64-out \
221+
> /tmp/history.json
222+
echo "Execution History:"
223+
cat /tmp/history.json
224+
191225
- name: Cleanup Lambda function
192226
if: always()
193227
env:

0 commit comments

Comments
 (0)