You finally wired your Temporal workflows, only to realize every task that needs a database connection or API token now wants a secret too. Hardcoding them feels wrong, fetching them manually feels ancient, and building your own rotation logic feels like you signed up for part-time ops work. AWS Secrets Manager was made for this problem, you just need to teach Temporal how to trust it.
At their core, these two tools solve opposite halves of the same riddle. AWS Secrets Manager is a vault. It stores, encrypts, and rotates credentials under AWS IAM’s fine-grained control. Temporal orchestrates workflows, orchestrating long-running tasks with durable state and retries. Together, they let distributed jobs access secrets securely without leaking them in logs or code.
When Temporal calls an activity that requires credentials, you can intercept that request using a worker-side helper that fetches secrets from AWS Secrets Manager. The pattern is simple: authenticate the worker through IAM, retrieve the secret only when needed, use it in memory, then discard. No plain-text environment variables, no stale credentials in containers, no shared config files floating through CI.
The key integration logic sits between identity and lifecycle. IAM roles grant Temporal workers access to specific secrets ARNs. Temporal workflows call those secrets at runtime through a reusable client. If you are running Temporal in Kubernetes, map service accounts to IAM roles using IRSA so pods never handle static keys. AWS rotates the secrets automatically, and your Temporal code always sees the updated version.
Quick answer: To connect AWS Secrets Manager with Temporal, give your Temporal workers an IAM identity that can read only the required secrets, use the AWS SDK to fetch them dynamically inside an activity, and rely on AWS rotation policies to keep credentials fresh.