Repository navigation
Description
Bug Report
Description
Terraform recipe deployment fails during terraform get (module download) with Missing required argument for the context variable. This is a regression — the same recipe and configuration worked on a previous Radius version.
Steps to Reproduce
- Register a Terraform recipe that declares a required
contextvariable (no default value):
variable "context" {
description = "This variable contains Radius recipe context."
type = any
}-
Deploy a resource that uses this recipe (e.g.
Radius.Resources/aiModels) -
Deployment fails with:
Error: Missing required argument
on main.tf.json line 8, in module.default:
8: }
The argument "context" is required, but no definition was found.
Root Cause Analysis
The Terraform recipe execution flow in pkg/recipes/terraform/execute.go (generateConfig) is:
getTerraformConfig— writesmain.tf.jsonwith only the module source and explicit parameters (e.g.location,resource_group_name). Thecontextvariable is NOT included yet.downloadAndInspect→ callstf.Get(ctx)(terraform get) to download the moduleinspectModule— checks ifContextVarExistsin the downloaded moduleAddRecipeContext— injectscontextinto the configtfConfig.Save— re-saves the config withcontextincludedinitAndApply— runsterraform init+terraform apply
The problem is that Terraform v1.15.2 (bundled in the dynamic-rp:0.57 container) now performs strict validation of required module arguments during terraform get (step 2). Since context has not been added to main.tf.json yet at that point, validation fails.
In prior Radius versions, the bundled Terraform binary did not validate required arguments during terraform get, so the 2-phase approach (download first, inject context later) worked fine.
Environment
- Radius version: v0.57.0
- Terraform version (inside dynamic-rp container): v1.15.2
- Resource type:
Radius.Resources/aiModels@2025-07-14-preview - Recipe source:
git::https://github.com/reshrahim/todoapp-ai.git//recipes/azure-openai
Expected Behavior
Terraform recipe deployment should succeed. The context variable should either be:
- Pre-populated with a placeholder value in
main.tf.jsonbeforeterraform get, or - The
terraform getstep should be performed without module argument validation
Actual Behavior
terraform get fails with Missing required argument because context is not yet present in main.tf.json.
Workaround
Add default = {} to the context variable in the recipe:
variable "context" {
description = "This variable contains Radius recipe context."
type = any
default = {}
}This allows terraform get to succeed without the value, and Radius injects the real value before terraform apply.
Activity
radius-triage commentedon May 12, 2026
👋 @willtsai Thanks for filing this bug report.
A project maintainer will review this report and get back to you soon. If you'd like immediate help troubleshooting, please visit our Discord server.
For more information on our triage process please visit our triage overview
willtsai commentedon May 13, 2026
this is fixed as a part of #11779 which was patched into v0.57.1