feat(datastore/mongo): logical flavour#362
Merged
Merged
Conversation
…ting mongo 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" clashes 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
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.
Summary
Adds a new
logicalflavour fordatastore/mongo— a logical database hosted on an existing / shared mongo / DocumentDB instance. It creates no cloud resources and requires no provider; it re-exposes the connection outputs of an already-provisioned mongo / DocumentDB datastore.(Named
logicalrather thanreferenceto avoid clashing with Facets' cross-blueprint reference concept.)The host instance is selected via the
sourcespec field (x-ui-output-type: '@facets/mongo'), which resolves the SELECTED resource's full outputs (interfaces + attributes) intovar.instance.spec.source. Because it is an ordinary spec field, it is per-environment override-able — point staging and prod at different physical clusters.Covers AWS DocumentDB and any other
@facets/mongo-emitting flavour.Use case: staging DB consolidation — collapse multiple logical databases onto a single physical mongo/DocumentDB cluster while each logical resource keeps its own connection contract.
Behaviour
@facets/mongo(same contract as the other mongo flavours).main.tfdeclares onlyterraform { required_version }— zero resources, zerorequired_providers.writer/reader/clusterinterfaces (host / port / username / password / connection_string / name / secrets) plus passthroughattributesfromvar.instance.spec.source.database_name(optional): when set, the logical DB is spliced into each connection string and thenamefield, preserving existing query params (tls,replicaSet, etc.).lookup()used for all optionals.Validation
terraform fmt,init -backend=false,validate— all pass.raptor create iac-module --dry-run— all checks pass (no-provider, variables, fmt, init, validate, security) except the@facets/mongooutput-type catalog lookup, which fails identically for the existingaws-documentdbflavour. This is a pre-existing server-catalog gap, not specific to this module.🤖 Generated with Claude Code
https://claude.ai/code/session_01PKZUrLtUbJS5GuEyRA8Vd5