Skip to content

Commit f33a6b5

Browse files
committed
add getting started quickstarts
- Add quickstart for TypeScript/Python with AWS CLI deploy workflow: execution role, package, create-function, publish version, invoke - Add quickstart for container image (Java) with multi-stage Dockerfile, maven-shade-plugin, ECR push, and create-function - Add manage-executions page: list, get, history, stop, update (zip and container image variants), logs, delete including ECR cleanup - Update getting-started index with all new pages - Add quickstart code examples for TypeScript, Python, and Java - Add custom Lambda client configuration page with examples for all three languages - Update sdk-reference index with configuration section - Update nav in zensical.toml with new pages closes #108, closes #107, closes #106, closes #78, closes #60, closes #32
1 parent 5c6f207 commit f33a6b5

25 files changed

Lines changed: 748 additions & 319 deletions
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Development Environment
2+
3+
## Development workflow
4+
5+
```mermaid
6+
flowchart LR
7+
subgraph dev["Development (Local)"]
8+
direction LR
9+
A["1. Write Function"]
10+
B["2. Write Tests"]
11+
C["3. Run Tests"]
12+
end
13+
14+
subgraph prod["Production (AWS)"]
15+
direction LR
16+
D["4. Deploy"]
17+
E["5. Test in Cloud"]
18+
end
19+
20+
A --> B --> C --> D --> E
21+
22+
style dev fill:#e3f2fd
23+
style prod fill:#fff3e0
24+
```
25+

docs/getting-started/index.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@ concepts introduced here.
1515

1616
- [Key Concepts](key-concepts.md) Understand durable execution, checkpoints, replay, and
1717
the DurableContext before writing code
18-
- [Quick Start](quick-start.md) Install the SDK, write your first durable function, and
19-
test it locally
18+
- [Quickstart](quickstart.md) Install the SDK, write your first durable function, and
19+
deploy it with the AWS CLI
20+
- [Quickstart for Container Image](quickstart-container-image.md) Deploy a durable
21+
function in a container image
22+
- [Manage Executions](manage-executions.md) List, inspect, stop, update, and delete
23+
durable functions and executions
24+
- [Development Environment](development-environment.md) Development workflow, SDK
25+
installation, and testing setup
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Manage Executions
2+
3+
Use the AWS CLI to inspect, stop, update, and clean up durable functions and their
4+
executions.
5+
6+
## List executions
7+
8+
```console
9+
aws lambda list-durable-executions-by-function \
10+
--function-name my-durable-function
11+
```
12+
13+
## Get execution details
14+
15+
```console
16+
aws lambda get-durable-execution \
17+
--durable-execution-arn <execution-arn>
18+
```
19+
20+
## Get execution history
21+
22+
View the checkpoint history for an execution:
23+
24+
```console
25+
aws lambda get-durable-execution-history \
26+
--durable-execution-arn <execution-arn>
27+
```
28+
29+
## Stop an execution
30+
31+
```console
32+
aws lambda stop-durable-execution \
33+
--durable-execution-arn <execution-arn>
34+
```
35+
36+
## Update function code
37+
38+
After updating your code, publish a new version and point your alias to it.
39+
40+
=== "Zip (TypeScript/Python)"
41+
42+
```console
43+
aws lambda update-function-code \
44+
--function-name my-durable-function \
45+
--zip-file fileb://function.zip
46+
47+
aws lambda wait function-updated \
48+
--function-name my-durable-function
49+
50+
aws lambda publish-version \
51+
--function-name my-durable-function
52+
53+
aws lambda update-alias \
54+
--function-name my-durable-function \
55+
--name prod \
56+
--function-version <new-version>
57+
```
58+
59+
=== "Container image (Java)"
60+
61+
```console
62+
aws lambda update-function-code \
63+
--function-name my-durable-function \
64+
--image-uri 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-durable-function:latest
65+
66+
aws lambda wait function-updated \
67+
--function-name my-durable-function
68+
69+
aws lambda publish-version \
70+
--function-name my-durable-function
71+
72+
aws lambda update-alias \
73+
--function-name my-durable-function \
74+
--name prod \
75+
--function-version <new-version>
76+
```
77+
78+
Running executions will continue to use the version they started with. New invocations
79+
use the updated alias.
80+
81+
If you're still actively developing and you don't want to publish a new version each
82+
time you update, you could use `LATEST$` just during development, but please be very
83+
aware that executions might not replay correctly (or even fail) if the underlying code
84+
changes during running executions. Always use numbered versions or aliases in
85+
production.
86+
87+
## View logs
88+
89+
```console
90+
aws logs tail /aws/lambda/my-durable-function --follow
91+
```
92+
93+
## Delete durable functions
94+
95+
```console
96+
aws lambda delete-function --function-name my-durable-function
97+
98+
aws iam detach-role-policy \
99+
--role-name durable-function-role \
100+
--policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicDurableExecutionRolePolicy
101+
102+
aws iam delete-role --role-name durable-function-role
103+
```
104+
105+
If you deployed as a container image, also
106+
[delete the image](https://docs.aws.amazon.com/AmazonECR/latest/userguide/delete_image.html)
107+
from ECR:
108+
109+
```console
110+
aws ecr batch-delete-image \
111+
--repository-name my-durable-function \
112+
--image-ids imageTag=latest
113+
```
114+
115+
Replace `latest` with the tag you pushed if you used a different tag. To delete multiple
116+
tags at once, specify each with a separate `imageTag=` argument:
117+
118+
```console
119+
aws ecr batch-delete-image \
120+
--repository-name my-durable-function \
121+
--image-ids imageTag=latest imageTag=v1.0.0
122+
```

0 commit comments

Comments
 (0)