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
But that call does nothing (silently; it seems to be a complete no-op). In order to express the dependency, we had to do the following: (this.restApi.latestDeployment?.node.defaultChild as apiGateway.CfnDeployment).addDependsOn(method.node)
I'm not sure whether this is a product bug or a documentation bug, but it was pretty challenging to square the behavior I was seeing with the documentation.
I've tracked down the source of the issue. My setup involves a CDK library imported as a separate package. The resource dependency is added during the prepare phase. The constructs library uses instanceof cdk.Construct to determine whether to call .prepare(). Because my dependency manager has installed two separate instances of CDK 1.31.0, the instanceof evaluates to false, because they are not the exact same object.
This seems to be the same issue addressed in #1245, but in a different place.
I am working to try and get my dependency manager to dedupe these in a nice way, but it's a little tricky given our setup. Avoiding the instanceof call would be nice.
@rigsbyt - using different versions of the CDK packages will cause this. This has been a source of issues for many customers and it's not easy to root cause that this is the problem.
Per the Cloudformation documentation, APIGateway deployments must depend on any methods: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-deployment.html#aws-resource-apigateway-deployment--examples
Per the CDK documentation here, it sounds like all you should need to do to express this in CDK is
deployment.node.addDependency(method)
: https://docs.aws.amazon.com/cdk/api/latest/docs/core-readme.html#construct-dependenciesBut that call does nothing (silently; it seems to be a complete no-op). In order to express the dependency, we had to do the following:
(this.restApi.latestDeployment?.node.defaultChild as apiGateway.CfnDeployment).addDependsOn(method.node)
I'm not sure whether this is a product bug or a documentation bug, but it was pretty challenging to square the behavior I was seeing with the documentation.
Reproduction Steps
Error Log
Silently, nothing happens.
Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: