Skip to content

Commit c973a80

Browse files
committed
feat: add python SDK examples and CLI tool for managing them
1 parent 09f2eb4 commit c973a80

39 files changed

Lines changed: 1329 additions & 463 deletions

.github/model/lambda.json

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2750,8 +2750,8 @@
27502750
"DurableExecutionName":{"shape":"DurableExecutionName"},
27512751
"FunctionArn":{"shape":"FunctionArn"},
27522752
"Status":{"shape":"ExecutionStatus"},
2753-
"StartDate":{"shape":"ExecutionTimestamp"},
2754-
"StopDate":{"shape":"ExecutionTimestamp"}
2753+
"StartTimestamp":{"shape":"ExecutionTimestamp"},
2754+
"EndTimestamp":{"shape":"ExecutionTimestamp"}
27552755
}
27562756
},
27572757
"ExecutionStatus":{
@@ -3676,7 +3676,6 @@
36763676
},
36773677
"documentation":"<p>Response to GetFunctionConfiguration request.</p>"
36783678
},
3679-
"Integer":{"type":"integer"},
36803679
"InvalidCodeSignatureException":{
36813680
"type":"structure",
36823681
"members":{
@@ -6319,9 +6318,9 @@
63196318
"FunctionArn":{"shape":"FunctionArn"},
63206319
"InputPayload":{"shape":"InputPayload"},
63216320
"Status":{"shape":"ExecutionStatus"},
6322-
"StartDate":{"shape":"ExecutionTimestamp"},
6323-
"StopDate":{"shape":"ExecutionTimestamp"},
6324-
"ResultPayload":{"shape":"ResultPayload"},
6321+
"StartTimestamp":{"shape":"ExecutionTimestamp"},
6322+
"EndTimestamp":{"shape":"ExecutionTimestamp"},
6323+
"Result":{"shape":"ResultPayload"},
63256324
"ErrorPayload":{"shape":"ErrorPayload"}
63266325
}
63276326
},
@@ -6451,12 +6450,6 @@
64516450
"Error":{"shape":"ErrorObject"}
64526451
}
64536452
},
6454-
"WaitCancelledDetails":{
6455-
"type":"structure",
6456-
"members":{
6457-
"Error":{"shape":"EventError"}
6458-
}
6459-
},
64606453
"WaitDetails":{
64616454
"type":"structure",
64626455
"members":{

.github/workflows/deploy-examples.yml

Lines changed: 0 additions & 172 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ dist/
2929
.kiro/
3030
.idea
3131
.env
32+
33+
examples/build/*
34+
examples/*.zip

CONTRIBUTING.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,47 @@ Mimic the package structure in the src/aws_durable_execution_sdk_python director
121121
Name your module so that src/mypackage/mymodule.py has a dedicated unit test file
122122
tests/mypackage/mymodule_test.py
123123

124+
## Examples and Deployment
125+
126+
The project includes a unified CLI tool for managing examples, deployment, and AWS account setup:
127+
128+
### Bootstrap AWS Account
129+
```bash
130+
# Set up IAM role and KMS key for durable functions
131+
export AWS_ACCOUNT_ID=your-account-id
132+
hatch run examples:bootstrap
133+
```
134+
135+
### Build and Deploy Examples
136+
```bash
137+
# Build all examples with dependencies
138+
hatch run examples:build
139+
140+
# Generate SAM template for all examples
141+
hatch run examples:generate-sam
142+
143+
# List available examples
144+
hatch run examples:list
145+
146+
# Deploy specific example (when durable functions are available)
147+
hatch run examples:deploy "Hello World"
148+
```
149+
150+
### Other CLI Commands
151+
```bash
152+
# Invoke deployed function
153+
hatch run examples:invoke function-name --payload '{}'
154+
155+
# Get execution details
156+
hatch run examples:get execution-arn
157+
158+
# Get execution history
159+
hatch run examples:history execution-arn
160+
161+
# Clean build artifacts
162+
hatch run examples:clean
163+
```
164+
124165
## Coverage
125166
```
126167
hatch run test:cov

examples/.env.template

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/README.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

examples/build.py

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)