-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(AppMesh): How to create two virtual service/node with bidirectional backend without circular dependencies #17322
Comments
Hello @FranzBusch and thank you very much for submitting your issue. We will be looking into this and get back to you as soon as possible. |
Hello @FranzBusch, sorry for the late response. We are still investigating this issue |
Thanks for the info. We are able to reproduce the issue and are now figuring out how to fix this or provide a workaround. |
…e whose provider is that Node (#18265) Addresses a circular dependency issue between Virtual Nodes and Virtual Services that works for Virtual Services created with a defined `virtualServiceName` and a randomly generated name. One such example of this problem was a case where a Virtual Node had a backend that is a Virtual Service whose provider was given as the same Virtual Node. This led to the Virtual Node being dependent on the creation of the Virtual Service, and the Virtual Service being dependent on the creation of the Virtual Node. Fixes #17322 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
I was also running into the same issue and sadly I think the merged code is not fixing this. The fix is when the backend of a virtual node is also the virtual service itself where it is provider. However, the issue above mentions that if we have two virtual nodes which have a virtual service respectively and we wanna create a bidirectional backend setup between them. This is still running into circular dependencies for me and something that is super important to have in a micro service setup. The test code should look like this: // GIVEN
const stack = new cdk.Stack();
// WHEN
const mesh = new appmesh.Mesh(stack, 'mesh', {
meshName: 'test-mesh',
});
const node1 = new appmesh.VirtualNode(stack, 'test-node1', {
mesh,
serviceDiscovery: appmesh.ServiceDiscovery.dns('test1'),
});
const myVirtualService1 = new appmesh.VirtualService(stack, 'service-1', {
virtualServiceProvider: appmesh.VirtualServiceProvider.virtualNode(node1),
virtualServiceName: 'service1.domain.local',
});
const node2= new appmesh.VirtualNode(stack, 'test-node2', {
mesh,
serviceDiscovery: appmesh.ServiceDiscovery.dns('test2'),
});
const myVirtualService2 = new appmesh.VirtualService(stack, 'service-2', {
virtualServiceProvider: appmesh.VirtualServiceProvider.virtualNode(node2),
virtualServiceName: 'service2.domain.local',
});
node1.addBackend(appmesh.Backend.virtualService(myVirtualService2));
node2.addBackend(appmesh.Backend.virtualService(myVirtualService1)); |
@PhilippBs - Thanks for reporting the issue. We will further validate if the issue is still reproducible. @FranzBusch - Please also let us know if you are experiencing the same issue. |
@PhilippBs The latest version of You can tell the new vs old version by inspecting the CloudFormation template generated using Old:
New:
|
A new version of |
|
…e whose provider is that Node (aws#18265) Addresses a circular dependency issue between Virtual Nodes and Virtual Services that works for Virtual Services created with a defined `virtualServiceName` and a randomly generated name. One such example of this problem was a case where a Virtual Node had a backend that is a Virtual Service whose provider was given as the same Virtual Node. This led to the Virtual Node being dependent on the creation of the Virtual Service, and the Virtual Service being dependent on the creation of the Virtual Node. Fixes aws#17322 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
What is the problem?
I am currently setting up a CDK stack using ECS and AppMesh to create a micro service environment. In this micro service environment, every service should be able to talk to every other service. What I am trying to do is create a VirtualNode & Service per micro service and then call
addBackend
for each of these services and add all other services. However, this creates a cyclic dependencies for all services.I haven't found a way yet to create this bidirectional backend setup without creating cyclic dependencies inside the CDK.
Reproduction Steps
What did you expect to happen?
I expected there to be a way to create a bidirectional connection between backend services.
What actually happened?
It always creates a circular dependency and I can't see any escape hatch
CDK CLI Version
1.130.0
Framework Version
No response
Node.js Version
9.0.0
OS
MacOS BigSur
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: