Skip to content

Sample for AWS Lambda#784

Open
eamsden wants to merge 6 commits into
mainfrom
ea/aws-lambda
Open

Sample for AWS Lambda#784
eamsden wants to merge 6 commits into
mainfrom
ea/aws-lambda

Conversation

@eamsden

@eamsden eamsden commented Jun 15, 2026

Copy link
Copy Markdown

What was changed

Added sample for AWS Lambda

Why?

Checklist

  1. Depends on AWS Lambda (Java) sdk-java#2901

  2. Closes

  3. How was this tested:
    Deployed a lambda worker to my sandbox AWS account and Temporal cloud.

  4. Any docs updates needed?

@eamsden
eamsden requested review from a team, antmendoza and tsurdilo as code owners June 15, 2026 22:50
@eamsden eamsden changed the title Ea/aws lambda Sample for AWS Lambda Jun 15, 2026
@eamsden
eamsden force-pushed the ea/aws-lambda branch 2 times, most recently from ab48549 to 35487c6 Compare July 13, 2026 20:28
@dplyukhin dplyukhin self-assigned this Jul 21, 2026
Comment thread lambda-worker/README.md

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I usually think of "generated" files as "machine-generated", so this line confused me

Suggested change
`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.

Comment thread lambda-worker/README.md
io.temporal.samples.lambdaworker.LambdaFunction::handleRequest
```

## Configure Environment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should this section also explain how to use otel-collector-config.template.yaml?

Comment thread lambda-worker/README.md
Comment on lines +18 to +19
- A Temporal Cloud namespace with Serverless Workers enabled, or a self-hosted Temporal
Service configured for AWS Lambda Serverless Workers

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
- 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Also, don't you require a self-hosted Temporal service regardless to run temporal worker deployment create in README.md:191?

Comment thread lambda-worker/README.md
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
- 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread lambda-worker/README.md
Comment on lines +151 to +156
export FUNCTION_ARN="$(
aws lambda get-function \
--function-name "$FUNCTION_NAME" \
--query 'Configuration.FunctionArn' \
--output text
)"

@dplyukhin dplyukhin Jul 21, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants