fix(datastore): make restore_config optional() to match x-ui-overrides-only#367
Merged
Merged
Conversation
…s-only
Several datastore modules marked restore_config x-ui-overrides-only in
facets.yaml (not a primary spec field) but declared it as a non-optional
attribute in variables.tf. A spec that omitted restore_config passed schema
validation, then failed terraform plan with
`attribute "restore_config" is required` — no signal until plan time.
Wrap restore_config in optional(...) with a safe default (restore_from_backup
= false; {} for the all-optional azure mysql block) so the un-set case just
works. Existing validations already short-circuit on the no-restore path, so
behavior is unchanged when the block is provided.
Modules fixed: mysql/aws-rds, postgres/aws-rds, mysql/gcp-cloudsql,
postgres/gcp-cloudsql, mysql/flexible_server, redis/gcp-memorystore.
(imports was already optional everywhere; azure postgres + aws redis already
clean.)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
unni-facets
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wraps
restore_configinoptional(...)with safe defaults across 6 datastore modules.Why
These modules mark
restore_configasx-ui-overrides-only: trueinfacets.yaml(so it isn't a primary spec field), but declared it as a non-optional attribute invariables.tf. The result:restore_configpasses schema validation.terraform planthen fails:attribute "restore_config" is required.The caller got no signal until plan time that a schema-passing spec was incomplete. Surfaced during the 2026-06-24 multi-cloud validation run (worked around at apply time by setting the block explicitly).
Changes
restore_config = object({...})→restore_config = optional(object({...}), <default>):mysql/aws-rds{ restore_from_backup = false }postgres/aws-rds{ restore_from_backup = false }mysql/gcp-cloudsql{ restore_from_backup = false }postgres/gcp-cloudsql{ restore_from_backup = false }redis/gcp-memorystore{ restore_from_backup = false }mysql/flexible_server(azure){}(all fields already optional)Existing validation blocks (mysql/gcp-cloudsql, mysql/flexible_server) already short-circuit on the no-restore path, so behavior is unchanged when the block is provided.
Scope notes
importswas alreadyoptional()in every module — no change needed.postgres/azure-flexible-serverandredis/aws-elasticachewere already clean.redis/gcp-memorystorehad the same drift (not in the original ticket) — included here.terraform fmt -checkpasses on all 6.🤖 Generated with Claude Code