-
Notifications
You must be signed in to change notification settings - Fork 7
add getting started quickstarts #109
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
Merged
Merged
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Development Environment | ||
|
|
||
| ## Development workflow | ||
|
|
||
| ```mermaid | ||
| flowchart LR | ||
| subgraph dev["Development (Local)"] | ||
| direction LR | ||
| A["1. Write Function"] | ||
| B["2. Write Tests"] | ||
| C["3. Run Tests"] | ||
| end | ||
|
|
||
| subgraph prod["Production (AWS)"] | ||
| direction LR | ||
| D["4. Deploy"] | ||
| E["5. Test in Cloud"] | ||
| end | ||
|
|
||
| A --> B --> C --> D --> E | ||
|
|
||
| style dev fill:#e3f2fd | ||
| style prod fill:#fff3e0 | ||
| ``` | ||
|
|
||
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 |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| # Manage Executions | ||
|
yaythomas marked this conversation as resolved.
|
||
|
|
||
| Use the AWS CLI to inspect, stop, update, and clean up durable functions and their | ||
| executions. | ||
|
|
||
| ## List executions | ||
|
|
||
| ```console | ||
| aws lambda list-durable-executions-by-function \ | ||
| --function-name my-durable-function | ||
| ``` | ||
|
|
||
| ## Get execution details | ||
|
|
||
| ```console | ||
| aws lambda get-durable-execution \ | ||
| --durable-execution-arn <execution-arn> | ||
| ``` | ||
|
|
||
| ## Get execution history | ||
|
|
||
| View the checkpoint history for an execution: | ||
|
|
||
| ```console | ||
| aws lambda get-durable-execution-history \ | ||
| --durable-execution-arn <execution-arn> | ||
| ``` | ||
|
|
||
| ## Stop an execution | ||
|
|
||
| ```console | ||
| aws lambda stop-durable-execution \ | ||
| --durable-execution-arn <execution-arn> | ||
| ``` | ||
|
|
||
| ## Update function code | ||
|
|
||
| After updating your code, publish a new version and point your alias to it. | ||
|
|
||
| === "Zip (TypeScript/Python)" | ||
|
|
||
| ```console | ||
| aws lambda update-function-code \ | ||
| --function-name my-durable-function \ | ||
| --zip-file fileb://function.zip | ||
|
|
||
| aws lambda wait function-updated \ | ||
| --function-name my-durable-function | ||
|
|
||
| aws lambda publish-version \ | ||
| --function-name my-durable-function | ||
|
|
||
| aws lambda update-alias \ | ||
| --function-name my-durable-function \ | ||
| --name prod \ | ||
| --function-version <new-version> | ||
| ``` | ||
|
|
||
| === "Container image (Java)" | ||
|
yaythomas marked this conversation as resolved.
|
||
|
|
||
| ```console | ||
| aws lambda update-function-code \ | ||
| --function-name my-durable-function \ | ||
| --image-uri 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-durable-function:latest | ||
|
|
||
| aws lambda wait function-updated \ | ||
| --function-name my-durable-function | ||
|
|
||
| aws lambda publish-version \ | ||
| --function-name my-durable-function | ||
|
|
||
| aws lambda update-alias \ | ||
| --function-name my-durable-function \ | ||
| --name prod \ | ||
| --function-version <new-version> | ||
| ``` | ||
|
|
||
| Running executions will continue to use the version they started with. New invocations | ||
| use the updated alias. | ||
|
|
||
| If you're still actively developing and you don't want to publish a new version each | ||
| time you update, you could use `LATEST$` just during development, but please be very | ||
| aware that executions might not replay correctly (or even fail) if the underlying code | ||
| changes during running executions. Always use numbered versions or aliases in | ||
| production. | ||
|
|
||
| ## View logs | ||
|
|
||
| ```console | ||
| aws logs tail /aws/lambda/my-durable-function --follow | ||
| ``` | ||
|
|
||
| ## Delete durable functions | ||
|
|
||
| ```console | ||
| aws lambda delete-function --function-name my-durable-function | ||
|
|
||
| aws iam detach-role-policy \ | ||
| --role-name durable-function-role \ | ||
| --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicDurableExecutionRolePolicy | ||
|
|
||
| aws iam delete-role --role-name durable-function-role | ||
| ``` | ||
|
|
||
| If you deployed as a container image, also | ||
| [delete the image](https://docs.aws.amazon.com/AmazonECR/latest/userguide/delete_image.html) | ||
| from ECR: | ||
|
|
||
| ```console | ||
| aws ecr batch-delete-image \ | ||
| --repository-name my-durable-function \ | ||
| --image-ids imageTag=latest | ||
| ``` | ||
|
|
||
| Replace `latest` with the tag you pushed if you used a different tag. To delete multiple | ||
| tags at once, specify each with a separate `imageTag=` argument: | ||
|
|
||
| ```console | ||
| aws ecr batch-delete-image \ | ||
| --repository-name my-durable-function \ | ||
| --image-ids imageTag=latest imageTag=v1.0.0 | ||
| ``` | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.