Skip to content

Declare property defaults so unset optional properties have a value - #260

Open
AzureMike wants to merge 1 commit into
mainfrom
feat/declare-property-defaults
Open

Declare property defaults so unset optional properties have a value#260
AzureMike wants to merge 1 commit into
mainfrom
feat/declare-property-defaults

Conversation

@AzureMike

@AzureMike AzureMike commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Several resource types promise a default in prose without declaring one, and size is the case in radius-project/radius#12532 — "Defaults to S if not provided" is English in a description: field, and nothing reads it. This declares the real thing: size on redisCaches and postgreSqlDatabases, version and database on mySqlDatabases, and database on postgreSqlDatabases.

neo4jDatabases is left alone, since its documented default is the resource name and a static default: can't express that.

Reason for change

Deploying one of these resources without setting the optional property puts a literal {{context.resource.properties.size}} expression into the ARM request, because there's nothing for the recipe to substitute. Declaring the default is half the fix. The other half is radius-project/radius#12563, which makes a declared default: actually get applied — until that ships, nothing here changes behavior, which is why the two are separate and this one goes first.

mySqlDatabases version defaults to 8.4, which is what the AWS Terraform recipe (Data/mySqlDatabases/recipes/aws/terraform/main.tf:31) and the Kubernetes Bicep recipe already fall back to when version is unset. Declaring 8.0 instead would have downgraded both, and a running RDS instance rejects a major version downgrade outright.

Related to radius-project/radius#12532

How to test

Each declared default matches what the recipes already do when the property is unset, so the intended result is no change for anyone who was relying on the existing fallback:

Type Property Declared Matches
redisCaches size S the size == "S" branch of the Azure pack, which the description already documented
postgreSqlDatabases size S same
postgreSqlDatabases database postgres_db the value its description already documented
mySqlDatabases database mysql_db the value its description already documented
mySqlDatabases version 8.4 try(var.version, "8.4") in the AWS recipe and ?? '8.4' in the Kubernetes recipe

With radius-project/radius#12563 applied, an unset size resolves to Balanced_B0 on Redis and Standard_B1ms / Burstable on PostgreSQL, and an unset database resolves to postgres_db and mysql_db.

File change summary

File Summary of change
Data/redisCaches/redisCaches.yaml Declare default: 'S' on size.
Data/postgreSqlDatabases/postgreSqlDatabases.yaml Declare default: 'S' on size and default: postgres_db on database.
Data/mySqlDatabases/mySqlDatabases.yaml Declare default: mysql_db on database and default: '8.4' on version, and reword the version description from "Assumed to be 8.4" to match the other optional properties.

Several resource types documented a default in prose without declaring it, and
the ones that did declare a default had no effect because Radius never
materialized them. Declare the missing keys so they take effect alongside
radius-project/radius schema defaulting.

Added: size on redisCaches and postgreSqlDatabases, version and database on
mySqlDatabases, and database on postgreSqlDatabases. neo4jDatabases is left
alone because its documented default is the resource name, which a static
default cannot express.

The mySqlDatabases version default is 8.4, which is what the AWS Terraform and
Kubernetes Bicep recipes already fall back to when version is unset. The Azure
pack maps everything except 5.7 to 8.0.21, so it deploys the same image either
way and only AWS and Kubernetes would notice a different value. Declaring 8.0
here would have silently downgraded them, and a running RDS instance rejects a
major version downgrade outright.

Related to radius-project/radius#12532

Signed-off-by: Mike Azure <127820851+AzureMike@users.noreply.github.com>
@AzureMike
AzureMike requested review from a team as code owners July 28, 2026 03:08
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

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