RFC for CDK LSP and Web Explorer#923
Conversation
Add RFC for CDK LSP and Web Explorer tools to enhance CDK development experience.
kaizencc
left a comment
There was a problem hiding this comment.
nice! a few comments here and there
| Wireframe: | ||
|  | ||
|
|
||
| Clicking any element in one panel highlights the corresponding elements in the other two. Click a |
There was a problem hiding this comment.
hmm: for your actual readme, consider embedding a video/demo of going through the site
| construct in the tree to see which CloudFormation resources it produces and which line of code created it. Click a resource in the template to jump to | ||
| the CDK code that generated it. | ||
|
|
||
| A violations sidebar shows offline validation findings grouped by severity. Clicking a violation navigates all three panels to the relevant construct. |
There was a problem hiding this comment.
potential extension: if the violation has a suggested fix, maybe we can add a "click to fix" UI button
There was a problem hiding this comment.
added to extensions section
| #### Limitations | ||
|
|
||
| * Re-synthesis on save depends on synth speed; large apps (50+ stacks) may take 10-30s to refresh | ||
| * The explorer is read-only — it does not modify source files or deploy resources |
There was a problem hiding this comment.
any specific reason why? i feel like a "click to deploy" button might be a natural move after visualization, although that might be closer to cdk-as-a-service
There was a problem hiding this comment.
click to deploy is a good point, I'll add that to extensions! see next comment about being read-only
|
|
||
| ### Do I need AWS credentials? | ||
|
|
||
| No. Both tools work entirely offline by reading the synthesized cloud assembly (`cdk.out/`). |
There was a problem hiding this comment.
synthesis uses aws credentials though
There was a problem hiding this comment.
i think we talked about this briefly in my RFC meeting: for stuff like lookups which do require credentials, synth won't fail. I think keeping this credential-free is useful
| source-linking and violation annotations. By end of Phase 3, VS Code users can click constructs to navigate to source, see violations as tree | ||
| annotations, and access construct-to-resource mappings natively. | ||
|
|
||
| #### Features |
There was a problem hiding this comment.
nit: what do the P0, P1 labels stand for? If they are priority, you should say so and also we typically don't have that many distinct priorities. I think perhaps you mean milestones? if so lets make it clear that M0 is prework, M1 is MVP, M2 is improvements, etc
There was a problem hiding this comment.
yep, i did mean priority, but I'll make it milestones.
|
|
||
| ### What are the drawbacks of this solution? | ||
|
|
||
| * **Synth latency as a bottleneck.** The CDK LSP's data comes from the cloud assembly, which requires running the entire CDK app. For large apps, |
There was a problem hiding this comment.
how will we communicate that the app is out of date?
There was a problem hiding this comment.
There's a staleness indicator in the wireframe below the synth button.
| A violations sidebar shows offline validation findings grouped by severity. Clicking a violation navigates all three panels to the relevant construct. | ||
| The explorer watches your source files and re-synthesizes automatically on save. While synthesis is running, a progress indicator appears. If | ||
| synthesis fails, the explorer shows the failure and continues displaying the last successful results. A timestamp shows when data was last refreshed; | ||
| if source files have been modified since, a staleness warning appears. A manual "Synth now" button is available for forced refresh or when auto-synth |
There was a problem hiding this comment.
Where do I disable autosynth
There was a problem hiding this comment.
Let me add a toggle in the wireframe, and an option to startup
|
|
||
| #### AI Agent Integration | ||
|
|
||
| In Claude Code, install the CDK LSP plugin or add to your `.lsp.json`: |
There was a problem hiding this comment.
i dislike that there are so many sources of truth for "how should i configure my agents to do cdk." Maybe it can be bundled with aws agent-toolkit
| * **Validation report schema stabilization.** The `policy-validation-report.json` schema is not yet part of the versioned cloud assembly schema | ||
| (`cdklabs/cloud-assembly-schema`). This is pending and expected to be resolved by project launch. | ||
|
|
||
| ## Appendix |
There was a problem hiding this comment.
i would like something along the lines of: what is out of scope / what are good follow up issues or improvements (or could fold this into '### Are there any open issues that need to be addressed later?' section if you want). for example:
- non-ts LSP diagnostic support
- fix button on violations
- other ui ideas that are interesting but not planned
There was a problem hiding this comment.
Added this section at the end of the doc
| * **Asset exploration.** Surface asset metadata (size, type, connected resources) through the LSP and web explorer. | ||
| * **Feature flags management.** Display and manage feature flag state from the web explorer. | ||
| * **Online validation.** Trigger online validation from the explorer or editor. Requires AWS credentials and surfaces account-specific findings. | ||
| * **AI-powered quick fixes.** Using an AI model to generate fixes for violations based on structured context (rule name, construct path, resource |
There was a problem hiding this comment.
is this different than Click-to-fix UI for violations or do they work the same way and you are just separating ui from functionality
There was a problem hiding this comment.
yeah, just separating UI from functionality. the click to fix button was more about adding fixes to the web explorer (which in the MVP is completely read-only) and this point is more about hooking that button up to a model with context to do dynamic fixes, rather than just deterministic very simple fixes without AI.
| * **API Bar Raiser**: @ShadowCat567 | ||
|
|
||
| CDK developers cannot see what their code creates, discover deployment failures too late, and must jump between disconnected tools to debug. The CDK | ||
| LSP and Web Explorer close this gap by surfacing construct-to-resource mappings, validation diagnostics, and three-way linked navigation directly in |
There was a problem hiding this comment.
Can you elaborate a bit more on what tools users would have to use to debug with the current CDK experience? Another thing to consider is currently users may have to run several different commands and dig through their Cloudformation templates to get info that is surface automatically be the explorer/LSP.
Can you also explain a but what the 3-way linked navigation is since at this point it is very mysterious.
There was a problem hiding this comment.
Yep, added a couple sentences spelling this out
| * Had to repeatedly run `cdk synth` to check for validation errors while iterating on code | ||
| * Struggled to trace from a CloudFormation error back to the CDK code that caused it | ||
|
|
||
| These tools close that gap. The explorer gives you a visual map of your entire app. The LSP gives you immediate feedback while writing code without |
There was a problem hiding this comment.
I want you to dig a bit deeper and explain how the Web Explorer and LSP addresses these bullet points, this would also be a good opportunity to talk about other cool things you have planned for the Web Explorer and LSP server.
(essentially, I want to see you rephrase the above section of what we are launching with a focus on how exactly what we are launching helps fix customer pain points)
There was a problem hiding this comment.
will do, redid this responding to each point directly and also added a sentence on future features we have planned
|
|
||
| ### Why should we *not* do this? | ||
|
|
||
| **Why build both an LSP server and a web interface?** Maintaining two UI surfaces adds complexity. However, the two tools serve fundamentally |
There was a problem hiding this comment.
This doesn't really explain why we might not want to do this. I think you could lead this section with Why not only build the web explorer? and hit a lot of the same points (based on your alternatives introduced later it might be better to think about this second option). Or Why build these tools at all?, they add operational burden for us and no one has really been asking for them, what makes you think the usefulness of these tools is worth the cost of building them?
I think this section could be made stronger if you focused on a different question here
There was a problem hiding this comment.
got it, rephrased this section that way
| The web explorer is launchable from the CDK CLI, which is IDE-agnostic and accessible to all customers. The LSP integrates into VSCode via the AWS | ||
| Toolkit plugin, and the Toolkit's existing CDK tree view is enhanced with source-linking and violation annotations. | ||
|
|
||
| Functionality will be built as new packages here: https://github.com/aws/aws-cdk-cli/tree/main/packages |
There was a problem hiding this comment.
you could also say 'Functionality will be build as a new package in the CDK CLI.' but this also works.
| * **VSCode extension:** an AWS Toolkit integration that spawns `cdk lsp` and connects as a standard LSP client | ||
|
|
||
| **Cloud assembly as the data layer** | ||
| The LSP server reads from the cloud assembly (`cdk.out/`) produced by `cdk synth`. This gives it a consistent, offline data source with no credentials |
There was a problem hiding this comment.
Can you make it a bit more clear that the LSP uses the shared core to interpret the below files. I also think your design has changed a bit since you last touched this section so can you discuss the updates you made?
There was a problem hiding this comment.
got it, yep, redid to reflect the new architecture
| The web explorer adds visual, navigable context that a flat JSON report cannot provide — clicking through the construct tree to see what a line of | ||
| code produces is qualitatively different from reading a validation report. | ||
|
|
||
| ### What is the technical solution (design) of this feature? |
There was a problem hiding this comment.
How are we keeping the synth fresh? Are we getting synth data from cdk synth/cdk deploy?
There was a problem hiding this comment.
added a section on this. we don't run deploy, but yes, data comes from synth
- Expand intro with the current debug workflow and define three-way linked navigation - Map customer pain points to LSP/Explorer capabilities and add planned extensions - Reframe the why-not section around 'Why not only build the web explorer?' - Clarify the shared core library interprets the cloud assembly, and that the web explorer now embeds the core directly instead of spawning cdk lsp over JSON-RPC - Move file watching, synth triggering, and caching to the shared core - Add a 'Keeping the data fresh' note (data comes from cdk synth, not cdk deploy)
Add RFC for CDK LSP and Web Explorer tools to enhance CDK development experience.
This is a request for comments about CDK LSP and Web Explorer. See #920 for
additional details.
APIs are signed off by @ShadowCat567.
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache-2.0 license