Skip to content

docs(cloudformation): generate the supported resource-type table - #2739

Open
hectorvent wants to merge 1 commit into
mainfrom
docs/cfn-generate-resource-type-table
Open

docs(cloudformation): generate the supported resource-type table#2739
hectorvent wants to merge 1 commit into
mainfrom
docs/cfn-generate-resource-type-table

Conversation

@hectorvent

Copy link
Copy Markdown
Collaborator

Summary

The CloudFormation Supported Resource Types table was hand-maintained, and had drifted. Ten
provisioned types were undocumented:

Service Undocumented
CloudFront Distribution (the entire row was missing)
Lambda Permission, MicrovmImage, NetworkConnector
RDS DBProxy, DBProxyTargetGroup
ECS CapacityProvider, ClusterCapacityProviderAssociations
EC2 VPCEndpoint
API Gateway v2 Authorizer

This generates the table from the provisioner inventory TSV that CfnResourceInventoryTest already
pins to the CDI-resolved registry (added in #2732), so it can no longer drift from what Floci
actually provisions. make docs-sync writes it, make docs-check gates it.

Stacked on #2732 — review that first; this branch contains its commit.

Why the TSV and not the Java

Several provisioners return Set.of(CONSTANT, CONSTANT) from resourceTypes(), so a source regex
sees only a subset (22 of 33 today). The TSV is the one representation that is both machine-checked
against the running registry and readable without a JVM.

The table is prose as much as data

A naive generator would have destroyed real information, so presentation stays configurable in
cfn_resource_types.yaml:

  • type_order keeps the curated reading order (VPC, Subnet, SecurityGroup… not
    alphabetical). Types not listed are appended alphabetically, so a newly provisioned type still
    appears without touching the config.
  • notes / row_notes preserve the existing annotations, including the Lambda row's
    explanation of cfn-response injection.
  • extra_types covers capabilities that are real but are not provisioner types, each requiring
    a stated reason. Nested Stack and the Custom::* wildcard are the two: the wildcard cannot
    be an inventory type, because the registry is keyed by exact type.

Also gated, cheaply

Two checks that otherwise need a Quarkus boot now run in docs-check: a provisioner missing
@ApplicationScoped (CDI silently never registers it), and a type claimed by both the legacy switch
and a provisioner (the registry wins, leaving a switch arm that looks live but is dead).

The workflow's path filters gained src/test/resources/cloudformation/**. The inventory lives under
src/test, which src/main/** did not cover, so a migration slice that only moved a type between
owners would have skipped this gate entirely.

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

AWS Compatibility

N/A. Documentation and build tooling only; no Java changed, so no emulated surface is affected.

Checklist

  • ./mvnw test passes locally
  • New or updated integration test added
  • Commit messages follow Conventional Commits

make docs-test 50 passed (16 new). make docs-check clean. No Java touched, so the Java suite is
unaffected and was not re-run beyond #2732's full green run.

Gate mutation-tested rather than trusted for passing:

Mutation Result
Added an undocumented provisioner type to the inventory --check fails: table stale, plus a warning that the namespace has no label
Removed @ApplicationScoped from SqsCfnProvisioner --strict fails naming the file and the consequence
Ran the generator twice Idempotent, no diff

@hectorvent
hectorvent requested a review from pgermosen as a code owner August 29, 2026 22:26
@greptile-apps

greptile-apps Bot commented Aug 29, 2026

Copy link
Copy Markdown

Greptile Summary

The PR generates the CloudFormation supported-resource table from the tested provisioner inventory and adds inexpensive consistency checks to the documentation workflow.

  • Adds configurable service labels, ordering, notes, and non-inventory resource types.
  • Updates the generated CloudFormation documentation with previously omitted resource types.
  • Expands workflow path filters so inventory-only changes run the documentation gate.

Confidence Score: 4/5

The PR is not yet safe to merge because the outstanding CDI detector can fail documentation CI for valid Java annotation syntax.

The strict documentation gate still determines CDI registration through a raw @ApplicationScoped substring check, so a correctly scoped provisioner using the fully qualified annotation is reported as unregistered and causes make docs-check to fail.

Files Needing Attention: tools/docs/regen_cfn_resource_types.py

Important Files Changed

Filename Overview
tools/docs/regen_cfn_resource_types.py Generates and validates the resource-type table, but its previously reported CDI annotation detector remains based on brittle source substrings.
tools/docs/cfn_resource_types.yaml Defines table ordering, labels, annotations, namespace merging, and justified non-inventory capabilities.
tools/docs/test_regen_cfn_resource_types.py Covers rendering, ordering, warnings, inventory parsing, and marker splicing.
docs/services/cloudformation.md Adds generated markers and documents the provisioner-backed resource types currently represented by the inventory.
Makefile Integrates resource-table generation and strict validation into the existing documentation commands.
.github/workflows/docs-actions.yml Runs documentation validation when the CloudFormation test inventory changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    I[Provisioner inventory TSV] --> G[CloudFormation docs generator]
    C[Presentation YAML] --> G
    G --> D[Supported resource-type table]
    M[make docs-check] --> G
    G --> W[Inventory ownership and CDI checks]
    D --> S[Staleness check]
    W --> R[CI result]
    S --> R
Loading

Reviews (2): Last reviewed commit: "docs(cloudformation): generate the suppo..." | Re-trigger Greptile

for path in sorted(PROVISIONER_DIR.glob("*CfnProvisioner.java")):
src = path.read_text(encoding="utf-8")
if "implements CfnResourceProvisioner" not in src:
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Brittle CDI annotation detection

The raw substring check rejects a correctly scoped provisioner written as @jakarta.enterprise.context.ApplicationScoped, while the same substring in a comment satisfies the check without applying the annotation. Because docs-check runs this detector in strict mode, valid annotation syntax can fail CI and comments can bypass the intended early warning.

Context Used: AGENTS.md (source)

@pgermosen pgermosen added cloudformation AWS CloudFormation documentation Improvements or additions to documentation labels Aug 30, 2026

@pgermosen pgermosen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the content — read the generator script and its full test suite, the doc drift it's closing is real, and the double-ownership/@ApplicationScoped checks are a nice complement to #2732's guardrails.

One thing before this lands, though: the base branch here is refactor/cfn-wave0-enablers, and #2732 was squash-merged into main rather than fast-forwarded — ac71876 (this branch's parent) isn't actually an ancestor of main. So merging as-is would land this into the now-orphaned feature branch, not main. Could you retarget the base to main (and rebase — the diff right now still carries all of #2732's already-merged changes)?

@hectorvent
hectorvent changed the base branch from refactor/cfn-wave0-enablers to main August 30, 2026 05:24
The "Supported Resource Types" table was hand-maintained, and had drifted:
ten provisioned types were undocumented, including the whole CloudFront
row, Lambda's Permission/MicrovmImage/NetworkConnector, RDS DBProxy and
DBProxyTargetGroup, ECS capacity providers, EC2 VPCEndpoint and
ApiGatewayV2 Authorizer.

Generate it from the provisioner inventory TSV that CfnResourceInventoryTest
already pins to the CDI-resolved registry, so the table cannot drift from
what Floci actually provisions. Wired into docs-sync and docs-check, with
the inventory path added to the workflow filters: it lives under
src/test/resources, which src/main/** did not cover, so a slice that moved
a type between owners would have skipped the gate.

The table is prose as much as data, so presentation stays configurable in
cfn_resource_types.yaml: service labels, curated type order (types not
listed there are appended alphabetically, so a new type still appears),
per-type notes, and extra_types for capabilities that are real but are not
provisioner types, each needing a stated reason. Nested Stack and the
Custom::* wildcard are the two such entries; the wildcard cannot be an
inventory type because the registry is keyed by exact type.

The generator reads the TSV rather than the Java because several
provisioners return Set.of(CONSTANT, CONSTANT) from resourceTypes(), which
a source regex only partly sees.

Also flags two things cheaply, before anyone waits on a Quarkus boot: a
provisioner missing @ApplicationScoped, and a type claimed by both the
legacy switch and a provisioner.
@hectorvent
hectorvent force-pushed the docs/cfn-generate-resource-type-table branch from 6338b33 to 4482420 Compare August 30, 2026 05:34
from __future__ import annotations

import argparse
import re
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cloudformation AWS CloudFormation documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants