Hi, I am building a CDK application, micro service architecture leveraging services like ECS Fargate, AppMesh.
So far I have only 2 services, Service-a-Stack and Service-b-stack. For service to service communication I created a third stack called ClouldMap-stack. I export resources from shared Cloud-Map-Stack into Service-a and Service-b stack to utilise cloudMapNamespace defining ECS service.
const serviceA = new FargateService(this, `ServiceA`, {
serviceName: 'service-a',
cluster,
taskDefinition: serviceATaskDef,
desiredCount: 1,
securityGroups: [allowAllSG],
cloudMapOptions: {
cloudMapNamespace // imported from CloudMap Stack
}
This pattern work well
Now, I'd like to meshify
the application. First guess is to create a 4th Stack where appMesh is defined and import resources from there into Service Stacks. But this approach brakes micro service principe - decoupling
. I want keep my stacks independent as much as possible.
the questions are:
- is it a good idea to create appMesh per Stack, assuming service to service communication with in multiple stacks?
- is appMesh to AppMesh communication enabled if utilising the same cloudmap Namespaces say clouster.local