feat(coderd_ai_provider): add Bedrock role_arn for cross-account assume-role#372
Open
ethanndickson wants to merge 1 commit into
Open
feat(coderd_ai_provider): add Bedrock role_arn for cross-account assume-role#372ethanndickson wants to merge 1 commit into
ethanndickson wants to merge 1 commit into
Conversation
This was referenced Jun 26, 2026
Member
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| - `credentials_wo_version` (Number) Version for Bedrock write-only credentials. Bump this value to send, rotate, or clear credentials. | ||
| - `model` (String) Primary Bedrock model identifier. | ||
| - `region` (String) AWS region for Bedrock. If omitted, derived from the canonical Bedrock `base_url` attribute. | ||
| - `role_arn` (String) ARN of an AWS IAM role to assume via STS before calling Bedrock. The base identity (the AWS SDK default credential chain or the write-only credentials) signs the AssumeRole call, and the temporary credentials sign Bedrock requests. Enables cross-account Bedrock by pointing each provider at a role in the target account. Omit to call Bedrock with the base identity directly. |
There was a problem hiding this comment.
Few nits:
- We use the term
static credentialsinstead ofwrite-only credentials, although the latter may make sense in the context of Terraform. - "Enables cross-account Bedrock by pointing each provider at a role in the target account." — I think this is too specific. Cross-account access is just one use case. Customers can configure any IAM role they want, including a role in the same AWS account. Docs: https://coder.com/docs/@main/ai-coder/ai-gateway/providers#amazon-bedrock
| small_fast_model = "anthropic.claude-3-5-haiku-20241022-v1:0" | ||
| // Optional: assume an IAM role via STS before calling Bedrock. Point each | ||
| // provider at a role in the target account for cross-account Bedrock billing. |
There was a problem hiding this comment.
nit:
cross-account Bedrock billing— again, this is too specific.RoleARNsimply instructs AI Gateway to assume the specified IAM role. It has no notion of whether the role is cross-account, used for billing, or any other particular use case.
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.

Background
A customer running AWS Bedrock needs runtime IAM role assumption across multiple AWS accounts so usage bills to the correct account: a pod starts with its ambient AWS identity (IRSA / EKS Pod Identity / instance profile), then assumes a downstream role in another account via STS before calling Bedrock, with temp credentials cached and rotated by the AWS SDK. Static keys are not acceptable, and the base identity alone is insufficient since it's shared across providers.
This gap (AIGOV-371) was fixed server-side in coder/coder#26527 (backend: assume a configured role ARN via STS before calling Bedrock; cross-account is just the role's trust policy, and multiple accounts means multiple providers) and coder/coder#26578 (web UI follow-up). The only piece reaching this provider is one new
role_arnfield oncodersdk.AIProviderBedrockSettings, plus server-side ARN validation. Everything else lives inaibridge/coderd/cli/ UI, which this provider doesn't import.What this PR does
Adds an optional
role_arntocoderd_ai_provider'ssettings.bedrockblock so the cross-account workflow is configurable via Terraform, not only the UI. Several roles means several providers; omitting it preserves today's behavior. Also updates the example and regeneratesdocs/.SDK bump
role_arnisn't in any taggedcodersdkrelease yet (latest v2.34.3 predates it), sogo.modis pinned to a pseudo-version of the coder/coder#26527 merge commit; re-pin to a real tag once one ships.Closes CODAGT-607. Refs AIGOV-371. Refs coder/coder#26527, coder/coder#26578.