This guide covers V2 OIDC tokens. For new integrations, see the AWS OIDC V3 guide, which uses the current token format with flat claims and customizable sub fields. V2 tokens remain fully supported.
ona CLI generates a JWT token with claims about the environment and owner, which AWS exchanges for an STS token associated with an IAM role you configure.
Step 1: Create an AWS identity provider
Create an OIDC identity provider in AWS to establish trust with Ona:- Provider URL:
https://app.gitpod.io - Audience:
sts.amazonaws.com
View the OIDC configuration at
https://app.gitpod.io/.well-known/openid-configurationStep 2: Create an IAM role with a trust policy
Create an IAM role that Ona environments can assume. Use JWT claims to restrict which environments can assume the role.Follow the principle of least privilege - only allow relevant environments and users to assume your role.
Inspect claims by running
ona idp token --decode --audience sts.amazonaws.com in an environment. Note the sub claim contains organization, project, and environment IDs.app.gitpod.io) plus the claim (:aud, :sub, etc.):
Allow all environments in an organization:
Step 3: Assume the role
Requires AWS CLI installed in your environment.
ona idp login aws to assume the role and update your AWS credentials file:
--duration-secondssets token expiry (default: 3600 seconds, longer sessions require AWS admin approval)
assume-role-with-web-identity in AWS docs.
FAQ
What AWS resources can I access?
Any resource accessible via AWS CLI or SDK works in Ona, provided your IAM role has the required permissions. The STS token you receive can access EC2, EKS, S3, RDS, and more.How fine-grained is access control?
Access depends entirely on the policies attached to your assumed IAM role. Configure permissions in AWS IAM as you would for any other OIDC-based access.Troubleshooting
Useona idp token --decode --audience sts.amazonaws.com to print your environment JWT token. Ensure that any claims against the sub match the trust policy in AWS.