core: CfnResource.isCfnResource is too permissive #30473
Labels
@aws-cdk/core
Related to core CDK functionality
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
I created a construct class with a cfnResourceType property. I use that type to search for a CfnResource under the parent of that construct. But my non-CfnResource class is recognized as a CfnResource by the CDK because it has a cfnResourceType property! Wrong!
Expected Behavior
That would be a lot better because isCfnElement has an RTTI symbol property.
Current Behavior
Reproduction Steps
Possible Solution
Either this:
Or maybe:
Additional Information/Context
When I try to synthesize a stack with a fake CfnResource, I get the following error:
CDK CLI Version
2.120.0 (build 58b90c4)
Framework Version
No response
Node.js Version
10.2.5
OS
MacOS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: