feat(aws): export the MicroVM service limits MicrovmApp enforces - #1403
Merged
Conversation
The composite encodes the service's real limits — the five memory tiers, the name pattern and length, the environment-variable cap, the connector bounds — verified against the upstream CDK construct and the AWS docs. All of it was module-private, so a consumer driving the same service through a different control plane had to copy the numbers. kubemicrovm-ops does exactly that: its tier profile declares the five memory sizes a second time and its lint pack a third, while its own design page names this composite as the source of truth for two planned rules it cannot import. One named object rather than seven loose constants, so the shape is discoverable and a new limit has an obvious home. The composite now reads its own validation out of it, which is what keeps the export honest — a test probes the limits through MicrovmApp's public API rather than restating them, so the two cannot drift while both look right. Worth checking whether other composites hold service limits the same way. This is unlikely to be the only one, and the general shape — a composite knowing something real that nothing else can reach — is the thing.
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.
Closes #1374.
MicrovmAppencodes the Lambda MicroVMs service's real limits — five memory tiers, name pattern and length, environment-variable cap, connector bounds — verified against the upstream CDK construct and the AWS docs. All module-private, so a consumer driving the same service through a different control plane had to copy them.kubemicrovm-ops does exactly that: its tier profile declares the five memory sizes a second time and its lint pack a third, while its own design page names this composite as the source of truth for two planned rules it cannot import.
One named object rather than seven loose constants:
The composite reads its own validation out of it, which is what keeps the export honest. The test probes the limits through
MicrovmApp's public API rather than restating them, so an export and an enforcement cannot drift apart while both look right.Reachable from the package root, guarded by the barrel test from #1337.
Worth a follow-up: whether other composites hold service limits the same way. This is unlikely to be the only one, and the general shape — a composite knowing something real that nothing else can reach — is the thing.