Skip to content

feat(terraform): make model deployments configurable via variable#371

Draft
cmaclaughlin wants to merge 2 commits intomicrosoft:mainfrom
cmaclaughlin:make-model-deploy-variable
Draft

feat(terraform): make model deployments configurable via variable#371
cmaclaughlin wants to merge 2 commits intomicrosoft:mainfrom
cmaclaughlin:make-model-deploy-variable

Conversation

@cmaclaughlin
Copy link
Contributor

@cmaclaughlin cmaclaughlin commented Feb 27, 2026

📥 Pull Request

🔗 Related Issue(s)

Close #370

❓ What are you trying to address

Move model deployment collection out of main.tf and 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_deployments variable, improving flexibility and maintainability. Documentation is updated to reflect this change and provide details about the new variable.

☑️ Checklist

  • 🔍 I have performed a self-review of my own code.
  • 📝 I have commented my code, particularly in hard-to-understand areas.
  • 🧹 I have run the linter and fixed any issues (if applicable).
  • 📄 I have updated the documentation to reflect my changes (if necessary).

Signed-off-by: Cara MacLaughlin <22799195+cmaclaughlin@users.noreply.github.com>
@cmaclaughlin cmaclaughlin linked an issue Feb 27, 2026 that may be closed by this pull request
1 task
Signed-off-by: Cara MacLaughlin <22799195+cmaclaughlin@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_deployments variable (typed list of deployment objects, with defaults) to each Foundry reference architecture.
  • Update each reference architecture to pass var.model_deployments into module "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.

Comment on lines +45 to +50
default = [
{
format = "OpenAI"
name = "gpt-5-chat"
version = "2025-10-03"
},
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +40
type = list(object({
name = string
version = string
format = string
sku = optional(object({
name = string
capacity = number
}), {
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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
}), {

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +44
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
})
}))
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Comment on lines 58 to 61
# 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

Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@cmaclaughlin cmaclaughlin marked this pull request as draft February 27, 2026 18:11
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.

Model Deployments should be a variable

2 participants