You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resource can be created via aspects and they will be added to the construct tree during the invokeAspects phase in prepare. Since aspects are applied to a scope, it is possible that the a resource created via aspect will be created in a scope that has other aspects applied. However, whether these aspects will be invoked on the newly created resource depends on the order of aspects invocation.
An easy example to think of to fully understand the problem are Tags, which are implemented using aspects. Lets say that I want to tag all of the resource in my application with foo:bar:
constroot=newApp();root.node.applyAspect(newTag('foo','bar'));//adds the tag to all taggable resources under root conststack=newStack(root,'MyStack');constresourceA=newConstruct(stack,'ResourceA');// TaggableResource is a resource that can be taggednewTaggableResource(resource,'Resource',{type: 'AWS::Fake::Thing',});
Additionally, I would like to apply MyAspect that creates a resource to resourceA:
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Resource can be created via aspects and they will be added to the construct tree during the
invokeAspects
phase in prepare. Since aspects are applied to a scope, it is possible that the a resource created via aspect will be created in a scope that has other aspects applied. However, whether these aspects will be invoked on the newly created resource depends on the order of aspects invocation.An easy example to think of to fully understand the problem are Tags, which are implemented using aspects. Lets say that I want to tag all of the resource in my application with
foo:bar
:Additionally, I would like to apply
MyAspect
that creates a resource toresourceA
:Apply
MyAspect
toresourceA
:Since aspects are applied root to leaves, the newly created resource will not be tagged since it was created after the tag aspect has been invoked.
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: