Repository navigation
Conversation
Add the experimental temporal-aws-secrets-manager module, an envconfig extension that loads the client API key and mTLS material from AWS Secrets Manager secret IDs, configured in TOML or with TEMPORAL_EXT_AWS_SECRETS_MANAGER_* environment variables. It ports the Go, Python and TypeScript implementations, with the same config, validation, metric names and log messages. Secrets are fetched through the AWS Parameters and Secrets Lambda Extension when it's detected, and otherwise with the AWS SDK for Java 2.x. The AWS SDK is a compile-only dependency that users add when they need it, and only SdkFetcher references it, so the module loads without it. Fetched secrets are cached, refreshed every refresh interval (SECRETS_MANAGER_TTL, default 5 minutes), and fall back to the previous value for up to 24 hours if a refresh fails. The plugin fetches the secrets when service stubs are created. The API key supplier returns the cached key and refreshes it in the background, so requests never wait on a fetch. TLS secrets are combined with the profile's other TLS settings into a new SSL context, since an SslContext can't be extended. Client keys must be PKCS#8, as for envconfig, and a client cert and key that don't match are treated as a failed fetch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Lambda worker now always loads its client config with the AWS Secrets Manager extension, so credentials can be configured as secret IDs with TEMPORAL_EXT_AWS_SECRETS_MANAGER_* environment variables or in temporal.toml. The extension only adds a plugin when secret IDs are configured. Functions without the AWS Parameters and Secrets Lambda Extension need to add software.amazon.awssdk:secretsmanager, since the Lambda Java runtimes don't include the AWS SDK. OtelLambdaWorkerConfigurationHelper now adds its OpenTelemetry plugin before existing service stubs plugins rather than after them, so its metrics scope is already set when the Secrets Manager plugin fetches TLS secrets while the stubs are configured. Before, those fetches reported to a no-op scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What was changed
The temporal-aws-secrets-manager module defines a new envconfig extension to support Temporal client credentials stored in AWS Secrets Manager. The user specifies a secret ARN or friendly name via envconfig (TOML or environment variables), and the client will automatically fetch the secret material from Secrets Manager. Periodic refreshes are only supported for API keys for now, with TLS cert rotation support deferred to later since there's no easy way to do it right now.
The AWS Parameters and Secrets Lambda Extension is used if detected in the environment. Otherwise, secrets are retrieved directly from Secrets Manager.
See the README or module documentation for usage details.
The temporal-aws-lambda module now uses the secretsmanager envconfig extension to support Temporal credentials in AWS Secrets Manager within Lambda workers.
Also see the Go reference implementation:
Why?
The temporal-aws-secrets-manager extension is intended to be used with the Lambda worker contrib package (and in the future other serverless providers), to make it more convenient to store worker secrets in a secrets manager when using serverless. This makes it more convenient to store worker secrets in a secrets manager when using serverless.
Checklist
How was this tested:
Added new unit tests. Also did Claude-assisted E2E verification with a serverless Lambda worker setup configured to read credentials from Secrets Manager (under multiple configurations, including with/without the Lambda extension fetcher, with/without TLS client cert bundling, and using TOML/env vars).
Any docs updates needed?
The associated in-repo docs are updated. This specific module is primarily an implementation detail for the Lambda worker integration with Secrets Manager. We'll probably want to update our public docs for Lambda workers, but that can be done later. We may also want to update the associated sample code in samples-typescript to at least mention this integration as an option.