Sample for AWS Lambda#784
Conversation
ab48549 to
35487c6
Compare
|
|
||
| You can also copy `lambda-worker/temporal.template.toml` to | ||
| `lambda-worker/temporal.toml`, fill in the connection details, and set | ||
| `TEMPORAL_CONFIG_FILE=lambda-worker/temporal.toml`. The generated file is ignored by Git. |
There was a problem hiding this comment.
I usually think of "generated" files as "machine-generated", so this line confused me
| `TEMPORAL_CONFIG_FILE=lambda-worker/temporal.toml`. The generated file is ignored by Git. | |
| `TEMPORAL_CONFIG_FILE=lambda-worker/temporal.toml`. The `temporal.toml` file is ignored by Git. |
| io.temporal.samples.lambdaworker.LambdaFunction::handleRequest | ||
| ``` | ||
|
|
||
| ## Configure Environment |
There was a problem hiding this comment.
Should this section also explain how to use otel-collector-config.template.yaml?
| - A Temporal Cloud namespace with Serverless Workers enabled, or a self-hosted Temporal | ||
| Service configured for AWS Lambda Serverless Workers |
There was a problem hiding this comment.
| - A Temporal Cloud namespace with Serverless Workers enabled, or a self-hosted Temporal | |
| Service configured for AWS Lambda Serverless Workers | |
| - A Temporal Cloud namespace with Serverless Workers enabled, or a [self-hosted Temporal Service](https://docs.temporal.io/production-deployment/worker-deployments/serverless-workers/self-hosted-setup) | |
| configured for AWS Lambda Serverless Workers |
There was a problem hiding this comment.
Also, don't you require a self-hosted Temporal service regardless to run temporal worker deployment create in README.md:191?
| CloudFormation stacks | ||
| - A Temporal Cloud namespace with Serverless Workers enabled, or a self-hosted Temporal | ||
| Service configured for AWS Lambda Serverless Workers | ||
| - A Temporal Cloud API key. This walkthrough deploys it as a Lambda environment variable |
There was a problem hiding this comment.
| - A Temporal Cloud API key. This walkthrough deploys it as a Lambda environment variable | |
| - A Temporal Cloud API key (if using Temporal Cloud). This walkthrough deploys it as a Lambda environment variable |
| AssumeRolePolicyDocument: | ||
| Version: "2012-10-17" | ||
| Statement: | ||
| - Effect: Allow |
There was a problem hiding this comment.
I didn't run this part myself, but Codex thinks there's an issue:
The README says the tutorial supports either Temporal Cloud or self-hosted Temporal, but the invocation role trusts fixed
Temporal Cloud AWS principals at lambda-worker/deploy/iam-role-for-temporal-lambda-invoke-test.yaml:48. That template will not configure self-hosted Worker Controller credentials. Temporal’s guide explicitly gives self-hosting a separate setup
and requires Temporal Service 1.31.0 or later.
| export FUNCTION_ARN="$( | ||
| aws lambda get-function \ | ||
| --function-name "$FUNCTION_NAME" \ | ||
| --query 'Configuration.FunctionArn' \ | ||
| --output text | ||
| )" |
There was a problem hiding this comment.
FWIW Codex complains here, though I don't understand what it's talking about. In case it's useful to you:
README claims Worker Deployment Versioning but uses mutable Lambda code.
The tutorial obtains an unqualified function ARN at lambda-worker/README.md:151, then associates that with a Temporal Build ID at lambda-worker/README.md:193. The update script later replaces the code behind that same ARN without changing the Build ID.
That undermines the immutability and rollback guarantees readers normally expect from Worker Deployment Versioning. Temporal recommends publishing an immutable Lambda version and assigning its qualified ARN to each distinct Build ID. Unqualified ARNs are acceptable for development, but the tutorial should identify that trade-off explicitly.
What was changed
Added sample for AWS Lambda
Why?
Checklist
Depends on AWS Lambda (Java) sdk-java#2901
Closes
How was this tested:
Deployed a lambda worker to my sandbox AWS account and Temporal cloud.
Any docs updates needed?