Skip to content

feat: add coderd_ai_group_budget resource - #453

Draft
ssncferreira wants to merge 1 commit into
mainfrom
ssncf/ai-group-budget
Draft

ssncferreira wants to merge 1 commit into
mainfrom
ssncf/ai-group-budget

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Oct 12, 2026 •

Copy link
Copy Markdown

Description

Adds the coderd_ai_group_budget resource, which manages the AI spend limit that AI Gateway applies to each member of a group (/api/v2/groups/{group}/ai/budget). coderd_ai_user_budget_override follows in #454.

Changes

  • Add coderd_ai_group_budget with group_id and spend_limit, registered under the "AI Governance" docs subcategory.
  • spend_limit is in integer micro-units, like coderd_ai_model_price, and is validated against codersdk.MaxAISpendLimitMicros at plan time.
  • Import by group ID or <organization-name>/<group-name>, like coderd_group.
  • Add an example, import docs, mock-server plan tests, and an acceptance test.
Decisions
  • Standalone resource instead of an attribute on coderd_group: budgets often target groups that Terraform does not manage (IdP-synced groups, Everyone), and the budget API requires the AI Gateway entitlement while groups do not.
  • Follows coderd_ai_model_price for unmanaged values: the plan fails when the group already has a different budget, and an equal budget is adopted.
  • No computed id, following feat!: remove redundant id from coderd_agents_default_model and coderd_ai_model_price #452. group_id forces replacement.
  • Destroy deletes the budget. A 404 on read removes the resource from state, since Coder deletes the budget with its group.
  • A 404 on upsert means the group does not exist or the deployment is older than v2.34.0, so the error names both.

Related to AIGOV-682

Note

Generated by Coder Agents on behalf of @ssncferreira.

@linear-code

linear-code Bot commented Oct 12, 2026

Copy link
Copy Markdown

AIGOV-682

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.

1 participant