-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
applyAspect visits same node twice in Version 1.58 #9706
Comments
I wasn't able to reproduce this issue... here is the code I tried on v1.58 which synthesized and deployed without warnings:
Maybe the behavior has something to do with interaction with other constructs/aspects in your stack? There was a change to aspects introduced in #9558, so it's possible there's a regression, but it's hard for me to pinpoint. |
@NetaNir can you take a look? |
Which version did you upgrade from? It's hard to tell what could be the problem without seeing how is api.node.applyAspect({
visit: (node: cdk.IConstruct): void => {
// Add OPTIONS to all resources
if (node instanceof apiGateway.Resource) {
console.log(node.node.path);
node.addMethod('OPTIONS', optionsIntegration)
}
}
}) Might give some clue as to what is hapnning |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
When upgrading to version 1.58 we started to get an error where apply aspect visited the same node twice causing the second operation to fail
Reproduction Steps
An apply aspect on an api as follows:
and an apigateway with one resource. For example:
What did you expect to happen?
apply aspect only visits each node once
What actually happened?
An error occurred "Error: There is already a Construct with name 'OPTIONS' in Resource [resource]"
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: