RenovoSolutions / cdk-aspects-library-security-group

A CDK library containing EC2 security group related CDK Aspects and the ability to define custom aspects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need the ability to test aspects in other libraries or stacks

bmiller08 opened this issue · comments

Is your feature request related to a problem? Please describe.
The aspect classes work in testing within the library and seem to work in practice, but the aspects then become a testing hole everywhere the library is utilized. It would helped prevent breaking changes from propagating to projects that rely on these aspects if the testing code for the aspects was also available within the library since examining the stack manifest isn't super simple.

Describe the solution you'd like
Rework the getMetadataAnnotations function to take return annotations for any resource path. Create a better function to get the node id for the resource being tested.

Describe alternatives you've considered
Collecting all annotations, but then you'd have to parse the results for the resource path you want anyway.

Proposed implementation

function getMetadataAnnotations(app:cdk.App, id:string) {
  // look for the key associated with the id of the resource in the manifest data
  // for each item under that key look for the type aws::cdk::<error type>
  // add to returned array of annotations
}

Any downsides to this approach
Still complex, but currently dont see easier ways to collect this data.

This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.

Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen.

Still worth pursuing at some point.

This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.

Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen.

Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen.

Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen.