Skip to main content
AWS
Tembo acts as an OIDC identity provider. Agents request short-lived STS credentials on demand from any session or automation in your workspace — no long-lived AWS access keys are stored in Tembo. Connecting an account takes two things: an OIDC provider and an IAM role in your AWS account. You can let Tembo’s CloudFormation template create both, or create them yourself with your own tooling.

What agents can do

Once connected, agents can run AWS CLI commands and programs that use an AWS SDK. Each enabled integration can be configured as a standard AWS profile inside the agent sandbox. Agents can list the accounts available to your workspace:
They select an account when running each command:
The selector can be the integration’s environment label, generated profile name, AWS account ID, or integration ID. If two integrations use the same label or AWS account ID, use the generated profile name shown by tembo aws profiles. The exec command authenticates on demand and limits the selected profile to its child process. This makes it safe to use different AWS accounts concurrently in one session without changing ambient credentials. Agents can only do what the IAM role permits. The default is ReadOnlyAccess; you control this entirely.

Before you start

You need permission to create IAM roles and identity providers in the target AWS account.
Connect as many AWS accounts as you like. Every enabled AWS integration is available to every session and automation in your workspace; it does not have to be assigned when a session starts. The agent explicitly selects an account for each command.

Choose a setup method

Use the CloudFormation template

Fastest path. Tembo gives you a template that creates the OIDC provider and role for you.

Create the resources yourself

Use your own Terraform, CDK, Pulumi, or the AWS CLI. Full requirements below.
Both produce identical results. Tembo only needs the finished role ARN.

Option 1: Use the CloudFormation template

1

Open the connect modal

Go to Integrations and click Connect next to AWS. Enter a name for this account, for example production.
2

Deploy the stack

Click Create via CloudFormation to open a pre-filled stack in your AWS console, then deploy it.If that link returns “Access Denied”, download the template from the connect modal and upload it manually instead: in the CloudFormation console, choose Create stack → With new resources → Upload a template file, then supply your workspace ID when prompted.
3

Copy the role ARN

When the stack completes, open its Outputs tab and copy the RoleArn value.
4

Finish in Tembo

Back in the connect modal, switch to Enter ARN manually, paste the ARN, and click Connect.

Option 2: Create the resources yourself

Create two resources in the AWS account you want to connect, then hand Tembo the role ARN.

Find your workspace ID

The role’s trust policy has to name the workspace allowed to assume it. In Tembo, go to Settings → Workspace and copy the value under Workspace ID. The value starts with org_, because a workspace is an organization internally. That’s why the trust policy’s subject is org: followed by this value.

Requirements

Three details are easy to get wrong:
  • The provider must live in the same AWS account as the role. AWS resolves the federated principal locally when the role is assumed, so a provider in another account will not work.
  • The condition keys drop the scheme. They are internal.tembo.io:sub, not https://internal.tembo.io:sub.
  • The subject is prefixed. If your workspace ID is org_2vyf1Ja..., the sub value is org:org_2vyf1Ja... — the literal string org: followed by the full ID.
Always pin the sub condition to your workspace ID. The OIDC provider only proves that Tembo signed the token, not which workspace it was issued for. Without the sub condition, a token issued to any other Tembo workspace would satisfy your trust policy.

The OIDC provider

Register https://internal.tembo.io as an IAM OIDC identity provider with sts.amazonaws.com as the only audience. You only need one per AWS account. IAM identity providers are global, so if you manage infrastructure per-region, create it once rather than once per region. If the provider already exists in the account, reuse it instead of creating a second one. Thumbprints do not need maintaining. AWS verifies the JWKS endpoint’s TLS certificate against its own library of trusted root certificate authorities, and only falls back to the configured thumbprint if the certificate is not signed by one of those. Tembo’s endpoint uses a publicly trusted certificate, so a placeholder value of forty zeroes is fine.

The IAM role

Attach this trust policy, replacing the account ID and workspace ID:
Trust policy
Then attach permissions. Start with arn:aws:iam::aws:policy/ReadOnlyAccess and narrow or widen it to suit. Set the role’s maximum session duration to 3600 seconds to match the session length Tembo requests. The role name does not matter — Tembo identifies the role by ARN.

Terraform

AWS CLI

Connect it

Paste the role ARN into the Tembo connect modal under Enter ARN manually and click Connect.
Self-hosted Tembo: replace internal.tembo.io throughout with your instance’s TEMBO_OIDC_ISSUER hostname, scheme stripped. Your instance must serve /.well-known/openid-configuration and /.well-known/jwks.json over public HTTPS, because AWS STS fetches the JWKS itself when a role is assumed — reachability from inside your own network is not enough.

How authentication works

Tembo never stores long-lived AWS credentials. Authentication begins only when an agent uses an AWS integration:
  1. The agent lists the enabled AWS integrations in your workspace and explicitly selects one for a command.
  2. Tembo configures standard AWS profiles that use a credential helper. No static access keys are written to the AWS config.
  3. When the selected profile needs credentials, Tembo mints a short-lived RS256 JWT (5-minute TTL) signed with its OIDC private key. It carries an iss of the Tembo issuer, an aud of sts.amazonaws.com, and a sub of org:<your-workspace-id>.
  4. Tembo calls sts:AssumeRoleWithWebIdentity against the selected role. This call carries no AWS credentials of its own — the token is the identity.
  5. STS finds the OIDC provider in your account, verifies the JWT with Tembo’s public JWKS, evaluates your trust policy, and returns temporary credentials with a 1-hour TTL.
  6. The credential helper caches those temporary credentials in the sandbox and refreshes them when needed while the sandbox or authorized runtime remains active and the integration remains enabled.
The selected profile is scoped to the child process and does not become the sandbox’s default AWS identity. Because the OIDC token is the identity, nothing about this depends on which AWS account Tembo runs in.

Troubleshooting

Work through these in order:
  1. Provider URL exact match. It must be https://internal.tembo.io — correct scheme, no trailing slash, no typos. STS matches the token’s iss claim against the registered provider URL exactly.
  2. Provider is in the same account as the role. A provider in a different account is not usable.
  3. sub includes the org: prefix. The value is org:org_2vyf1Ja..., not org_2vyf1Ja....
  4. Condition keys have no scheme. internal.tembo.io:sub, not https://internal.tembo.io:sub.
  5. Workspace ID matches. Compare against the value under Workspace ID in Settings → Workspace.
The workspace does not have an enabled AWS integration. Connect one from Settings → Integrations, then retry the command. Sessions and automations that do not use AWS continue to work normally.
List the enabled profiles again and use the generated profile name or integration ID. Environment labels and AWS account IDs are convenient selectors, but they may match more than one integration.
Credentials refresh while the sandbox or authorized runtime remains active and the integration remains enabled. Refresh fails closed if the runtime is no longer authorized or the AWS integration is disabled, removed, or no longer belongs to the workspace.
During authentication, the sandbox credential helper contacts the Tembo API, and the Tembo API calls AWS STS. On self-hosted deployments in a private network, confirm that:
  • The Tembo API or control plane has outbound HTTPS access to AWS STS.
  • The agent sandbox has outbound HTTPS access to the AWS service endpoints used by the child command.
  • The agent sandbox only needs access to AWS STS when the child command itself calls STS.
The role’s policies decide what agents can do, and ReadOnlyAccess is read-only by design. To allow writes, attach additional policies to the role. Note that ReadOnlyAccess does grant s3:Get*, so agents can read object contents — attach an explicit Deny if you need to keep specific buckets out of reach.
Some AWS features encrypt data with a customer-managed KMS key and require the caller to hold kms:Decrypt on that key. ReadOnlyAccess does not grant kms:Decrypt. Add a scoped statement to the role for the specific key, ideally conditioned on kms:ViaService so it is only usable through the owning service.