feat(terraform): make model deployments configurable via variable#371
feat(terraform): make model deployments configurable via variable#371cmaclaughlin wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Signed-off-by: Cara MacLaughlin <22799195+cmaclaughlin@users.noreply.github.com>
Signed-off-by: Cara MacLaughlin <22799195+cmaclaughlin@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR makes the set of Azure AI Foundry model deployments configurable in the Foundry reference architectures by introducing a model_deployments variable and wiring it into the ai_foundry module calls, with corresponding terraform-docs README updates.
Changes:
- Add a
model_deploymentsvariable (typed list of deployment objects, with defaults) to each Foundry reference architecture. - Update each reference architecture to pass
var.model_deploymentsintomodule "ai_foundry". - Regenerate README terraform-docs sections to document the new input.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| reference_architectures/foundry_standard_private/variables.tf | Adds model_deployments variable with type/defaults. |
| reference_architectures/foundry_standard_private/main.tf | Switches ai_foundry.model_deployments to var.model_deployments. |
| reference_architectures/foundry_standard_private/README.md | Updates autogenerated Inputs table to include model_deployments. |
| reference_architectures/foundry_standard/variables.tf | Adds model_deployments variable with type/defaults. |
| reference_architectures/foundry_standard/main.tf | Switches ai_foundry.model_deployments to var.model_deployments. |
| reference_architectures/foundry_standard/README.md | Updates autogenerated Inputs table to include model_deployments. |
| reference_architectures/foundry_basic_private/variables.tf | Adds model_deployments variable with type/defaults. |
| reference_architectures/foundry_basic_private/main.tf | Switches ai_foundry.model_deployments to var.model_deployments. |
| reference_architectures/foundry_basic_private/README.md | Updates autogenerated Inputs table to include model_deployments. |
| reference_architectures/foundry_basic/variables.tf | Adds model_deployments variable with type/defaults. |
| reference_architectures/foundry_basic/main.tf | Switches ai_foundry.model_deployments to var.model_deployments. |
| reference_architectures/foundry_basic/README.md | Updates autogenerated Inputs table to include model_deployments. |
| default = [ | ||
| { | ||
| format = "OpenAI" | ||
| name = "gpt-5-chat" | ||
| version = "2025-10-03" | ||
| }, |
There was a problem hiding this comment.
The default model list here changes behavior vs the previous hard-coded deployments: it now deploys gpt-5-chat (2025-10-03) instead of the previously configured gpt-5.2-chat (2025-12-11). If the goal is only to make deployments configurable (without changing defaults), update the default entry to match the prior model/version (and apply consistently across the other reference architectures updated in this PR).
| type = list(object({ | ||
| name = string | ||
| version = string | ||
| format = string | ||
| sku = optional(object({ | ||
| name = string | ||
| capacity = number | ||
| }), { |
There was a problem hiding this comment.
This new variable block doesn’t appear to be terraform fmt-ed (e.g., type = isn’t aligned like other attributes in the file). Please run terraform fmt (or update spacing/order to match surrounding conventions) before merging to avoid formatting churn across these duplicated blocks.
| type = list(object({ | |
| name = string | |
| version = string | |
| format = string | |
| sku = optional(object({ | |
| name = string | |
| capacity = number | |
| }), { | |
| type = list(object({ | |
| name = string | |
| version = string | |
| format = string | |
| sku = optional(object({ | |
| name = string | |
| capacity = number | |
| }), { |
| variable "model_deployments" { | ||
| description = "The list of model deployments to create in AI Foundry." | ||
| type = list(object({ | ||
| name = string | ||
| version = string | ||
| format = string | ||
| sku = optional(object({ | ||
| name = string | ||
| capacity = number | ||
| }), { | ||
| name = "GlobalStandard" | ||
| capacity = 50 | ||
| }) | ||
| })) |
There was a problem hiding this comment.
Consider adding validation to model_deployments to catch common misconfiguration early (e.g., unique deployment names, non-empty strings, and sku.capacity > 0). Repo Terraform standards call out adding validation in reference architectures when constraints are known (.github/guidance/terraform/terraform-standards.md around the reference-architecture conventions).
| # Model deployments to make available within Foundry | ||
| # Add/remove models as needed for your workload requirements | ||
| model_deployments = [ | ||
| module.common_models.gpt_5_2_chat, | ||
| module.common_models.gpt_5_nano, | ||
| module.common_models.text_embedding_3_large, | ||
| module.common_models.gpt_4o_mini | ||
| ] | ||
| model_deployments = var.model_deployments | ||
|
|
There was a problem hiding this comment.
With model_deployments = var.model_deployments, the common_models module in this stack is now unused (it’s only declared, never referenced). Suggest either removing the module "common_models" block (and letting terraform-docs drop it from the README), or re-introducing it via a local.default_model_deployments fallback so model versions stay centrally maintained while still allowing overrides.
📥 Pull Request
🔗 Related Issue(s)
Close #370
❓ What are you trying to address
Move model deployment collection out of
main.tfand into variables.✨ Description of new changes
This pull request updates the AI Foundry reference architectures to make the list of model deployments configurable through a new variable. Instead of hardcoding the models, the deployments are now controlled via the
model_deploymentsvariable, improving flexibility and maintainability. Documentation is updated to reflect this change and provide details about the new variable.☑️ Checklist