Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ __pycache__/
# MkDocs build output
site/

# .NET build output (from the throwaway C# example compile-check harness)
[Bb]in/
[Oo]bj/

# OS files
.DS_Store
Thumbs.db
Expand All @@ -20,3 +24,6 @@ Thumbs.db
*~
.vscode/
.idea/

# C# example compile-check scratch dir
.verify/
37 changes: 27 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Common commands:

1. Create the markdown file in `docs/`
2. Add the page to the nav section in `zensical.toml`
3. Create corresponding code examples in all three languages under `examples/`
3. Create corresponding code examples in all four languages under `examples/`
4. Test locally with `zensical serve`

## Vendored dependencies
Expand Down Expand Up @@ -152,14 +152,14 @@ Edit documentation in the markdown files under `docs/`.

Embed code samples in documentation pages with the `--8<--` snippet syntax with content tabs for multi-language support.

**IMPORTANT**: All code examples MUST include all three languages (Python, TypeScript, Java) and remain functionally equivalent across languages. The tab order must always be TypeScript → Python → Java.
**IMPORTANT**: All code examples MUST include all four languages (TypeScript, Python, Java, C#) and remain functionally equivalent across languages. The tab order must always be TypeScript → Python → Java → C#.

#### Steps to add a new code sample:

1. Create example files under `examples/` following the page folder hierarchy
2. Use identical names with hyphens across all languages (e.g., `retry-with-backoff.{py,ts,java}`)
2. Use identical names with hyphens across all languages (e.g., `retry-with-backoff.{ts,py,java,cs}`)
3. Organize by language: `examples/{language}/{section}/{subsection}/{example-name}.{ext}`
4. Ensure all three language versions demonstrate the same functionality
4. Ensure all four language versions demonstrate the same functionality
5. Reference the examples in your documentation using content tabs:

```markdown
Expand All @@ -180,6 +180,12 @@ Embed code samples in documentation pages with the `--8<--` snippet syntax with
```java
--8<-- "examples/java/core/steps/basic-step.java"
```

=== "C#"

```csharp
--8<-- "examples/csharp/core/steps/basic-step.cs"
```
```

#### Example structure:
Expand Down Expand Up @@ -207,17 +213,28 @@ examples/
│ └── advanced/
│ └── error-handling/
│ └── retry-with-backoff.py
└── java/
├── java/
│ ├── getting-started/
│ │ └── minimal-example.java
│ ├── core/
│ │ ├── steps/
│ │ │ └── basic-step.java
│ │ └── parallel/
│ │ └── parallel-execution.java
│ └── advanced/
│ └── error-handling/
│ └── retry-with-backoff.java
└── csharp/
├── getting-started/
│ └── minimal-example.java
│ └── minimal-example.cs
├── core/
│ ├── steps/
│ │ └── basic-step.java
│ │ └── basic-step.cs
│ └── parallel/
│ └── parallel-execution.java
│ └── parallel-execution.cs
└── advanced/
└── error-handling/
└── retry-with-backoff.java
└── retry-with-backoff.cs
```

This approach keeps code samples maintainable, testable, and consistent across all languages.
Expand Down Expand Up @@ -247,7 +264,7 @@ Example:
```
add custom serdes examples

- Add TypeScript, Python, and Java examples for custom
- Add TypeScript, Python, Java, and C# examples for custom
serialization
- Include encryption-at-rest pattern for sensitive data
- Update serialization doc page with snippet references
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The `docs/` directory contains the Markdown source files that power the
documentation site.

Code examples are in `examples/`, organized by language
(`typescript/`, `python/`, `java/`) and mirroring the docs folder hierarchy.
(`typescript/`, `python/`, `java/`, `csharp/`) and mirroring the docs folder hierarchy.

Examples are embedded into documentation pages using snippet syntax — see the
[Contributing Guide](CONTRIBUTING.md) for details.
Expand Down Expand Up @@ -63,6 +63,7 @@ for details.
- [JavaScript SDK Repository](https://github.com/aws/aws-durable-execution-sdk-js)
- [Python SDK Repository](https://github.com/aws/aws-durable-execution-sdk-python)
- [Java SDK Repository](https://github.com/aws/aws-durable-execution-sdk-java)
- [C# SDK Repository](https://github.com/aws/aws-lambda-dotnet/tree/master/Libraries/src/Amazon.Lambda.DurableExecution)

## Feedback & Support

Expand Down
50 changes: 38 additions & 12 deletions authoring-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
This guide covers how to author documentation for AWS Lambda Durable Functions.
For setup and contribution workflow, see [CONTRIBUTING.md](CONTRIBUTING.md).

Each SDK reference page must be equally useful to TypeScript, Python, and Java
developers. No language is the implicit default. Language-specific quirks
Each SDK reference page must be equally useful to TypeScript, Python, Java, and
C# developers. No language is the implicit default. Language-specific quirks
belong inside the relevant tab, not in shared prose.

## Verify Against SDK Source
Expand All @@ -26,23 +26,29 @@ For each code example:

### SDK repositories

You will need the SDK source for all three languages. Clone them alongside
You will need the SDK source for all four languages. Clone them alongside
the docs repo:

| Repository | Source path to read |
|---|---|
| [aws-durable-execution-sdk-js](https://github.com/aws/aws-durable-execution-sdk-js) | `packages/aws-durable-execution-sdk-js/src` |
| [aws-durable-execution-sdk-python](https://github.com/aws/aws-durable-execution-sdk-python) | `src/aws_durable_execution_sdk_python` |
| [aws-durable-execution-sdk-java](https://github.com/aws/aws-durable-execution-sdk-java) | `sdk/src/main/java/software/amazon/lambda/durable` |
| [aws-lambda-dotnet](https://github.com/aws/aws-lambda-dotnet) | `Libraries/src/Amazon.Lambda.DurableExecution` |

Testing SDKs are useful for confirming example code compiles and runs. The
JavaScript and Java testing SDKs live in the same repos as the main SDKs
(under `-testing` package paths). The Python testing SDK lives in a separate
repo:
JavaScript, Java, and C# testing SDKs live in the same repos as the main SDKs
(under `-testing` package paths, or `Amazon.Lambda.DurableExecution.Testing`
for C#). The Python testing SDK lives in a separate repo:

| Repository | Source path to read |
|---|---|
| [aws-durable-execution-sdk-python-testing](https://github.com/aws/aws-durable-execution-sdk-python-testing) | `src/aws_durable_execution_sdk_python_testing` |
| [aws-lambda-dotnet](https://github.com/aws/aws-lambda-dotnet) | `Libraries/src/Amazon.Lambda.DurableExecution.Testing` |

The C# examples have a local compile-check harness under `scripts/csharp-verify/`

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will remove this comment before merging

that builds each example against the SDK DLLs. See that directory's project files
and `verify.sh`. It is not part of CI.


### Key source files
Expand All @@ -53,6 +59,10 @@ repo:
`StepConfig` and `StepSemantics`. Check `types.py` for `StepContext`.
- **Java**: `DurableContext.java` for the interface. Check
`config/StepConfig.java`, `StepContext.java`, `StepSemantics.java`.
- **C#**: `IDurableContext.cs` for the interface (also defines `IStepContext`,
`IExecutionContext`). Check `StepConfig.cs`, `RetryStrategy.cs` (also holds
`StepSemantics` and `JitterStrategy`), `DurableFunction.cs` for `WrapAsync`, and
the per-operation config types (`CallbackConfig.cs`, `MapConfig.cs`, etc.).

## Writing Style

Expand Down Expand Up @@ -149,7 +159,7 @@ as a whole new page can.

## Language Neutrality

Tab order is always: **TypeScript → Python → Java**.
Tab order is always: **TypeScript → Python → Java → C#**.

If a language has a quirk, note it inside that language's tab:

Expand Down Expand Up @@ -177,6 +187,14 @@ If a language has a quirk, note it inside that language's tab:
```java
--8<-- "examples/java/operations/steps/basic-step.java"
```

=== "C#"

The name is optional. Omit it to infer one from the call site.

```csharp
--8<-- "examples/csharp/operations/steps/basic-step.cs"
```
```

## Page Structure
Expand All @@ -185,7 +203,7 @@ SDK reference pages follow this pattern:

1. One or two short paragraphs explaining what the operation does and when
to use it
2. A minimal walkthrough example (tabs, all three languages)
2. A minimal walkthrough example (tabs, all four languages)
3. Method signature section with per-language tabs
4. Parameters listed after the tabs (shared where identical, inside tabs
where language-specific)
Expand Down Expand Up @@ -269,7 +287,7 @@ Model tone and structure on these pages:

All code examples must:

- Include all three languages (TypeScript, Python, Java)
- Include all four languages (TypeScript, Python, Java, C#)
- Be functionally equivalent across languages
- Include necessary imports
- Be minimal. Show the concept, not a full application.
Expand All @@ -283,9 +301,10 @@ examples/
typescript/{section}/{subsection}/{example-name}.ts
python/{section}/{subsection}/{example-name}.py
java/{section}/{subsection}/{example-name}.java
csharp/{section}/{subsection}/{example-name}.cs
```

Use hyphens in filenames. All three languages must have the same set of files.
Use hyphens in filenames. All four languages must have the same set of files.

### Embedding in Docs

Expand All @@ -309,6 +328,12 @@ Use the `--8<--` snippet syntax with content tabs:
```java
--8<-- "examples/java/operations/steps/basic-step.java"
```

=== "C#"

```csharp
--8<-- "examples/csharp/operations/steps/basic-step.cs"
```
```

### Method Signatures
Expand Down Expand Up @@ -411,12 +436,13 @@ graph LR
- [ ] All prose is language-neutral (no Python-only concepts described as universal)
- [ ] No Table of Contents, no "Back to top" links, no "Back to X" links
- [ ] No Terminology, Key Features, Best Practices, or FAQ sections
- [ ] Tab order is TypeScript → Python → Java everywhere
- [ ] Tab order is TypeScript → Python → Java → C# everywhere
- [ ] Language-specific notes are inside tabs, not outside
- [ ] All three languages have example files for every `--8<--` reference
- [ ] All four languages have example files for every `--8<--` reference
- [ ] Every example verified against the actual SDK source
- [ ] Java method signatures show both sync and async variants
- [ ] TypeScript signatures show both overloads where they exist
- [ ] C# examples compile via `scripts/csharp-verify/verify.sh`
- [ ] No emdash, no hyphen-as-dash
- [ ] No passive voice
- [ ] Updates are revisions, not tacked-on additions
Expand Down
12 changes: 12 additions & 0 deletions docs/getting-started/key-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ Your durable function receives a `DurableContext` instead of the default Lambda
--8<-- "examples/java/getting-started/durable-context.java"
```

=== "C#"

```csharp
--8<-- "examples/csharp/getting-started/durable-context.cs"
```

## Operations

Operations are units of work in a durable execution. Each operation type serves a
Expand Down Expand Up @@ -172,6 +178,12 @@ Let's trace through a simple workflow:
--8<-- "examples/java/getting-started/execution-model.java"
```

=== "C#"

```csharp
--8<-- "examples/csharp/getting-started/execution-model.cs"
```

**First invocation (t=0s):**

1. You start a durable execution by invoking a durable function
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/manage-executions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ aws lambda stop-durable-execution \

After updating your code, publish a new version and point your alias to it.

=== "Zip (TypeScript/Python)"
=== "Zip (TypeScript/Python/C#)"

```console
aws lambda update-function-code \
Expand Down
43 changes: 42 additions & 1 deletion docs/getting-started/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Quickstart

Create and deploy your first durable function using the AWS CLI. This guide covers
TypeScript, Python, and Java.
TypeScript, Python, Java, and C#.

!!! note "Adding all your dependencies to the deployment package"

Expand All @@ -28,6 +28,10 @@ TypeScript, Python, and Java.

- Java 17+ and Maven 3.8+

=== "C#"

- .NET 10 SDK

## Create the execution role

Create an IAM role that grants your function permission to perform checkpoint
Expand Down Expand Up @@ -93,6 +97,18 @@ Note the role ARN returned. You'll need it in the next step.
--8<-- "examples/java/getting-started/quickstart.java"
```

=== "C#"

Save as `Function.cs`

```csharp
--8<-- "examples/csharp/getting-started/quickstart.cs"
```

This shows the workflow and handler. For the entry point (`Main` +
`LambdaBootstrap` + serializer), the class-library alternative, and the full
project setup, see the [C# SDK guide](../sdk-reference/languages/csharp/index.md).

The wait here is for 10 seconds just for an easy quick example, but it could as easily
be 10 days without incurring extra compute.

Expand Down Expand Up @@ -190,6 +206,31 @@ execution role you just created.
--durable-config '{"ExecutionTimeout": 900, "RetentionPeriodInDays": 1}'
```

=== "C#"

Add the SDK to your project, then publish and package the output:

```console
dotnet add package Amazon.Lambda.DurableExecution

dotnet publish -c Release -o publish
cd publish && zip -r ../function.zip . && cd ..

aws lambda create-function \

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wasnt sure if we wanted to have the dotnet specific tooling here. e.g. https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/lambda-cli-publish.html for now i kept it using the aws cli to be consistent. what do other think?

--function-name my-durable-function \
--runtime dotnet10 \
--role arn:aws:iam::123456789012:role/durable-function-role \
--handler MyDurableFunction \
--zip-file fileb://function.zip \
--durable-config '{"ExecutionTimeout": 900, "RetentionPeriodInDays": 1}'
```

The `--handler` value depends on your programming model: the assembly name for
the executable model, or `Assembly::Namespace.Type::Method` for a class library.
See the
[C# SDK guide](../sdk-reference/languages/csharp/index.md) for the programming
models, serializer registration, and handler string for each.

### Publish a version

You must invoke a durable functions with a published version or alias to ensure
Expand Down
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
!!! note

This guide covers the **AWS Durable Execution SDK**, the client library you use to write
durable functions in TypeScript, Python, and Java. For service-level topics including
durable functions in TypeScript, Python, Java, and C#. For service-level topics including
IAM permissions, service quotas, infrastructure-as-code configuration, and monitoring,
see
[Lambda durable functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html)
Expand Down Expand Up @@ -60,6 +60,8 @@ For detailed programming language reference, see [SDK Reference](sdk-reference/)
[aws-durable-execution-sdk-python](https://github.com/aws/aws-durable-execution-sdk-python)
- :simple-github:
[aws-durable-execution-sdk-java](https://github.com/aws/aws-durable-execution-sdk-java)
- :simple-github:
[aws-lambda-dotnet (C#)](https://github.com/aws/aws-lambda-dotnet/tree/master/Libraries/src/Amazon.Lambda.DurableExecution)

## Related documentation

Expand Down
Loading