-
Notifications
You must be signed in to change notification settings - Fork 11
docs: add C# (.NET) SDK as a first-class language #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GarrettBeatty
wants to merge
9
commits into
aws:main
Choose a base branch
from
GarrettBeatty:dotnet
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1fbc712
docs: add C# (.NET) SDK tabs to SDK reference
GarrettBeatty 1fec6ee
docs: make C# a first-class language across getting-started, patterns…
GarrettBeatty c1a82d5
docs: add C# tabs to testing API reference; refine C# quickstart deploy
GarrettBeatty 0a2abb9
docs: add C# to SDK-reference language list and manage-executions zip…
GarrettBeatty 80c04ee
docs: drop C# SDK preview note and net8/net10 targets line
GarrettBeatty 8c37a1e
docs: simplify C# programming-models section; drop version-specific d…
GarrettBeatty 8a97bf9
docs: state C# serializer behavior positively in serialization section
GarrettBeatty a2f7eae
test: add one-command C# doc verification driver
GarrettBeatty 66e73f0
docs: hardcode --runtime dotnet10 in the C# quickstart CLI command
GarrettBeatty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
|
|
||
|
|
@@ -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 | ||
|
|
@@ -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. | ||
|
|
||
|
|
@@ -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 \ | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| --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 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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