Skip to content

feat(coderd_ai_provider): expose server-generated Bedrock external_id#382

Merged
ethanndickson merged 1 commit into
mainfrom
ethan/bedrock-external-id
Jul 9, 2026
Merged

feat(coderd_ai_provider): expose server-generated Bedrock external_id#382
ethanndickson merged 1 commit into
mainfrom
ethan/bedrock-external-id

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Jul 6, 2026

Copy link
Copy Markdown
Member

coder/coder#26869 added a server-generated STS external ID to Bedrock AI provider settings: when role_arn is set, the server generates an ID and sends it on every AssumeRole call, so operators can require it in the role's trust policy via an sts:ExternalId condition (the standard confused-deputy mitigation). This exposes it on coderd_ai_provider as a read-only settings.bedrock.external_id attribute, so the trust policy can reference it in the same Terraform config that manages the provider.

Design notes:

  • The value is never sent outbound (the server rejects client-supplied values on create and non-matching values on update), only read back into state; empty responses from servers predating #26869 map to null, so the attribute works against both old and new coderd with no version gating.
  • A custom plan modifier preserves a stored ID (the server carries it forward even if role_arn is later cleared), plans unknown while role_arn is set or unknown, and pins null otherwise. UseStateForUnknown would be wrong here per the "computed value derived from mutable config" anti-pattern: the empty-to-set role_arn transition would produce "inconsistent result after apply".

Builds on #381 (SDK bump). Follows up #372 (role_arn).

Closes AIGOV-504

ethanndickson commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

@ethanndickson ethanndickson force-pushed the ethan/bedrock-external-id branch from b83f8f5 to 5a64dd6 Compare July 6, 2026 14:20
@ethanndickson ethanndickson force-pushed the ethan/bump-coder-sdk branch from 6c79a69 to 96ee5a8 Compare July 6, 2026 14:20
@ethanndickson ethanndickson force-pushed the ethan/bedrock-external-id branch from 5a64dd6 to 5115b2e Compare July 7, 2026 02:30
@ethanndickson ethanndickson force-pushed the ethan/bump-coder-sdk branch from 96ee5a8 to 3064f9c Compare July 7, 2026 02:30
@ethanndickson ethanndickson force-pushed the ethan/bedrock-external-id branch from 5115b2e to c11b48c Compare July 7, 2026 03:01
@ethanndickson ethanndickson force-pushed the ethan/bump-coder-sdk branch 2 times, most recently from 5ad0b47 to 624a890 Compare July 7, 2026 03:04
@ethanndickson ethanndickson force-pushed the ethan/bedrock-external-id branch 2 times, most recently from 74c2545 to 3eb783b Compare July 7, 2026 03:07
@ethanndickson ethanndickson force-pushed the ethan/bump-coder-sdk branch from 624a890 to 9d3295e Compare July 7, 2026 03:07
@ethanndickson ethanndickson marked this pull request as ready for review July 7, 2026 03:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3eb783b42d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/provider/ai_provider_resource.go
@linear-code

linear-code Bot commented Jul 7, 2026

Copy link
Copy Markdown

AIGOV-504

@ethanndickson ethanndickson force-pushed the ethan/bedrock-external-id branch 2 times, most recently from 3cc5c6b to d10c7c7 Compare July 7, 2026 03:38
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

re: Preserve null external IDs from unsupported servers

Added a test case to prove this is a non-issue

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: d10c7c7e63

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ethanndickson ethanndickson force-pushed the ethan/bedrock-external-id branch from d10c7c7 to 1991453 Compare July 7, 2026 03:52
@ethanndickson ethanndickson self-assigned this Jul 7, 2026
@ethanndickson ethanndickson changed the base branch from ethan/bump-coder-sdk to graphite-base/382 July 8, 2026 07:59
@ethanndickson ethanndickson force-pushed the ethan/bedrock-external-id branch from 1991453 to 4c53540 Compare July 8, 2026 07:59
@graphite-app graphite-app Bot changed the base branch from graphite-base/382 to main July 8, 2026 07:59
@ethanndickson ethanndickson force-pushed the ethan/bedrock-external-id branch from 4c53540 to 7482cff Compare July 8, 2026 07:59
@ethanndickson ethanndickson merged commit 9d887a6 into main Jul 9, 2026
26 of 27 checks passed
@ethanndickson ethanndickson deleted the ethan/bedrock-external-id branch July 9, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants