Skip to content

Support for IInspectable, CFN metadata and file links for those in CDK browser. #3033

Open
@michanto

Description

@michanto

Problem

I am developing a framework for importing CloudFormation into the CDK using CfnInclude. As part of this, I am adding data to my constructs via IInspectable:

"mylibrary.cfnBuildTemplate": "/a-long-path/sam/template.yml"

These do not show up in the AWS Toolkit CDK browser.

What I am looking for is a way for my users to compare resources in the original template against the same resource as imported by CfnInclude. This will help convince my users that importing their existing templates with CfnInclude is a safe operation which results in a functionally equivalent template, and it will show them exactly how CfnInclude changes the template that is imported. This will increase trust in CfnInclude.

I have also developed an InlineNodeJsFunction that minifies the inline code using esbuild. I would like it if the minified file could also come up in VS code. That IInspectable attribute looks like this:

"mylibary.InlineNodejsFunction.tmpfile" : "/path/to/tempfile/filename.js"

This feature request would also support this second use-case.

Expected behavior

I would like the following:

P0. IInspectable attributes show up in the CDK browser. They can be copied (key and value together and/or separately).
P1. If the IInspectable attribute represents local file path, double clicking (or similar interaction with) the attribute brings up the file.
P1. If the user double clicks a stack in the CDK browser, the template file for the stack in cdk.out directory is opened.
P2. If the IInspectable attributes represents a local file path with line numbers:

"mylibrary.resource.cfnTemplateLink": "/a-long-path/sam/template.yml#220-240"

The file opens and is synced to the line numbers

P2. If a user double clicks on a RESOURCE or property in the Cdk browser, the template file from cdk.out opens in the VS code editor for viewing, with the resource or property synced. From the on, single click will keep the two windows synchronized.
P2. If the user right clicks on a construct or property in the CDK browser, they can choose to show EITHER tree.json or the template file for that construct or property.
P3. CFN metadata for resources shows up in the CDK browser. I do add some metadata, but this is lower priority than IInspectable support. Obviously skip the aws:cdk:path metadata, as that is already shown in the tree view.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cdkfeature-requestNew feature or enhancement. May require GitHub community feedback.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions