Workload identity
AWS workloads
Use an AWS role to obtain short-lived access to one Bulgur environment.
Before you start
Use Bulgur CLI or Node SDK 1.3.0 or newer, a Bulgur Cloud project and workload identity policy, and a workload running with credentials for its IAM role in a commercial AWS region. The CLI was verified with a real AWS token against a local Bulgur API; SDK tests used synthetic fixtures. Hosted Bulgur Cloud has not been tested end to end.
This setup requires changes in your AWS account. Enable federation and grant permissions only when you are ready to use them.
Prepare AWS
Enable outbound identity federation in AWS IAM and copy the account-specific issuer URL from IAM account settings. Give the workload role permission to call sts:GetWebIdentityToken, scoped to the Bulgur audience and a maximum token duration of 300 seconds. Use a regional STS endpoint; AWS does not support this operation on the global STS endpoint.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "sts:GetWebIdentityToken",
"Resource": "*",
"Condition": {
"ForAllValues:StringEquals": { "sts:IdentityTokenAudience": "https://api.bulgur.dev" },
"NumericLessThanEquals": { "sts:DurationSeconds": 300 }
}
}]
}Create a Bulgur identity
In organization settings, create an AWS STS workload identity. Enter the exact AWS issuer, 12-digit account ID, and commercial IAM role ARN, including its path. Wildcards are not supported. Select one project and one non-Shared environment; its inherited Shared values are included.
The identity trusts the exact role ARN, not an immutable role ID. Deleting and recreating a role with the same ARN remains trusted. Editing or disabling the policy invalidates existing workload sessions.
Run with the CLI
Use Bulgur CLI 1.3.0 or newer, or build it from source. In the AWS workload, supply credentials for the configured role through the standard AWS credential chain, set a commercial AWS region, and use the identity ID shown in the dashboard.
npm install -g bulgur@^1.3.0
export AWS_REGION=us-east-1
export BULGUR_AUTH=aws-oidc
export BULGUR_IDENTITY_ID="YOUR_IDENTITY_ID"
bulgur run -- ./start.sh
# Or write a private dotenv file:
bulgur pull --out .env --yesBulgur requests a five-minute RS256 token for its fixed audience without tags. The resulting runtime session can read only the selected environment's effective values. The child process retains the AWS credentials it already inherited; the AWS identity token is not passed to it.
Use the Node SDK
The server-side SDK requires Bulgur 1.3.0 or newer, Node.js 20 or newer, and the optional @aws-sdk/client-sts peer (^3.1163.0). Install them with npm install bulgur@^1.3.0 @aws-sdk/client-sts@^3.1163.0. loadValues returns a request-local object without changing process.env; omit a DSN to use the policy-bound target.
const { loadValues } = require("bulgur");
async function main() {
const secrets = await loadValues({
auth: "aws-oidc",
identityId: "YOUR_IDENTITY_ID",
});
// Use secrets in your application.
}
main().catch(() => {
console.error("Could not load secrets");
process.exitCode = 1;
});AWS mode uses the AWS SDK default credential and region chain. Authentication failures are not suppressed by optional mode and never fall back to token credentials.
Troubleshooting
If the token request fails, check that outbound identity federation is enabled, the active credentials belong to the configured role, its policy permits sts:GetWebIdentityToken for the Bulgur audience, and a commercial region is set. AWS root credentials cannot assume IAM roles.
If exchange is denied, compare the exact issuer, account ID and full role ARN, including its path, with the Bulgur policy. A policy change or disablement revokes existing Bulgur sessions; a new session requires a policy that matches the current role.