Skip to content

feat(datastore/mysql): logical flavour#359

Merged
anshulsao merged 2 commits into
mainfrom
feat/mysql-reference-flavour
Jun 22, 2026
Merged

feat(datastore/mysql): logical flavour#359
anshulsao merged 2 commits into
mainfrom
feat/mysql-reference-flavour

Conversation

@anshulsao

@anshulsao anshulsao commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What

Adds a new logical flavour for the datastore/mysql intent: modules/datastore/mysql/logical/1.0.

A logical database hosted on an existing/shared MySQL instance — it re-exposes the source instance's connection outputs and creates no cloud resources and requires no providers.

Use case: staging database consolidation — several logical databases sharing one physical MySQL instance.

How

  • spec.source uses x-ui-output-type: '@facets/mysql', resolving to the SELECTED resource's FULL outputs (attributes + interfaces) into var.instance.spec.source. This is per-environment override-able, so each env can point the logical DB at a different physical instance.
  • spec.database_name (optional) names the logical DB to expose; when set, the re-emitted connection_string is rebuilt as mysql://<host>:<port>/<database_name>.
  • main.tf declares NO resources (pure passthrough).
  • outputs.tf re-emits the @facets/mysql contract (reader/writer host/port/username/password/database/connection_string/secrets) + attributes from var.instance.spec.source, using lookup() for optionals.
  • Output type matches the aws-rds sibling: @facets/mysql.

Validation

terraform fmt + terraform init -backend=false + terraform validateSuccess! The configuration is valid.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PKZUrLtUbJS5GuEyRA8Vd5

anshulsao and others added 2 commits June 22, 2026 11:35
…ting mysql datastore's outputs (no resources)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PKZUrLtUbJS5GuEyRA8Vd5
'reference' clashed with Facets' cross-blueprint reference concept.
'logical' = a logical database hosted on a shared physical instance.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PKZUrLtUbJS5GuEyRA8Vd5
@anshulsao anshulsao changed the title feat(datastore/mysql): reference flavour feat(datastore/mysql): logical flavour Jun 22, 2026
@anshulsao
anshulsao merged commit 080c81f into main Jun 22, 2026
@anshulsao
anshulsao deleted the feat/mysql-reference-flavour branch June 22, 2026 10:59
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