feat(core) Add resource type and properties for all CfnResource constructs to tree.json#4894
feat(core) Add resource type and properties for all CfnResource constructs to tree.json#4894
Conversation
…ructs to tree.json Modifies the children node from an array to an object with each child object keyed on its id. Adds an interface `IInspectable` that constructs can optionally implement to contribute attributes into `tree.json`. For extensibility, the `inspect` method accepts an `ITreeInspector`. This way, new capabilities can be added without changing the contract of inspectable constructs. Generated classes for Cfn resources implement `IInspectable` and share their resource type and props
|
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
| } | ||
|
|
||
| public inspect(inspector: ITreeInspector) { | ||
| inspector.attribute('aws:cdk:cloudformation:type', 'CDK::UnitTest::MyCfnResource'); |
There was a problem hiding this comment.
weren't these supposed to be added by the CfnResource base class?
| * } | ||
| * | ||
| */ | ||
| private emitTreeAttributes(resource: genspec.CodeName): void { |
There was a problem hiding this comment.
why not implement this in CfnResource?
There was a problem hiding this comment.
I initially started out trying that, but the main reason for the shift was the properties, each generated class has it's own implementation of cfnProperties which is being emitted here.
Is there another way past that I haven't considered?
There was a problem hiding this comment.
Ok let’s leave it like this for now
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
| * } | ||
| * | ||
| */ | ||
| private emitTreeAttributes(resource: genspec.CodeName): void { |
There was a problem hiding this comment.
Ok let’s leave it like this for now
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Modifies the children node from an array to an object with each child object keyed on its id.
Adds an interface
IInspectablethat constructs can optionally implement to contribute attributes intotree.json.For extensibility, the
inspectmethod accepts anITreeInspector. This way, new capabilities can be added without changing the contract of inspectable constructs.Generated classes for Cfn resources implement
IInspectableand contribute their resource type and propsSupercedes #4562
TODO:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license